From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: mail@xuchunyang.me Newsgroups: gmane.emacs.help Subject: Re: Adding hypertlink buttons Date: Wed, 31 Oct 2018 22:36:08 +0800 Message-ID: <36711231540996568@sas1-d856b3d759c7.qloud-c.yandex.net> References: <9da059a8-fc31-4fc2-bd3d-ebe727526dbe@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Trace: blaine.gmane.org 1540996689 25418 195.159.176.226 (31 Oct 2018 14:38:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2018 14:38:09 +0000 (UTC) To: Davin Pearson , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 31 15:38:05 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHrdD-0006Sl-KF for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Oct 2018 15:38:03 +0100 Original-Received: from localhost ([::1]:59979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHrfJ-0004cP-Tw for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Oct 2018 10:40:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHrbW-0000bn-WB for help-gnu-emacs@gnu.org; Wed, 31 Oct 2018 10:36:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHrbQ-0006mw-UL for help-gnu-emacs@gnu.org; Wed, 31 Oct 2018 10:36:18 -0400 Original-Received: from forward100j.mail.yandex.net ([5.45.198.240]:37086) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHrbQ-0006lw-Gz for help-gnu-emacs@gnu.org; Wed, 31 Oct 2018 10:36:12 -0400 Original-Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 4F7142082089; Wed, 31 Oct 2018 17:36:09 +0300 (MSK) Original-Received: from localhost (localhost [::1]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DFIPvRSBUg-a8Tie1Fi; Wed, 31 Oct 2018 17:36:08 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xuchunyang.me; s=mail; t=1540996568; bh=axQqkTX4lKBItPlxq7uX9wIOeGConJCSjgtNH/Q8EEc=; h=From:To:In-Reply-To:References:Subject:Date:Message-Id; b=9J566L4ugBZbPYnBSezzoQi5YPIntwxc4TuYQtKXnUViEscX+nREc1nzxD9sCaRYy cR4A+VHyGwbn/h+SXDSlQrWmSVuZM4Ra4egd4sAL/6D8n0xkGIC0RewCA6RKO/8JMJ YUsb/sMKGB1JQ5Wc+JeiOD6Sd+g01tn3d6H7KZ2M= Authentication-Results: mxback10g.mail.yandex.net; dkim=pass header.i=@xuchunyang.me Original-Received: by sas1-d856b3d759c7.qloud-c.yandex.net with HTTP; Wed, 31 Oct 2018 17:36:08 +0300 In-Reply-To: <9da059a8-fc31-4fc2-bd3d-ebe727526dbe@googlegroups.com> X-Mailer: Yamail [ http://yandex.ru ] 5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.45.198.240 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:118537 Archived-At: A A 26.10.2018, 08:21, "Davin Pearson" : > I have written a drop in replacement for speedbar,el called d-speedbar.el > and I want to get left mouse button hyperlinks online instead of pressing ENTER on the function browser window to take you to the corresponding line for that function in the code browser window. A After consultingA (info "(elisp) Clickable Text") yesterday, IA wrote the following to insert a link to the init file, I can click or press RET onA the link to open the file. A (insert A (propertize user-init-file A A A A A A A 'mouse-face 'highlight A A A A A A A 'help-echo "mouse-2: visit this file" A A A A A A A 'follow-link t A A A A A A A 'keymap A A A A A A A (let ((map (make-sparse-keymap)) A A A A A A A A A A (cmd (lambda () A A A A A A A A A A A A A (interactive) A A A A A A A A A A A A A (find-file user-init-file)))) A A A A A A A A (define-key map [mouse-2] cmd) A A A A A A A A (define-key map [?\C-m] cmd) A A A A A A A A map)) A ?\n) A I am not sure if `:follow-link t` is correct, but it seems it is required because I remember click won't work without it.