(setq saved-yank-menu (copy-sequence yank-menu))
(menu-bar-update-yank-menu "(any string)" nil))
(setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (setq foo key)
(list
key
(prefix-numeric-value current-prefix-arg)
;; If KEY is a down-event, read the corresponding up-event
;; and use it as the third argument.
- (if (and (consp key) (symbolp (car key))
- (memq 'down (cdr (get (car key) 'event-symbol-elements))))
+ (if (and (vectorp key)
+ (eventp (elt key 0))
+ (memq 'down (event-modifiers (elt key 0))))
(read-event))))
;; Put yank-menu back as it was, if we changed it.
(when saved-yank-menu
(prin1 defn)
(princ "\n which is ")
(describe-function-1 defn)
+ (setq foo up-event)
(when up-event
- (let ((ev (aref up-event 0))
- (descr (key-description up-event))
+ (let ((type (event-basic-type up-event))
(hdr "\n\n-------------- up event ---------------\n\n")
defn
mouse-1-tricky mouse-1-remapped)
- (when (and (consp ev)
- (eq (car ev) 'mouse-1)
+ (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 ev)))))
- (setq mouse-1-tricky (integerp mouse-1-click-follows-link)
- mouse-1-remapped (or (not mouse-1-tricky)
- (> mouse-1-click-follows-link 0)))
- (if mouse-1-remapped
- (setcar ev 'mouse-2)))
- (setq defn (or (string-key-binding up-event) (key-binding up-event)))
+ (mouse-on-link-p (posn-point (event-start up-event)))))
+ (setq mouse-1-remapped t)
+ (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)))
(unless (or (null defn) (integerp defn) (equal defn 'undefined))
(princ (if mouse-1-tricky
"\n\n----------------- up-event (short click) ----------------\n\n"
hdr))
(setq hdr nil)
- (princ descr)
+ (princ (symbol-name type))
(if (windowp window)
(princ " at that spot"))
(if mouse-1-remapped
(princ "\n which is ")
(describe-function-1 defn))
(when mouse-1-tricky
- (setcar ev
- (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2))
- (setq defn (or (string-key-binding up-event) (key-binding up-event)))
- (unless (or (null defn) (integerp defn) (equal defn 'undefined))
+ (setcar up-event 'mouse-1)
+ (setq defn (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"))
- (princ "Pressing ")
- (princ descr)
+ (princ "Pressing mouse-1")
(if (windowp window)
(princ " at that spot"))
(princ (format " for longer than %d milli-seconds\n"
- (abs mouse-1-click-follows-link)))
- (if (not mouse-1-remapped)
- (princ " remaps it to <mouse-2> which" ))
+ mouse-1-click-follows-link))
(princ " runs the command ")
(prin1 defn)
(princ "\n which is ")
(describe-function-1 defn)))))
(print-help-return-message)))))))
-
\f
(defun describe-mode (&optional buffer)
"Display documentation of current major mode and minor modes.