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


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/help.el
Date: Mon, 01 Apr 2002 22:23:28 -0500

Index: emacs/lisp/help.el
diff -c emacs/lisp/help.el:1.247 emacs/lisp/help.el:1.248
*** emacs/lisp/help.el:1.247    Mon Mar  4 04:24:07 2002
--- emacs/lisp/help.el  Mon Apr  1 22:23:26 2002
***************
*** 350,361 ****
    (interactive)
    (help-setup-xref (list #'view-lossage) (interactive-p))
    (with-output-to-temp-buffer (help-buffer)
!     (princ (mapconcat (function (lambda (key)
!                                 (if (or (integerp key)
!                                         (symbolp key)
!                                         (listp key))
!                                     (single-key-description key)
!                                   (prin1-to-string key nil))))
                      (recent-keys)
                      " "))
      (with-current-buffer standard-output
--- 350,359 ----
    (interactive)
    (help-setup-xref (list #'view-lossage) (interactive-p))
    (with-output-to-temp-buffer (help-buffer)
!     (princ (mapconcat (lambda (key)
!                       (if (or (integerp key) (symbolp key) (listp key))
!                           (single-key-description key)
!                         (prin1-to-string key nil)))
                      (recent-keys)
                      " "))
      (with-current-buffer standard-output
***************
*** 450,459 ****
        (setq defn (and local-map (lookup-key local-map key)))))
      defn))
  
! (defun describe-key-briefly (key &optional insert)
    "Print the name of the function KEY invokes.  KEY is a string.
! If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
!   (interactive "kDescribe key briefly: \nP")
    (save-excursion
      (let ((modifiers (event-modifiers (aref key 0)))
          (standard-output (if insert (current-buffer) t))
--- 448,471 ----
        (setq defn (and local-map (lookup-key local-map key)))))
      defn))
  
! (defun help-key-description (key untranslated)
!   (let ((string (key-description key)))
!     (if (or (not untranslated) (eq (aref untranslated 0) ?\e))
!       string
!       (let ((otherstring (key-description untranslated)))
!       (if (equal string otherstring)
!           string
!         (format "%s (translated from %s)" string otherstring))))))
!         
! (defun describe-key-briefly (key &optional insert untranslated)
    "Print the name of the function KEY invokes.  KEY is a string.
! If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
! If non-nil UNTRANSLATED is a vector of the untranslated events.
! It can also be a number in which case the untranslated events from
! the last key hit are used."
!   (interactive "kDescribe key briefly: \nP\np")
!   (if (numberp untranslated)
!       (setq untranslated (this-single-command-raw-keys)))
    (save-excursion
      (let ((modifiers (event-modifiers (aref key 0)))
          (standard-output (if insert (current-buffer) t))
***************
*** 472,478 ****
        ;; Ok, now look up the key and name the command.
        (let ((defn (or (string-key-binding key)
                      (key-binding key)))
!           (key-desc (key-description key)))
        (if (or (null defn) (integerp defn) (equal defn 'undefined))
            (princ (format "%s is undefined" key-desc))
          (princ (format (if (windowp window)
--- 484,490 ----
        ;; Ok, now look up the key and name the command.
        (let ((defn (or (string-key-binding key)
                      (key-binding key)))
!           (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 (windowp window)
***************
*** 482,492 ****
                         (if (symbolp defn) defn (prin1-to-string defn)))))))))
  
  
! (defun describe-key (key)
    "Display documentation of the function invoked by KEY.
  KEY should be a key sequence--when calling from a program,
! pass a string or a vector."
!   (interactive "kDescribe key: ")
    (save-excursion
      (let ((modifiers (event-modifiers (aref key 0)))
          window position)
--- 494,509 ----
                         (if (symbolp defn) defn (prin1-to-string defn)))))))))
  
  
! (defun describe-key (key &optional untranslated)
    "Display documentation of the function invoked by KEY.
  KEY should be a key sequence--when calling from a program,
! pass a string or a vector.
! If non-nil UNTRANSLATED is a vector of the untranslated events.
! It can also be a number in which case the untranslated events from
! the last key hit are used."
!   (interactive "kDescribe key: \np")
!   (if (numberp untranslated)
!       (setq untranslated (this-single-command-raw-keys)))
    (save-excursion
      (let ((modifiers (event-modifiers (aref key 0)))
          window position)
***************
*** 502,511 ****
        (goto-char position))
        (let ((defn (or (string-key-binding key) (key-binding key))))
        (if (or (null defn) (integerp defn) (equal defn 'undefined))
!           (message "%s is undefined" (key-description key))
          (help-setup-xref (list #'describe-function defn) (interactive-p))
          (with-output-to-temp-buffer (help-buffer)
!           (princ (key-description key))
            (if (windowp window)
                (princ " at that spot"))
            (princ " runs the command ")
--- 519,528 ----
        (goto-char position))
        (let ((defn (or (string-key-binding key) (key-binding key))))
        (if (or (null defn) (integerp defn) (equal defn 'undefined))
!           (message "%s is undefined" (help-key-description key untranslated))
          (help-setup-xref (list #'describe-function defn) (interactive-p))
          (with-output-to-temp-buffer (help-buffer)
!           (princ (help-key-description key untranslated))
            (if (windowp window)
                (princ " at that spot"))
            (princ " runs the command ")



reply via email to

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