From: Yagnesh Raghava Yakkala <hi@yagnesh.org>
To: "Pascal J. Bourguignon" <pjb@informatimago.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Turning comments into hyperlinks
Date: Wed, 18 Jul 2012 23:49:40 +0900 [thread overview]
Message-ID: <878veh2kfv.fsf@yagnesh.org> (raw)
In-Reply-To: <87txx5gn3n.fsf@kuiper.lan.informatimago.com> (Pascal J. Bourguignon's message of "Wed, 18 Jul 2012 16:28:28 +0200")
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
next prev parent reply other threads:[~2012-07-18 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.5073.1342620934.855.help-gnu-emacs@gnu.org>
2012-07-18 14:28 ` Turning comments into hyperlinks Pascal J. Bourguignon
2012-07-18 14:49 ` Yagnesh Raghava Yakkala [this message]
2012-07-19 16:02 ` PJ Weisberg
2012-07-18 15:28 ` Sohail Somani
2012-07-18 14:12 Sohail Somani
2012-07-19 9:45 ` Tom Willemsen
2012-07-19 14:55 ` Sohail Somani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878veh2kfv.fsf@yagnesh.org \
--to=hi@yagnesh.org \
--cc=help-gnu-emacs@gnu.org \
--cc=pjb@informatimago.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).