From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sohail Somani Newsgroups: gmane.emacs.help Subject: Re: Turning comments into hyperlinks Date: Wed, 18 Jul 2012 11:28:02 -0400 Message-ID: References: <87txx5gn3n.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342625323 28057 80.91.229.3 (18 Jul 2012 15:28:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2012 15:28:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 18 17:28:43 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SrWB9-0004kU-0d for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Jul 2012 17:28:43 +0200 Original-Received: from localhost ([::1]:57788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrWB8-0002c3-0O for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Jul 2012 11:28:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrWAx-0002ab-0r for help-gnu-emacs@gnu.org; Wed, 18 Jul 2012 11:28:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrWAi-0006pl-Er for help-gnu-emacs@gnu.org; Wed, 18 Jul 2012 11:28:30 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:49527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrWAi-0006pa-7h for help-gnu-emacs@gnu.org; Wed, 18 Jul 2012 11:28:16 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SrWAd-00040Y-Sz for help-gnu-emacs@gnu.org; Wed, 18 Jul 2012 17:28:11 +0200 Original-Received: from 75-119-242-38.dsl.teksavvy.com ([75.119.242.38]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jul 2012 17:28:11 +0200 Original-Received: from sohail by 75-119-242-38.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jul 2012 17:28:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 75-119-242-38.dsl.teksavvy.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <87txx5gn3n.fsf@kuiper.lan.informatimago.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85921 Archived-At: On 18/07/2012 10:28 AM, Pascal J. Bourguignon wrote: > Sohail Somani 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. Thanks, I'll look into this.