[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Turning comments into hyperlinks
From: |
Yagnesh Raghava Yakkala |
Subject: |
Re: Turning comments into hyperlinks |
Date: |
Wed, 18 Jul 2012 23:49:40 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
Hello Pascal,
"Pascal J. Bourguignon" <pjb@informatimago.com> writes:
> Sohail Somani <sohail@taggedtype.net> writes:
>
>> Greetings Earthlings!
>>
>> I have come across an inconvenience which I would like to resolve. I
>> am working on a codebase which has the following patterns throughout
>> the code:
>>
>> // JIRA 12312
>> // ISSUE 12312
>> // KEY-12312
>>
>> What I would like to do is match these patterns and turn them into
>> hyperlinks that open in the browser. So for example, I might turn
>> KEY-12312 into a hyperlink to http://jira.myhomies.com/KEY-12312 but
>> continue to display the original text.
>>
>> How would I accomplish this with cc-mode or emacs in general?
>
>
> Since those patterns seem to be safely recognizable with regular
> expressions, you can use font-locking to identify them and substitute
> with with an hyperlink button. The font-lock keyword definition would
> use compose-region to overlay the text with a button which action would
> browse the url you want.
I think It would have been good, if `ffap' functions(or some other generic
library)
are more user customizable to allow such a use cases.
An alist with "regex-pattern . action-func"
Just a thought.
Thanks.,
--
ఎందరో మహానుభావులు అందరికి వందనములు
YYR