]> git.eshelyaron.com Git - emacs.git/commitdiff
Include narrowing indication in describe-mode
authorMichael Hendricks <michael@ndrix.org>
Sat, 5 May 2018 09:41:43 +0000 (12:41 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 5 May 2018 09:41:43 +0000 (12:41 +0300)
* lisp/help.el (describe-mode): Include "Narrow", if narrowing is
active.  (Bug#31139)

Copyright-paperwork-exempt: yes

lisp/help.el

index 8e6604d2dba849ce2cee957d1eaf15e20bce7256..844087a72f35e07d2f214b25c6db8bda009d7539 100644 (file)
@@ -908,6 +908,10 @@ documentation for the major and minor modes of that buffer."
                   (push (list fmode pretty-minor-mode
                               (format-mode-line (assq mode minor-mode-alist)))
                         minor-modes)))))
+       ;; Narrowing is not a minor mode, but its indicator is part of
+       ;; mode-line-modes.
+       (when (buffer-narrowed-p)
+         (push '(narrow-to-region "Narrow" " Narrow") minor-modes))
        (setq minor-modes
              (sort minor-modes
                    (lambda (a b) (string-lessp (cadr a) (cadr b)))))