]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/mouse.el (mouse--down-1-maybe-follows-link): Fix follow-link
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 19 Mar 2013 12:47:10 +0000 (08:47 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 19 Mar 2013 12:47:10 +0000 (08:47 -0400)
remapping in mode-line.
(mouse-on-link-p): Also check [mode-line follow-link] bindings.

lisp/ChangeLog
lisp/mouse.el

index a64703c3d2475513c82883893e562d8f140f0841..aae880aa8a247714f9e54ce1df9ce5cd71049b19 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mouse.el (mouse--down-1-maybe-follows-link): Fix follow-link
+       remapping in mode-line.
+       (mouse-on-link-p): Also check [mode-line follow-link] bindings.
+
 2013-03-19  Dmitry Gutov  <dgutov@yandex.ru>
 
        * whitespace.el (whitespace-color-on): Use `prepend' OVERRIDE
index ea6b1b04de020e54a67a51c083a39d5bccc6ba2e..333a1cef7034106e1fbcb7da6698b97566ced703 100644 (file)
@@ -128,7 +128,11 @@ Expects to be bound to `down-mouse-1' in `key-translation-map'."
                 (put newup 'event-kind (get (car event) 'event-kind))
                 (put newdown 'event-kind (get (car this-event) 'event-kind))
                 (push (cons newup (cdr event)) unread-command-events)
-                (vector (cons newdown (cdr this-event))))
+                ;; Modify the event in place, so read-key-sequence doesn't
+                ;; generate a second fake prefix key (see fake_prefixed_keys in
+                ;; src/keyboard.c).
+                (setcar this-event newdown)
+                (vector this-event))
             (push event unread-command-events)
             nil))))))
 
@@ -760,6 +764,9 @@ at the same position."
                  mouse-1-click-in-non-selected-windows
                  (eq (selected-window) (posn-window pos)))
              (or (mouse-posn-property pos 'follow-link)
+                  (let ((area (posn-area pos)))
+                    (when area
+                      (key-binding (vector area 'follow-link) nil t pos)))
                  (key-binding [follow-link] nil t pos)))))
     (cond
      ((eq action 'mouse-face)