aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2005-03-31 10:10:25 +0000
committerKim F. Storm2005-03-31 10:10:25 +0000
commit5dbda518485a35ebf86dacc84fad357e55b53417 (patch)
tree1e72833f9cef20286eb0c150da3b56e274deb934
parent34514f4824cf2ee59f622694fd9e49c5a7f20841 (diff)
downloademacs-5dbda518485a35ebf86dacc84fad357e55b53417.tar.gz
emacs-5dbda518485a35ebf86dacc84fad357e55b53417.zip
(mouse-1-click-follows-link): Increase to 450 ms.
(mouse-fixup-help-message): New defun called by show_help_echo to fixup mouse-2 prefix in help messages when applicable.
-rw-r--r--lisp/mouse.el28
1 files changed, 26 insertions, 2 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index fdc99205780..a409efadeca 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -49,7 +49,7 @@
49 :version "22.1" 49 :version "22.1"
50 :group 'mouse) 50 :group 'mouse)
51 51
52(defcustom mouse-1-click-follows-link 350 52(defcustom mouse-1-click-follows-link 450
53 "Non-nil means that clicking Mouse-1 on a link follows the link. 53 "Non-nil means that clicking Mouse-1 on a link follows the link.
54 54
55With the default setting, an ordinary Mouse-1 click on a link 55With the default setting, an ordinary Mouse-1 click on a link
@@ -837,6 +837,29 @@ at the same position."
837 (funcall action pos)) 837 (funcall action pos))
838 (t action))))))) 838 (t action)))))))
839 839
840(defun mouse-fixup-help-message (msg)
841 "Fix help message MSG for `mouse-1-click-follows-link'."
842 (let (mp pos)
843 (if (and mouse-1-click-follows-link
844 (stringp msg)
845 (save-match-data
846 (string-match "^mouse-2" msg))
847 (setq mp (mouse-pixel-position))
848 (consp (setq pos (cdr mp)))
849 (car pos) (>= (car pos) 0)
850 (cdr pos) (>= (cdr pos) 0)
851 (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp)))
852 (windowp (posn-window pos)))
853 (with-current-buffer (window-buffer (posn-window pos))
854 (if (mouse-on-link-p pos)
855 (setq msg (concat
856 (cond
857 ((eq mouse-1-click-follows-link 'double) "double-")
858 ((and (integerp mouse-1-click-follows-link)
859 (< mouse-1-click-follows-link 0)) "Long ")
860 (t ""))
861 "mouse-1" (substring msg 7)))))))
862 msg)
840 863
841(defun mouse-drag-region-1 (start-event) 864(defun mouse-drag-region-1 (start-event)
842 (mouse-minibuffer-check start-event) 865 (mouse-minibuffer-check start-event)
@@ -886,6 +909,7 @@ at the same position."
886 (track-mouse 909 (track-mouse
887 (while (progn 910 (while (progn
888 (setq event (read-event)) 911 (setq event (read-event))
912 (setq mve (cons event (and (boundp 'mve) mve)))
889 (or (mouse-movement-p event) 913 (or (mouse-movement-p event)
890 (memq (car-safe event) '(switch-frame select-window)))) 914 (memq (car-safe event) '(switch-frame select-window))))
891 (if (memq (car-safe event) '(switch-frame select-window)) 915 (if (memq (car-safe event) '(switch-frame select-window))
@@ -997,7 +1021,7 @@ at the same position."
997 (= (window-start start-window) 1021 (= (window-start start-window)
998 start-window-start))) 1022 start-window-start)))
999 (if (and on-link 1023 (if (and on-link
1000 (not end-point) 1024 (or (not end-point) (= end-point start-point))
1001 (consp event) 1025 (consp event)
1002 (or remap-double-click 1026 (or remap-double-click
1003 (and 1027 (and