From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: Associating a region with a link Date: Fri, 17 Oct 2008 11:13:18 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224234845 1250 80.91.229.12 (17 Oct 2008 09:14:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Oct 2008 09:14:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?utf-8?Q?Nordl=C3=B6w?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 17 11:15:05 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KqlQC-0002TG-6j for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Oct 2008 11:15:00 +0200 Original-Received: from localhost ([127.0.0.1]:42819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqlP6-00049s-Vx for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Oct 2008 05:13:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqlOf-00049c-6h for help-gnu-emacs@gnu.org; Fri, 17 Oct 2008 05:13:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqlOc-00049C-K9 for help-gnu-emacs@gnu.org; Fri, 17 Oct 2008 05:13:23 -0400 Original-Received: from [199.232.76.173] (port=58289 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqlOc-000499-8K for help-gnu-emacs@gnu.org; Fri, 17 Oct 2008 05:13:22 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:52215) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KqlOc-0005N6-8s for help-gnu-emacs@gnu.org; Fri, 17 Oct 2008 05:13:22 -0400 Original-Received: from thursday (BAH5d9e.bah.pppool.de [77.135.93.158]) by dd18200.kasserver.com (Postfix) with ESMTP id E875518AAAD53; Fri, 17 Oct 2008 11:13:21 +0200 (CEST) In-Reply-To: (=?utf-8?Q?=22Nordl=C3=B6w=22's?= message of "Fri\, 17 Oct 2008 01\:34\:24 -0700 \(PDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58868 Archived-At: Nordl=C3=B6w wrote: > How do I make a buffer-region become a link which is followed by > clicking on it like in grep-mode. How do I change the color of a > region? I think the most comfortable way is the 'button package. (define-button-type 'my-button 'follow-link t 'action 'my-action 'help-echo "mouse-2, RET: Jump...") (defun my-action (button) (goto-line (button-get button 'my-target))) (let ((beg (point))) (insert "link") (make-text-button beg (point) 'type 'my-button 'my-target 25)) You can change the color by setting the 'face property. regards, Nikolaj Schumacher