From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] mouse-1 click follows link Date: Mon, 01 Nov 2004 00:39:48 +0100 Message-ID: References: <200410292354.i9TNsCq01994@raven.dms.auburn.edu> <200410310034.i9V0YX903876@raven.dms.auburn.edu> <200410311524.i9VFO6v05450@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1099266025 3419 80.91.229.6 (31 Oct 2004 23:40:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Oct 2004 23:40:25 +0000 (UTC) Cc: Luc Teirlinck , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 01 00:40:15 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1COPJ1-0001oK-00 for ; Mon, 01 Nov 2004 00:40:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1COPQz-0000di-CQ for ged-emacs-devel@m.gmane.org; Sun, 31 Oct 2004 18:48:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1COPQl-0000cy-QJ for emacs-devel@gnu.org; Sun, 31 Oct 2004 18:48:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1COPQk-0000cY-Pt for emacs-devel@gnu.org; Sun, 31 Oct 2004 18:48:15 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1COPQk-0000cI-Nk for emacs-devel@gnu.org; Sun, 31 Oct 2004 18:48:14 -0500 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1COPIR-0007qg-Qk; Sun, 31 Oct 2004 18:39:40 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepa.post.tele.dk (Postfix) with SMTP id E9C3147FE45; Mon, 1 Nov 2004 00:39:37 +0100 (CET) Original-To: Stefan In-Reply-To: (Stefan's message of "Sun, 31 Oct 2004 16:40:27 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29249 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29249 Stefan writes: >> What would the keybinding in link-keymap be? It has to resolve to >> something different for each link. > > Yes, that's a problem. Here are some ideas: > > 1 - (define-key link-parent-map [mouse-1] [mouse-2]) > (define-key this-button-keymap [mouse-2] 'foobar) > > 2 - (define-key link-parent-map [mouse-1] [follow-link]) > (define-key this-button-keymap [follow-link] 'foobar) > > 3 - (define-key link-parent-map [mouse-1] 'follow-link-command) > (define-key this-button-keymap [remap follow-link-command] 'foobar) Yes, this would work quite nicely! I prefer #2 -- it looks nice in this-button-keymap. A way to customize this would be to define a number of keymaps, e.g. legacy-emacs-follow-link-keymap [mouse-2] -> [follow-link] browser-follow-link-keymap [mouse-1] -> [follow-link] And then a customizable variable follow-link-keymap which is a choice between the above keymaps: (defcustom follow-link-keymap 'browser-follow-link-keymap ...) The link keymaps will then set the parent keymap to the symbol value of follow-link-keymap. This approach does not allow use to use double clicks on a link, as the first click follows the link -- but that's ok I guess. One question remains: How do you set point in a link ? I'll look into this approach and see what it takes. For starters, it should cover: link widgets help buttons apropos links info links url links -- Kim F. Storm http://www.cua.dk