[Top][All Lists]

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

Re: [NEW PATCH] mouse-1 click follows link

From: Kim F. Storm
Subject: Re: [NEW PATCH] mouse-1 click follows link
Date: Tue, 14 Dec 2004 16:15:26 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     + (defcustom mouse-1-click-follows-link 350
>     +   "Non-nil means that clicking mouse-1 on a link follows the link.
>     + This is only done for links which have the mouse-face property.
> That's not true any more, with the rest of your design, right?

True.  I didn't fix the doc string.

>     + If value is the symbol double, a double click follows the link.
> That should say `double'.  Or should it be :double?

It is `double'.

> Aren't there more kinds of links that need to support this?
> For instance, what about Compilation mode and Dired.

Right -- there are more places that need to be adapted, but I'm
sure that if I check these changes into CVS, that will quickly
be spotted and fixed.

In most cases, it will be as trivial as for dired and compile
as illustrated below:

Should I install these changes (with proper doc string)?

On question is how to document this in the manuals.

Of course, the Lisp ref should explain that mouse-2 is the preferred
binding for "following links", but then in details explain how to make
mouse-1 automatically follow mouse-2 links.

But what about the Emacs manual? Would a it suffice to put a generic
mentioning like this somewhere (I would add this to NEWS as well):

** A mouse-1 click now follows links 

  For historical reasons, Emacs uses mouse-2 to take action on
clickable text in a buffer, typically to follow a link to a position
in another file or buffer.  In most cases, clicking mouse-1 now also
follows a link; the exception being modes where mouse-1 has a
different binding on clickable text, or the mouse-2 action is
something more involved than just following a link.

  If you want to set the cursor in the middle of a link, rather than
following the link, just hold down the mouse-1 button for half a
second or more before releasing it.

  You can modify this behaviour by customizing the variable

*** dired.el    22 Nov 2004 22:01:22 +0100      1.298
--- dired.el    30 Nov 2004 01:12:12 +0100      
*** 1104,1109 ****
--- 1104,1110 ----
    (let ((map (make-keymap)))
      (suppress-keymap map)
      (define-key map [mouse-2] 'dired-mouse-find-file-other-window)
+     (define-key map [follow-link] 'mouse-face)
      ;; Commands to mark or flag certain categories of files
      (define-key map "#" 'dired-flag-auto-save-files)
      (define-key map "." 'dired-clean-directory)

*** compile.el  25 Nov 2004 11:21:11 +0100      1.342
--- compile.el  14 Dec 2004 15:50:34 +0100      
*** 1044,1049 ****
--- 1044,1050 ----
  (defvar compilation-minor-mode-map
    (let ((map (make-sparse-keymap)))
      (define-key map [mouse-2] 'compile-goto-error)
+     (define-key map [follow-link] 'mouse-face)
      (define-key map "\C-c\C-c" 'compile-goto-error)
      (define-key map "\C-m" 'compile-goto-error)
      (define-key map "\C-c\C-k" 'kill-compilation)
*** 1073,1078 ****
--- 1074,1080 ----
  (defvar compilation-button-map
    (let ((map (make-sparse-keymap)))
      (define-key map [mouse-2] 'compile-goto-error)
+     (define-key map [follow-link] 'mouse-face)
      (define-key map "\C-m" 'compile-goto-error)
    "Keymap for compilation-message buttons.")
*** 1084,1089 ****
--- 1086,1092 ----
      ;; because that introduces a menu bar item we don't want.
      ;; That confuses C-down-mouse-3.
      (define-key map [mouse-2] 'compile-goto-error)
+     (define-key map [follow-link] 'mouse-face)
      (define-key map "\C-c\C-c" 'compile-goto-error)
      (define-key map "\C-m" 'compile-goto-error)
      (define-key map "\C-c\C-k" 'kill-compilation)

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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