]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/help-fns.el (help-fns--parent-mode): Mention the extra parents
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 16 Jan 2024 00:00:50 +0000 (19:00 -0500)
committerEshel Yaron <me@eshelyaron.com>
Tue, 16 Jan 2024 17:58:21 +0000 (18:58 +0100)
As suggested by Stefan Kangas in bug#68246.

(cherry picked from commit 27ff4d9c4956fe06c59f342def8b35d32bbc3b50)

lisp/help-fns.el

index abc9f049bc947d4d7ccec1c43b6b4997cf063c33..c60c057b911538b4ed1aed83755875b4971ecb7a 100644 (file)
@@ -764,18 +764,28 @@ the C sources, too."
 
 (defun help-fns--parent-mode (function)
   ;; If this is a derived mode, link to the parent.
-  (let ((parent-mode (and (symbolp function)
-                          ;; FIXME: Should we mention other parent modes?
-                          (get function
-                               'derived-mode-parent))))
+  (when (symbolp function)
+    (let ((parent-mode (get function 'derived-mode-parent))
+          (extra-parents (get function 'derived-mode-extra-parents)))
     (when parent-mode
       (insert (substitute-quotes "  Parent mode: `"))
       (let ((beg (point)))
-        (insert (format "%s" parent-mode))
+        (insert (format "%S" parent-mode))
         (make-text-button beg (point)
                           'type 'help-function
                           'help-args (list parent-mode)))
-      (insert (substitute-quotes "'.\n")))))
+      (insert (substitute-quotes "'.\n")))
+    (when extra-parents
+      (insert (format "  Extra parent mode%s:" (if (cdr extra-parents) "s" "")))
+      (dolist (parent extra-parents)
+        (insert (substitute-quotes " `"))
+        (let ((beg (point)))
+          (insert (format "%S" parent))
+          (make-text-button beg (point)
+                            'type 'help-function
+                            'help-args (list parent)))
+        (insert (substitute-quotes "'")))
+      (insert ".\n")))))
 
 (defun help-fns--obsolete (function)
   ;; Ignore lambda constructs, keyboard macros, etc.