aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/help.el27
1 files changed, 17 insertions, 10 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 4e0d807cb2c..abdce46edf3 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -392,16 +392,23 @@ If that doesn't give a function, return nil."
392The prefix described consists of all but the last event 392The prefix described consists of all but the last event
393of the key sequence that ran this command." 393of the key sequence that ran this command."
394 (interactive) 394 (interactive)
395 (let ((key (this-command-keys))) 395 (let* ((key (this-command-keys))
396 (describe-bindings 396 (prefix
397 (if (stringp key) 397 (if (stringp key)
398 (substring key 0 (1- (length key))) 398 (substring key 0 (1- (length key)))
399 (let ((prefix (make-vector (1- (length key)) nil)) 399 (let ((prefix (make-vector (1- (length key)) nil))
400 (i 0)) 400 (i 0))
401 (while (< i (length prefix)) 401 (while (< i (length prefix))
402 (aset prefix i (aref key i)) 402 (aset prefix i (aref key i))
403 (setq i (1+ i))) 403 (setq i (1+ i)))
404 prefix))))) 404 prefix))))
405 (describe-bindings prefix)
406 (with-current-buffer (help-buffer)
407 (when (< (buffer-size) 10)
408 (let ((inhibit-read-only t))
409 (insert (format "No commands with a binding that start with %s."
410 (help--key-description-fontified prefix))))))))
411
405;; Make C-h after a prefix, when not specifically bound, 412;; Make C-h after a prefix, when not specifically bound,
406;; run describe-prefix-bindings. 413;; run describe-prefix-bindings.
407(setq prefix-help-command 'describe-prefix-bindings) 414(setq prefix-help-command 'describe-prefix-bindings)