summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-08-03 17:32:52 +0200
committerStefan Kangas <stefan@marxist.se>2022-08-03 17:44:03 +0200
commiteb2f39428935aa6ea42bc12272df8f43da7cde6c (patch)
tree820a4053f1bd2a3e4aa6989b3bd5658c690f0a8e /lisp/help.el
parent21afc26d4df6bae35ba032d4b6b03fb7fb2bf1b3 (diff)
downloademacs-eb2f39428935aa6ea42bc12272df8f43da7cde6c.tar.gz
* lisp/help.el (describe-map-tree, describe-map): Simplify.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el30
1 files changed, 14 insertions, 16 deletions
diff --git a/lisp/help.el b/lisp/help.el
index f58d252bae2..37aab15df05 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1323,18 +1323,17 @@ If BUFFER, lookup keys while in that buffer. This only affects
things like :filters for menu bindings."
(let* ((amaps (accessible-keymaps startmap prefix))
(orig-maps (if no-menu
- (progn
- ;; Delete from MAPS each element that is for
- ;; the menu bar.
- (let* ((tail amaps)
- result)
- (while tail
- (let ((elem (car tail)))
- (when (not (and (>= (length (car elem)) 1)
- (eq (elt (car elem) 0) 'menu-bar)))
- (setq result (append result (list elem)))))
- (setq tail (cdr tail)))
- result))
+ ;; Delete from MAPS each element that is for
+ ;; the menu bar.
+ (let* ((tail amaps)
+ result)
+ (while tail
+ (let ((elem (car tail)))
+ (when (not (and (>= (length (car elem)) 1)
+ (eq (elt (car elem) 0) 'menu-bar)))
+ (setq result (append result (list elem)))))
+ (setq tail (cdr tail)))
+ result)
amaps))
(maps orig-maps)
(print-title (or maps always-title))
@@ -1448,8 +1447,7 @@ prefix keys PREFIX (a string or vector).
TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW and BUFFER are as
in `describe-map-tree'."
;; Converted from describe_map in keymap.c.
- (let* ((suppress (and partial 'suppress-keymap))
- (map (keymap-canonicalize map))
+ (let* ((map (keymap-canonicalize map))
(tail map)
(first t)
done vect)
@@ -1480,7 +1478,7 @@ in `describe-map-tree'."
;; commands.
(setq definition (keymap--get-keyelt (cdr (car tail)) nil))
(or (not (symbolp definition))
- (null (get definition suppress)))
+ (not (get definition (when partial 'suppress-keymap))))
;; Don't show a command that isn't really
;; visible because a local definition of the
;; same key shadows it.
@@ -1513,7 +1511,7 @@ in `describe-map-tree'."
(push (cons tail prefix) help--keymaps-seen)))))
(setq tail (cdr tail)))
;; If we found some sparse map events, sort them.
- (let ((vect (sort vect 'help--describe-map-compare))
+ (let ((vect (sort vect #'help--describe-map-compare))
(columns ())
line-start key-end column)
;; Now output them in sorted order.