comparison lisp/help.el @ 62060:9f98f54d05d7

(describe-key): No error when UNTRANSLATED is nil.
author Richard M. Stallman <rms@gnu.org>
date Wed, 04 May 2005 14:31:45 +0000
parents a5836c00c2ae
children 519850fadc32 08185296b491
comparison
equal deleted inserted replaced
62059:1f57a1631e42 62060:9f98f54d05d7
609 KEY should be a key sequence--when calling from a program, 609 KEY should be a key sequence--when calling from a program,
610 pass a string or a vector. 610 pass a string or a vector.
611 If non-nil UNTRANSLATED is a vector of the untranslated events. 611 If non-nil UNTRANSLATED is a vector of the untranslated events.
612 It can also be a number in which case the untranslated events from 612 It can also be a number in which case the untranslated events from
613 the last key hit are used." 613 the last key hit are used."
614 ;; UP-EVENT is the up-event that was discarded by reading KEY, or nil.
614 (interactive "kDescribe key: \np\nU") 615 (interactive "kDescribe key: \np\nU")
615 (if (numberp untranslated) 616 (if (numberp untranslated)
616 (setq untranslated (this-single-command-raw-keys))) 617 (setq untranslated (this-single-command-raw-keys)))
617 (save-excursion 618 (save-excursion
618 (let ((modifiers (event-modifiers (aref key 0))) 619 (let ((modifiers (event-modifiers (aref key 0)))
632 (message "%s is undefined" (help-key-description key untranslated)) 633 (message "%s is undefined" (help-key-description key untranslated))
633 (help-setup-xref (list #'describe-function defn) (interactive-p)) 634 (help-setup-xref (list #'describe-function defn) (interactive-p))
634 ;; Don't bother user with strings from (e.g.) the select-paste menu. 635 ;; Don't bother user with strings from (e.g.) the select-paste menu.
635 (if (stringp (aref key (1- (length key)))) 636 (if (stringp (aref key (1- (length key))))
636 (aset key (1- (length key)) "(any string)")) 637 (aset key (1- (length key)) "(any string)"))
637 (if (stringp (aref untranslated (1- (length untranslated)))) 638 (if (and untranslated
639 (stringp (aref untranslated (1- (length untranslated)))))
638 (aset untranslated (1- (length untranslated)) 640 (aset untranslated (1- (length untranslated))
639 "(any string)")) 641 "(any string)"))
640 (with-output-to-temp-buffer (help-buffer) 642 (with-output-to-temp-buffer (help-buffer)
641 (princ (help-key-description key untranslated)) 643 (princ (help-key-description key untranslated))
642 (if (windowp window) 644 (if (windowp window)