emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/help.el,v


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/help.el,v
Date: Tue, 19 Sep 2006 13:59:27 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kim F. Storm <kfstorm>  06/09/19 13:59:27

Index: help.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help.el,v
retrieving revision 1.318
retrieving revision 1.319
diff -u -b -r1.318 -r1.319
--- help.el     16 Sep 2006 10:43:39 -0000      1.318
+++ help.el     19 Sep 2006 13:59:27 -0000      1.319
@@ -594,11 +594,9 @@
                  (aref key 0)))
         (modifiers (event-modifiers event))
         (standard-output (if insert (current-buffer) t))
-        (mousep
-         (or (memq 'click modifiers) (memq 'down modifiers)
-             (memq 'drag modifiers))))
-    ;; Ok, now look up the key and name the command.
-    (let ((defn (key-binding key t))
+        (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
+                           (memq 'drag modifiers)) " at that spot" ""))
+        (defn (key-binding key t))
          key-desc)
       ;; Handle the case where we faked an entry in "Select and Paste" menu.
       (if (and (eq defn nil)
@@ -610,17 +608,12 @@
          (aset key (1- (length key)) "(any string)"))
       (if (and (> (length untranslated) 0)
               (stringp (aref untranslated (1- (length untranslated)))))
-         (aset untranslated (1- (length untranslated))
-               "(any string)"))
+       (aset untranslated (1- (length untranslated)) "(any string)"))
       ;; Now describe the key, perhaps as changed.
       (setq key-desc (help-key-description key untranslated))
       (if (or (null defn) (integerp defn) (equal defn 'undefined))
-         (princ (format "%s is undefined" key-desc))
-       (princ (format (if mousep
-                          "%s at that spot runs the command %s"
-                        "%s runs the command %s")
-                      key-desc
-                      (if (symbolp defn) defn (prin1-to-string defn))))))))
+       (princ (format "%s%s is undefined" key-desc mouse-msg))
+      (princ (format "%s%s runs the command %S" key-desc mouse-msg defn)))))
 
 (defun describe-key (&optional key untranslated up-event)
   "Display documentation of the function invoked by KEY.
@@ -671,24 +664,25 @@
                              1
                            0)))
         (modifiers (event-modifiers event))
-        (mousep (or (memq 'click modifiers) (memq 'down modifiers)
-                    (memq 'drag modifiers)))
+        (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
+                           (memq 'drag modifiers)) " at that spot" ""))
         (defn (key-binding key t))
         defn-up defn-up-tricky ev-type
         mouse-1-remapped mouse-1-tricky)
 
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
-      (if (and (eq defn nil)
+    (when (and (eq defn nil)
               (stringp (aref key (1- (length key))))
               (eq (key-binding (substring key 0 -1)) 'yank-menu))
          (setq defn 'menu-bar-select-yank))
       (if (or (null defn) (integerp defn) (equal defn 'undefined))
-         (message "%s is undefined" (help-key-description key untranslated))
+       (message "%s%s is undefined"
+                (help-key-description key untranslated) mouse-msg)
        (help-setup-xref (list #'describe-function defn) (interactive-p))
        ;; Don't bother user with strings from (e.g.) the select-paste menu.
-       (if (stringp (aref key (1- (length key))))
+      (when (stringp (aref key (1- (length key))))
            (aset key (1- (length key)) "(any string)"))
-       (if (and untranslated
+      (when (and untranslated
                 (stringp (aref untranslated (1- (length untranslated)))))
            (aset untranslated (1- (length untranslated))
                  "(any string)"))
@@ -716,47 +710,41 @@
              (setq defn-up-tricky (key-binding sequence nil nil (event-start 
up-event))))))
        (with-output-to-temp-buffer (help-buffer)
          (princ (help-key-description key untranslated))
-         (if mousep
-             (princ " at that spot"))
-         (princ " runs the command ")
-         (prin1 defn)
-         (princ "\n   which is ")
+       (princ (format "\
+%s runs the command %S
+  which is "
+                      mouse-msg defn))
          (describe-function-1 defn)
          (when up-event
-           (let ((hdr "\n\n-------------- up event ---------------\n\n"))
-             (setq defn defn-up)
-             (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 (symbol-name ev-type))
-               (if mousep
-                   (princ " at that spot"))
+         (unless (or (null defn-up)
+                     (integerp defn-up)
+                     (equal defn-up 'undefined))
+           (princ (format "
+
+----------------- up-event %s----------------
+
+<%S>%s%s runs the command %S
+  which is "
+                          (if mouse-1-tricky "(short click) " "")
+                          ev-type mouse-msg
                (if mouse-1-remapped
-                   (princ " is remapped to <mouse-2>\n  which" ))
-               (princ " runs the command ")
-               (prin1 defn)
-               (princ "\n   which is ")
-               (describe-function-1 defn))
-             (when mouse-1-tricky
-               (setq defn defn-up-tricky)
-               (unless (or (null defn)
-                           (integerp defn)
-                           (eq defn 'undefined))
-                 (princ (or hdr
-                            "\n\n----------------- up-event (long click) 
----------------\n\n"))
-                 (princ "Pressing mouse-1")
-                 (if mousep
-                     (princ " at that spot"))
-                 (princ (format " for longer than %d milli-seconds\n"
-                                mouse-1-click-follows-link))
-                 (princ " runs the command ")
-                 (prin1 defn)
-                 (princ "\n   which is ")
-                 (describe-function-1 defn)))))
+                              " is remapped to <mouse-2>\nwhich" "")
+                          defn-up))
+           (describe-function-1 defn-up))
+         (unless (or (null defn-up-tricky)
+                     (integerp defn-up-tricky)
+                     (eq defn-up-tricky 'undefined))
+           (princ (format "
+
+----------------- up-event (long click) ----------------
+
+Pressing <%S>%s for longer than %d milli-seconds
+runs the command %S
+  which is "
+                          ev-type mouse-msg
+                          mouse-1-click-follows-link
+                          defn-up-tricky))
+           (describe-function-1 defn-up-tricky)))
          (print-help-return-message)))))
 
 (defun describe-mode (&optional buffer)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]