aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-11-01 16:06:16 +0100
committerLars Ingebrigtsen2021-11-01 16:06:21 +0100
commita5d79fcfe83e3b87a5f044d062afb8d828bfa7b2 (patch)
treebc849f70b6c184ba1dc334d2ac53e2aac036c2f8 /lisp
parentaa90de71a2d3344884a2622ceef00507bcdf28d2 (diff)
downloademacs-a5d79fcfe83e3b87a5f044d062afb8d828bfa7b2.tar.gz
emacs-a5d79fcfe83e3b87a5f044d062afb8d828bfa7b2.zip
Don't output prefix keys in `C-h b', and output more data on objects
* lisp/help.el (help--describe-command): Output [closure/lambda/byte-code] for those types of objects. (describe-map): Don't output prefix keys.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help.el56
1 files changed, 33 insertions, 23 deletions
diff --git a/lisp/help.el b/lisp/help.el
index acd8a123ab5..293dd445459 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1357,7 +1357,13 @@ Return nil if the key sequence is too long."
1357 (insert "Keyboard Macro\n")) 1357 (insert "Keyboard Macro\n"))
1358 ((keymapp definition) 1358 ((keymapp definition)
1359 (insert "Prefix Command\n")) 1359 (insert "Prefix Command\n"))
1360 (t (insert "??\n"))))) 1360 ((byte-code-function-p definition)
1361 (insert "[byte-code]\n"))
1362 ((and (consp definition)
1363 (memq (car definition) '(closure lambda)))
1364 (insert (format "[%s]\n" (car definition))))
1365 (t
1366 (insert "??\n")))))
1361 1367
1362(defun help--describe-translation (definition) 1368(defun help--describe-translation (definition)
1363 ;; Converted from describe_translation in keymap.c. 1369 ;; Converted from describe_translation in keymap.c.
@@ -1456,10 +1462,6 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in
1456 (definition (cadr elem)) 1462 (definition (cadr elem))
1457 (shadowed (caddr elem)) 1463 (shadowed (caddr elem))
1458 (end start)) 1464 (end start))
1459 (when first
1460 (setq help--previous-description-column 0)
1461 (insert "\n")
1462 (setq first nil))
1463 ;; Find consecutive chars that are identically defined. 1465 ;; Find consecutive chars that are identically defined.
1464 (when (fixnump start) 1466 (when (fixnump start)
1465 (while (and (cdr vect) 1467 (while (and (cdr vect)
@@ -1474,24 +1476,32 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in
1474 (eq this-shadowed next-shadowed)))) 1476 (eq this-shadowed next-shadowed))))
1475 (setq vect (cdr vect)) 1477 (setq vect (cdr vect))
1476 (setq end (caar vect)))) 1478 (setq end (caar vect))))
1477 ;; Now START .. END is the range to describe next. 1479 (when (or (not (eq start end))
1478 ;; Insert the string to describe the event START. 1480 ;; Don't output keymap prefixes.
1479 (insert (help--key-description-fontified (vector start) prefix)) 1481 (not (keymapp definition)))
1480 (when (not (eq start end)) 1482 (when first
1481 (insert " .. " (help--key-description-fontified (vector end) prefix))) 1483 (setq help--previous-description-column 0)
1482 ;; Print a description of the definition of this character. 1484 (insert "\n")
1483 ;; Called function will take care of spacing out far enough 1485 (setq first nil))
1484 ;; for alignment purposes. 1486 ;; Now START .. END is the range to describe next.
1485 (if transl 1487 ;; Insert the string to describe the event START.
1486 (help--describe-translation definition) 1488 (insert (help--key-description-fontified (vector start) prefix))
1487 (help--describe-command definition)) 1489 (when (not (eq start end))
1488 ;; Print a description of the definition of this character. 1490 (insert " .. " (help--key-description-fontified (vector end)
1489 ;; elt_describer will take care of spacing out far enough for 1491 prefix)))
1490 ;; alignment purposes. 1492 ;; Print a description of the definition of this character.
1491 (when shadowed 1493 ;; Called function will take care of spacing out far enough
1492 (goto-char (max (1- (point)) (point-min))) 1494 ;; for alignment purposes.
1493 (insert "\n (this binding is currently shadowed)") 1495 (if transl
1494 (goto-char (min (1+ (point)) (point-max))))) 1496 (help--describe-translation definition)
1497 (help--describe-command definition))
1498 ;; Print a description of the definition of this character.
1499 ;; elt_describer will take care of spacing out far enough for
1500 ;; alignment purposes.
1501 (when shadowed
1502 (goto-char (max (1- (point)) (point-min)))
1503 (insert "\n (this binding is currently shadowed)")
1504 (goto-char (min (1+ (point)) (point-max))))))
1495 ;; Next item in list. 1505 ;; Next item in list.
1496 (setq vect (cdr vect)))))) 1506 (setq vect (cdr vect))))))
1497 1507