mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
(describe-mode): Fix bug#80170
* lisp/help-fns.el (describe-mode--minor-modes): Add argument `buffer`. (describe-mode): Use it to fix call to `documentation` so the docstrings are computed in the right buffer and thus show correctly when bindings are shadowed by minor modes.
This commit is contained in:
parent
a1e32130de
commit
451d5c6f05
1 changed files with 10 additions and 5 deletions
|
|
@ -2242,7 +2242,7 @@ is enabled in the Help buffer."
|
|||
(insert (format "Minor mode%s enabled in this buffer:"
|
||||
(if (length> local-minors 1)
|
||||
"s" ""))))
|
||||
(describe-mode--minor-modes local-minors))
|
||||
(describe-mode--minor-modes local-minors nil buffer))
|
||||
|
||||
;; Document the major mode.
|
||||
(let ((major (buffer-local-value 'major-mode buffer)))
|
||||
|
|
@ -2269,7 +2269,9 @@ is enabled in the Help buffer."
|
|||
(help-function-def--button-function
|
||||
major file-name))))))
|
||||
(insert ":\n\n"
|
||||
(help-split-fundoc (documentation major) nil 'doc)
|
||||
(help-split-fundoc (with-current-buffer buffer
|
||||
(documentation major))
|
||||
nil 'doc)
|
||||
(with-current-buffer buffer
|
||||
(help-fns--list-local-commands)))
|
||||
(ensure-empty-lines 1)
|
||||
|
|
@ -2280,7 +2282,7 @@ is enabled in the Help buffer."
|
|||
(insert (format "Global minor mode%s enabled:"
|
||||
(if (length> global-minor-modes 1)
|
||||
"s" ""))))
|
||||
(describe-mode--minor-modes global-minor-modes t)
|
||||
(describe-mode--minor-modes global-minor-modes t buffer)
|
||||
(unless describe-mode-outline
|
||||
(when (re-search-forward "^\f")
|
||||
(beginning-of-line)
|
||||
|
|
@ -2297,7 +2299,7 @@ is enabled in the Help buffer."
|
|||
;; For the sake of IELM and maybe others
|
||||
nil)))))
|
||||
|
||||
(defun describe-mode--minor-modes (modes &optional global)
|
||||
(defun describe-mode--minor-modes (modes &optional global buffer)
|
||||
(dolist (mode (seq-sort #'string< modes))
|
||||
(let ((pretty-minor-mode
|
||||
(capitalize
|
||||
|
|
@ -2338,7 +2340,10 @@ is enabled in the Help buffer."
|
|||
"no indicator"
|
||||
(format "indicator%s"
|
||||
indicator)))))
|
||||
(insert (or (help-split-fundoc (documentation mode) nil 'doc)
|
||||
(insert (or (help-split-fundoc
|
||||
(with-current-buffer (or buffer (current-buffer))
|
||||
(documentation mode))
|
||||
nil 'doc)
|
||||
"No docstring"))
|
||||
(when describe-mode-outline
|
||||
(insert "\n\n")))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue