emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mouse-1 click follows link


From: Kim F. Storm
Subject: Re: [PATCH] mouse-1 click follows link
Date: Mon, 01 Nov 2004 00:39:48 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Stefan <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]