summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-11-15 06:19:12 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-11-15 06:19:12 +0000
commit63326785af653661c38179032edf927ef07c8529 (patch)
tree907a760f6fc08ef7134614a0f6d6fb02a23cb6ed /lisp/help-fns.el
parent2a7e89eac7e012686153a057543f2b37e6f144ab (diff)
downloademacs-63326785af653661c38179032edf927ef07c8529.tar.gz
(describe-function-1): Do char-range check for self-insert-command.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el71
1 files changed, 36 insertions, 35 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index d08c184e1f5..12b0e51570a 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -413,41 +413,42 @@ suitable file is found, return nil."
(point)))
(terpri)(terpri)
(when (commandp function)
- (let ((pt2 (with-current-buffer (help-buffer) (point))))
- (if (and (eq function 'self-insert-command)
- (eq (key-binding "a") 'self-insert-command)
- (eq (key-binding "b") 'self-insert-command)
- (eq (key-binding "c") 'self-insert-command))
- (princ "It is bound to many ordinary text characters.\n")
- (let* ((remapped (command-remapping function))
- (keys (where-is-internal
- (or remapped function) overriding-local-map nil nil))
- non-modified-keys)
- ;; Which non-control non-meta keys run this command?
- (dolist (key keys)
- (if (member (event-modifiers (aref key 0)) '(nil (shift)))
- (push key non-modified-keys)))
- (when remapped
- (princ "It is remapped to `")
- (princ (symbol-name remapped))
- (princ "'"))
-
- (when keys
- (princ (if remapped ", which is bound to " "It is bound to "))
- ;; If lots of ordinary text characters run this command,
- ;; don't mention them one by one.
- (if (< (length non-modified-keys) 10)
- (princ (mapconcat 'key-description keys ", "))
- (dolist (key non-modified-keys)
- (setq keys (delq key keys)))
- (if keys
- (progn
- (princ (mapconcat 'key-description keys ", "))
- (princ ", and many ordinary text characters"))
- (princ "many ordinary text characters"))))
- (when (or remapped keys non-modified-keys)
- (princ ".")
- (terpri))))
+ (let ((pt2 (with-current-buffer (help-buffer) (point)))
+ (remapped (command-remapping function)))
+ (unless (memq remapped '(ignore undefined))
+ (let ((keys (where-is-internal
+ (or remapped function) overriding-local-map nil nil))
+ non-modified-keys)
+ (if (and (eq function 'self-insert-command)
+ (vectorp (car-safe keys))
+ (consp (aref (car keys) 0)))
+ (princ "It is bound to many ordinary text characters.\n")
+ ;; Which non-control non-meta keys run this command?
+ (dolist (key keys)
+ (if (member (event-modifiers (aref key 0)) '(nil (shift)))
+ (push key non-modified-keys)))
+ (when remapped
+ (princ "It is remapped to `")
+ (princ (symbol-name remapped))
+ (princ "'"))
+
+ (when keys
+ (princ (if remapped ", which is bound to " "It is bound to "))
+ ;; If lots of ordinary text characters run this command,
+ ;; don't mention them one by one.
+ (if (< (length non-modified-keys) 10)
+ (princ (mapconcat 'key-description keys ", "))
+ (dolist (key non-modified-keys)
+ (setq keys (delq key keys)))
+ (if keys
+ (progn
+ (princ (mapconcat 'key-description keys ", "))
+ (princ ", and many ordinary text characters"))
+ (princ "many ordinary text characters"))))
+ (when (or remapped keys non-modified-keys)
+ (princ ".")
+ (terpri)))))
+
(with-current-buffer (help-buffer)
(fill-region-as-paragraph pt2 (point))
(unless (looking-back "\n\n")