emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/command c86f1b9 1/3: List commands not bound to any keys


From: Lars Ingebrigtsen
Subject: scratch/command c86f1b9 1/3: List commands not bound to any keys
Date: Thu, 11 Feb 2021 12:18:50 -0500 (EST)

branch: scratch/command
commit c86f1b90e84ba68f7dbd07e0e8132326c32401b0
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    List commands not bound to any keys
---
 lisp/help-fns.el | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index b03a440..9e35d12 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1827,9 +1827,27 @@ 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)
+                  (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.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]