unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31139: [PATCH] Document Narrow indicator in describe-mode
@ 2018-04-12 17:12 Michael Hendricks
  2018-04-12 23:36 ` Noam Postavsky
  2018-04-19 12:16 ` Noam Postavsky
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Hendricks @ 2018-04-12 17:12 UTC (permalink / raw)
  To: 31139; +Cc: Michael Hendricks

* lisp/help.el (describe-mode): document narrowing, if active
---
 lisp/help.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/help.el b/lisp/help.el
index 8e6604d2db..92a2f52d2d 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -908,6 +908,8 @@ 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)))))
+	(when (or (> (point-min) 1) (<= (point-max) (buffer-size)))
+	  (push '(narrow-to-region "Narrow" " Narrow") minor-modes))
 	(setq minor-modes
 	      (sort minor-modes
 		    (lambda (a b) (string-lessp (cadr a) (cadr b)))))
-- 
2.14.2





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-12 17:12 bug#31139: [PATCH] Document Narrow indicator in describe-mode Michael Hendricks
@ 2018-04-12 23:36 ` Noam Postavsky
  2018-04-17 18:59   ` Michael Hendricks
  2018-04-19 12:16 ` Noam Postavsky
  1 sibling, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-04-12 23:36 UTC (permalink / raw)
  To: Michael Hendricks; +Cc: 31139

severity 31139 wishlist
quit

Michael Hendricks <michael@ndrix.org> writes:

> * lisp/help.el (describe-mode): document narrowing, if active

> +	(when (or (> (point-min) 1) (<= (point-max) (buffer-size)))
> +	  (push '(narrow-to-region "Narrow" " Narrow") minor-modes))

Narrowing isn't exactly a minor mode though, wouldn't this be
potentially confusing?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-12 23:36 ` Noam Postavsky
@ 2018-04-17 18:59   ` Michael Hendricks
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Hendricks @ 2018-04-17 18:59 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31139

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

Hi Noam,

On Thu, Apr 12, 2018 at 5:36 PM Noam Postavsky <npostavs@gmail.com> wrote:

> Narrowing isn't exactly a minor mode though, wouldn't this be
> potentially confusing?
>

You're right that narrowing isn't exactly a minor mode.  However,
standard-mode-line-format includes narrowing information as part of
mode-line-modes.  So the narrowing indicator is rendered inside the same
parentheses as indicators for true major and minor modes.  Since
describe-mode provides documentation for everything else that's inside
those parentheses, it seemed appropriate to document narrowing in the same
place.

When I first started using emacs some years ago, I remember being confused
why "Narrow" was the only thing in the mode list that wasn't mentioned by
describe-mode.  I understand it now, but I think others might face similar
confusion with the current behavior.  I think this patch would address that.

[-- Attachment #2: Type: text/html, Size: 1373 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-12 17:12 bug#31139: [PATCH] Document Narrow indicator in describe-mode Michael Hendricks
  2018-04-12 23:36 ` Noam Postavsky
@ 2018-04-19 12:16 ` Noam Postavsky
  2018-04-19 13:08   ` Eli Zaretskii
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Noam Postavsky @ 2018-04-19 12:16 UTC (permalink / raw)
  To: Michael Hendricks; +Cc: 31139

Michael Hendricks <michael@ndrix.org> writes:

> You're right that narrowing isn't exactly a minor mode.  However,
> standard-mode-line-format includes narrowing information as part of
> mode-line-modes.  So the narrowing indicator is rendered inside the
> same parentheses as indicators for true major and minor modes.  Since
> describe-mode provides documentation for everything else that's inside
> those parentheses, it seemed appropriate to document narrowing in the
> same place.

Okay, I'm convinced.  I think adding a comment along the lines of
"narrowing is not a minor mode, but its indicator is part of
mode-line-modes", would be helpful in case someone tries to "fix" your
change later.

> +	(when (or (> (point-min) 1) (<= (point-max) (buffer-size)))

You should use buffer-narrowed-p instead of checking point min & max
here.

Have you assigned copyright for Emacs? (the patch is small enough to
install regardless, I'm asking just to know if it should be marked as a
tiny change).








^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-19 12:16 ` Noam Postavsky
@ 2018-04-19 13:08   ` Eli Zaretskii
  2018-04-19 14:38   ` Michael Hendricks
  2018-04-24 15:00   ` Michael Hendricks
  2 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2018-04-19 13:08 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: michael, 31139

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Thu, 19 Apr 2018 08:16:50 -0400
> Cc: 31139@debbugs.gnu.org
> 
> Have you assigned copyright for Emacs?

Not according to the current copyright assignment list.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-19 12:16 ` Noam Postavsky
  2018-04-19 13:08   ` Eli Zaretskii
@ 2018-04-19 14:38   ` Michael Hendricks
  2018-04-19 14:44     ` Eli Zaretskii
  2018-04-24 15:00   ` Michael Hendricks
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Hendricks @ 2018-04-19 14:38 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: copyright-clerk@fsf.org, 31139

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

On Thu, Apr 19, 2018 at 6:16 AM Noam Postavsky <npostavs@gmail.com> wrote:

> Okay, I'm convinced.  I think adding a comment along the lines of
> "narrowing is not a minor mode, but its indicator is part of
> mode-line-modes", would be helpful in case someone tries to "fix" your
> change later.
>
> > +     (when (or (> (point-min) 1) (<= (point-max) (buffer-size)))
>
> You should use buffer-narrowed-p instead of checking point min & max
> here.
>

Sounds good.  I'll run Emacs with these changes over the weekend.  If
everything is solid, I'll reply with a final patch early next week.

Have you assigned copyright for Emacs?


I submitted my copyright assignment on April 11, 2018, but it sounds like
I'm not on the current copyright assignment list for some reason. I've cc'd
the FSF copyright clerk with whom I handled the assignment, in case he
knows what happened.  For reference, my RT number for the assignment
was 1287241.

[-- Attachment #2: Type: text/html, Size: 1627 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-19 14:38   ` Michael Hendricks
@ 2018-04-19 14:44     ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2018-04-19 14:44 UTC (permalink / raw)
  To: Michael Hendricks; +Cc: npostavs, 31139

> From: Michael Hendricks <michael@ndrix.org>
> Date: Thu, 19 Apr 2018 14:38:08 +0000
> Cc: 31139@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>, 
> 	"copyright-clerk@fsf.org" <copyright-clerk@fsf.org>
> 
>  Have you assigned copyright for Emacs?
> 
> I submitted my copyright assignment on April 11, 2018, but it sounds like I'm not on the current copyright
> assignment list for some reason. I've cc'd the FSF copyright clerk with whom I handled the assignment, in
> case he knows what happened.  For reference, my RT number for the assignment was 1287241.

That means the assignment will come through in a few weeks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-19 12:16 ` Noam Postavsky
  2018-04-19 13:08   ` Eli Zaretskii
  2018-04-19 14:38   ` Michael Hendricks
@ 2018-04-24 15:00   ` Michael Hendricks
  2018-05-05  9:44     ` Eli Zaretskii
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Hendricks @ 2018-04-24 15:00 UTC (permalink / raw)
  To: 31139; +Cc: Michael Hendricks, Noam Postavsky

* lisp/help.el (describe-mode): document narrowing, if active
---
 lisp/help.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/help.el b/lisp/help.el
index 8e6604d2db..844087a72f 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -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)))))
-- 
2.14.2





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#31139: [PATCH] Document Narrow indicator in describe-mode
  2018-04-24 15:00   ` Michael Hendricks
@ 2018-05-05  9:44     ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2018-05-05  9:44 UTC (permalink / raw)
  To: Michael Hendricks; +Cc: npostavs, 31139-done

> From: Michael Hendricks <michael@ndrix.org>
> Date: Tue, 24 Apr 2018 09:00:13 -0600
> Cc: Michael Hendricks <michael@ndrix.org>, Noam Postavsky <npostavs@gmail.com>
> 
> * lisp/help.el (describe-mode): document narrowing, if active
> ---
>  lisp/help.el | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks, pushed to the master branch.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-05  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12 17:12 bug#31139: [PATCH] Document Narrow indicator in describe-mode Michael Hendricks
2018-04-12 23:36 ` Noam Postavsky
2018-04-17 18:59   ` Michael Hendricks
2018-04-19 12:16 ` Noam Postavsky
2018-04-19 13:08   ` Eli Zaretskii
2018-04-19 14:38   ` Michael Hendricks
2018-04-19 14:44     ` Eli Zaretskii
2018-04-24 15:00   ` Michael Hendricks
2018-05-05  9:44     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).