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.