aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mouse.el38
1 files changed, 20 insertions, 18 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index ea6aa90e3c7..53bfc38d508 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -771,21 +771,22 @@ If the click is in the echo area, display the `*Messages*' buffer."
771 771
772A clickable link is identified by one of the following methods: 772A clickable link is identified by one of the following methods:
773 773
7741) If the character at POS has a non-nil `follow-link' text or 774If the character at POS has a non-nil `follow-link' text or
775overlay property, the value of that property is returned. 775overlay property, use the value of that property as action code,
776or if there is a local key-binding or a keybinding at position
777POS for the `follow-link' event, use the binding of that event as
778action code.
776 779
7772) If there is a local key-binding or a keybinding at position 780The action code is used to determine whether POS is inside a link:
778POS for the `follow-link' event, the binding of that event
779determines whether POS is inside a link:
780 781
781- If the binding is `mouse-face', POS is inside a link if there 782- If the action code is `mouse-face', POS is inside a link if there
782is a non-nil `mouse-face' property at POS. Return t in this case. 783is a non-nil `mouse-face' property at POS. Return t in this case.
783 784
784- If the binding is a function, FUNC, POS is inside a link if 785- If the action code is a function, FUNC, POS is inside a link if
785the call \(FUNC POS) returns non-nil. Return the return value 786the call \(FUNC POS) returns non-nil. Return the return value
786from that call. 787from that call.
787 788
788- Otherwise, return the binding of the `follow-link' binding. 789- Otherwise, return the action code itself.
789 790
790The return value is interpreted as follows: 791The return value is interpreted as follows:
791 792
@@ -799,16 +800,17 @@ click is the local or global binding of that event.
799 800
800- Otherwise, the mouse-1 event is translated into a mouse-2 event 801- Otherwise, the mouse-1 event is translated into a mouse-2 event
801at the same position." 802at the same position."
802 (or (get-char-property pos 'follow-link) 803 (let ((action
803 (save-excursion 804 (or (get-char-property pos 'follow-link)
804 (goto-char pos) 805 (save-excursion
805 (let ((b (key-binding [follow-link] nil t))) 806 (goto-char pos)
806 (cond 807 (key-binding [follow-link] nil t)))))
807 ((eq b 'mouse-face) 808 (cond
808 (and (get-char-property pos 'mouse-face) t)) 809 ((eq action 'mouse-face)
809 ((functionp b) 810 (and (get-char-property pos 'mouse-face) t))
810 (funcall b pos)) 811 ((functionp action)
811 (t b)))))) 812 (funcall action pos))
813 (t action))))
812 814
813(defun mouse-drag-region-1 (start-event) 815(defun mouse-drag-region-1 (start-event)
814 (mouse-minibuffer-check start-event) 816 (mouse-minibuffer-check start-event)