[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 98e3ee2 08/12: Make `C-h m' list unbound commands applicable for
From: |
Lars Ingebrigtsen |
Subject: |
master 98e3ee2 08/12: Make `C-h m' list unbound commands applicable for the mode |
Date: |
Sun, 14 Feb 2021 08:15:04 -0500 (EST) |
branch: master
commit 98e3ee27472d071c353743dcfc0eaef7c2f21059
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Make `C-h m' list unbound commands applicable for the mode
* lisp/help-fns.el (help-fns--list-local-commands): New function.
(describe-mode): Use it.
---
lisp/help-fns.el | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index b03a440..0e2c682 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1827,9 +1827,30 @@ documentation for the major and minor modes of that
buffer."
nil t)
(help-xref-button 1 'help-function-def mode file-name)))))
(princ ":\n")
- (princ (help-split-fundoc (documentation major-mode) nil 'doc)))))
+ (princ (help-split-fundoc (documentation major-mode) nil 'doc))
+ (princ (help-fns--list-local-commands)))))
;; For the sake of IELM and maybe others
nil)
+
+(defun help-fns--list-local-commands ()
+ (let ((functions nil))
+ (mapatoms
+ (lambda (sym)
+ (when (and (commandp sym)
+ ;; Ignore aliases.
+ (not (symbolp (symbol-function sym)))
+ ;; Ignore everything bound.
+ (not (where-is-internal sym))
+ (apply #'derived-mode-p (command-modes sym)))
+ (push sym functions))))
+ (with-temp-buffer
+ (when functions
+ (setq functions (sort functions #'string<))
+ (insert "\n\nOther commands for this mode, not bound to any keys:\n\n")
+ (dolist (function functions)
+ (insert (format "`%s'\n" function))))
+ (buffer-string))))
+
;; Widgets.
- master 9291e73 02/12: Add new 'declare' forms for command completion predicates, (continued)
- master 9291e73 02/12: Add new 'declare' forms for command completion predicates, Lars Ingebrigtsen, 2021/02/14
- master 8cdb616 05/12: Revert the bit about command_modes in previous patch set, Lars Ingebrigtsen, 2021/02/14
- master 40f7804 07/12: Allow define-minor-mode to take an :interactive keyword, Lars Ingebrigtsen, 2021/02/14
- master 2bfcd93 03/12: Mark easy-menu-do-define menus as "not interesting", Lars Ingebrigtsen, 2021/02/14
- master c1ef7ad 04/12: Add 'read-extended-command-predicate', Lars Ingebrigtsen, 2021/02/14
- master a4c8b6e 06/12: Fix dumping of buffers after minor_modes was added, Lars Ingebrigtsen, 2021/02/14
- master 58e0c8e 01/12: Extend the syntax of `interactive' to list applicable modes, Lars Ingebrigtsen, 2021/02/14
- master c022199 12/12: Do `interactive' mode markup in all Gnus files, Lars Ingebrigtsen, 2021/02/14
- master ffca272 09/12: Mark up eww.el for correct modes, Lars Ingebrigtsen, 2021/02/14
- master 869cdcf 11/12: Really fix the syntax problem in define-minor-mode, Lars Ingebrigtsen, 2021/02/14
- master 98e3ee2 08/12: Make `C-h m' list unbound commands applicable for the mode,
Lars Ingebrigtsen <=
- master 07e6b29 10/12: Fix previous define-minor-mode change, Lars Ingebrigtsen, 2021/02/14