changeset 69312:c3bd744c874c

* help.el (describe-key): Handle string and vector `follow-link' values.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 06 Mar 2006 22:31:36 +0000
parents 86ebde8d0adc
children a81d6bd38fa8
files lisp/ChangeLog lisp/help.el
diffstat 2 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Mar 06 20:27:28 2006 +0000
+++ b/lisp/ChangeLog	Mon Mar 06 22:31:36 2006 +0000
@@ -2,7 +2,7 @@
 
 	* help.el (describe-key): Properly handle the return value of
 	read-key-sequence when grabbing an up-event.  Cleanup mouse-1
-	remaps.
+	remaps.  Handle string and vector `follow-link' values.
 
 2006-03-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
--- a/lisp/help.el	Mon Mar 06 20:27:28 2006 +0000
+++ b/lisp/help.el	Mon Mar 06 22:31:36 2006 +0000
@@ -710,19 +710,26 @@
 	    (when up-event
 	      (let ((type (event-basic-type up-event))
 		    (hdr "\n\n-------------- up event ---------------\n\n")
-		    defn
+		    defn sequence
 		    mouse-1-tricky mouse-1-remapped)
+		(setq sequence (vector up-event))
 		(when (and (eq type 'mouse-1)
 			   (windowp window)
 			   mouse-1-click-follows-link
 			   (not (eq mouse-1-click-follows-link 'double))
-			   (with-current-buffer (window-buffer window)
-			     (mouse-on-link-p (posn-point (event-start up-event)))))
-		  (setq mouse-1-remapped t)
+			   (setq mouse-1-remapped
+				 (with-current-buffer (window-buffer window)
+				   (mouse-on-link-p (posn-point
+						     (event-start up-event))))))
 		  (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
 					    (> mouse-1-click-follows-link 0)))
-		  (setcar up-event 'mouse-2))
-		(setq defn (key-binding (vector up-event)))
+		  (cond ((stringp mouse-1-remapped)
+			 (setq sequence mouse-1-remapped))
+			((vectorp mouse-1-remapped)
+			 (setcar up-event (elt mouse-1-remapped 0)))
+			(t (setcar up-event 'mouse-2))))
+		(setq defn (or (string-key-binding sequence)
+			       (key-binding sequence)))
 		(unless (or (null defn) (integerp defn) (equal defn 'undefined))
 		  (princ (if mouse-1-tricky
 			     "\n\n----------------- up-event (short click) ----------------\n\n"
@@ -739,7 +746,8 @@
 		  (describe-function-1 defn))
 		(when mouse-1-tricky
 		  (setcar up-event 'mouse-1)
-		  (setq defn (key-binding (vector up-event)))
+		  (setq defn (or (string-key-binding (vector up-event))
+				 (key-binding (vector up-event))))
 		  (unless (or (null defn) (integerp defn) (eq defn 'undefined))
 		    (princ (or hdr
 			       "\n\n----------------- up-event (long click) ----------------\n\n"))