GNU bug report logs - #33076
26; `read-only-mode' messages

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 17 Oct 2018 17:05:01 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33076 in the body.
You can then email your comments to 33076 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33076; Package emacs. (Wed, 17 Oct 2018 17:05:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 17 Oct 2018 17:05:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26; `read-only-mode' messages
Date: Wed, 17 Oct 2018 10:04:00 -0700 (PDT)
It would be much clearer if the messages referred to the buffer by name,
rather than just "current buffer".  You can use `C-x C-q' in the
selected window even when the buffer might not be clearly displayed
(e.g. tiny or partly obscured window/frame).  Having the message tell
you which buffer you changed read-only for provides better confirmation.

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33076; Package emacs. (Wed, 10 Jul 2019 13:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 33076 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 33076 <at> debbugs.gnu.org
Subject: Re: bug#33076: 26; `read-only-mode' messages
Date: Wed, 10 Jul 2019 15:54:40 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> It would be much clearer if the messages referred to the buffer by name,
> rather than just "current buffer".  You can use `C-x C-q' in the
> selected window even when the buffer might not be clearly displayed
> (e.g. tiny or partly obscured window/frame).  Having the message tell
> you which buffer you changed read-only for provides better confirmation.

(and "in current buffer" should perhaps have a "the" in it anyway?)

This is output by the define-minor-mode machinery:

           (if (called-interactively-p 'any)
               (progn
                 ,(if (and globalp (not variable))
                      `(customize-mark-as-set ',mode))
                 ;; Avoid overwriting a message shown by the body,
                 ;; but do overwrite previous messages.
                 (unless (and (current-message)
                              (not (equal ,last-message
                                          (current-message))))
                   (let ((local ,(if globalp "" " in current buffer")))
		     (message ,(format "%s %%sabled%%s" pretty-name)
			      (if ,getter "en" "dis") local)))))

So it looks easy enough to change, but it's a change that would affect
all minor mode.  Do we want all interactive minor modes to message the
buffer names?  I don't know what I think of it myself.

Perhaps mainly because some buffer names are so long that this would
increase the echo area sometimes, which is slightly annoying.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33076; Package emacs. (Wed, 10 Jul 2019 14:39:01 GMT) Full text and rfc822 format available.

Message #11 received at 33076 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33076 <at> debbugs.gnu.org
Subject: RE: bug#33076: 26; `read-only-mode' messages
Date: Wed, 10 Jul 2019 07:36:29 -0700 (PDT)
> it looks easy enough to change, but it's a change that would affect
> all minor mode.  Do we want all interactive minor modes to message the
> buffer names?  I don't know what I think of it myself.
> 
> Perhaps mainly because some buffer names are so long that this would
> increase the echo area sometimes, which is slightly annoying.

Why just say "in current buffer", when that can be
unclear?

There should be no problem with a long buffer name.
what's important is to give some indication of which
buffer is meant.  If the name is too long for the
echo area then either the message will wrap (no big
deal) or it will be truncated (still identifying the
buffer sufficiently in most cases - and *Messages*
holds the full name).

You can also drop the word "buffer".  Just say
"in `BUF'", where BUF is the buffer name.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33076; Package emacs. (Thu, 20 Aug 2020 15:50:01 GMT) Full text and rfc822 format available.

Message #14 received at 33076 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 33076 <at> debbugs.gnu.org
Subject: Re: bug#33076: 26; `read-only-mode' messages
Date: Thu, 20 Aug 2020 17:49:00 +0200
> This is output by the define-minor-mode machinery:
>
>            (if (called-interactively-p 'any)
>                (progn
>                  ,(if (and globalp (not variable))
>                       `(customize-mark-as-set ',mode))
>                  ;; Avoid overwriting a message shown by the body,
>                  ;; but do overwrite previous messages.
>                  (unless (and (current-message)
>                               (not (equal ,last-message
>                                           (current-message))))
>                    (let ((local ,(if globalp "" " in current buffer")))
> 		     (message ,(format "%s %%sabled%%s" pretty-name)
> 			      (if ,getter "en" "dis") local)))))
>
> So it looks easy enough to change, but it's a change that would affect
> all minor mode.  Do we want all interactive minor modes to message the
> buffer names?  I don't know what I think of it myself.
>
> Perhaps mainly because some buffer names are so long that this would
> increase the echo area sometimes, which is slightly annoying.

After thinking about this for a year, I've come to the conclusion that
this would be more annoying than informative, so I'm closing this as a
"wontfix".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 20 Aug 2020 15:50:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 33076 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 20 Aug 2020 15:50:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 18 Sep 2020 11:24:09 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Drew Adams <drew.adams <at> oracle.com> to control <at> debbugs.gnu.org. (Sat, 16 Oct 2021 21:56:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33076; Package emacs. (Sat, 16 Oct 2021 21:58:02 GMT) Full text and rfc822 format available.

Message #25 received at 33076 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Drew Adams <drew.adams <at> oracle.com>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "33076 <at> debbugs.gnu.org" <33076 <at> debbugs.gnu.org>,
 "48798 <at> debbugs.gnu.org" <48798 <at> debbugs.gnu.org>
Subject: Re: bug#48798: 26.3; `define-minor-mode': Message should name the
 current buffer where enabled/disabled
Date: Sat, 16 Oct 2021 21:57:53 +0000
The same problem persists - bugs #33076 and #48798.

It's quite possible to not notice - or even not be
able to easily see - which buffer is current when
it's changed to/from read-only.  It  just makes
sense to tell users which buffer is involved.

Really hard to believe this isn't obvious and the 
trivial fix wasn't applied.  This just makes life
that much harder for users, with no benefit to Emacs.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Nov 2021 12:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Drew Adams <drew.adams <at> oracle.com> to control <at> debbugs.gnu.org. (Tue, 04 Jul 2023 14:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33076; Package emacs. (Tue, 04 Jul 2023 15:10:01 GMT) Full text and rfc822 format available.

Message #32 received at 33076 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "33076 <at> debbugs.gnu.org" <33076 <at> debbugs.gnu.org>,
 "48798 <at> debbugs.gnu.org" <48798 <at> debbugs.gnu.org>
Subject: RE: bug#48798: 26.3; `define-minor-mode': Message should name the
 current buffer where enabled/disabled
Date: Tue, 4 Jul 2023 15:08:49 +0000
> > The same problem persists - bugs #33076 and #48798.
> >
> > It's quite possible to not notice - or even not be
> > able to easily see - which buffer is current when
> > it's changed to/from read-only.  It  just makes
> > sense to tell users which buffer is involved.
> >
> > Really hard to believe this isn't obvious and the
> > trivial fix wasn't applied.  This just makes life
> > that much harder for users, with no benefit to Emacs.
> 
> Perhaps the problem is more noticeable if buffers
> are in separate frames.  Especially since Emacs
> has messed with frame focus so much (since Emacs
> 26, at least).  If the buffer you thought was
> current with its window selected is not, for some
> reason (e.g. gratuitous Emacs frame-focus switch),
> then the message doesn't help at all if you have
> multiple buffers in separate frames etc.
> 
> I'm guessing that this might be why Lars didn't
> think this was a real problem.  It might be less
> noticeable if you're not a victim of Emacs's
> gratuitous frame focus-switching.
> 
> But even if that's not the case, I see no reason
> why this shouldn't be fixed.  _Whatever_ the
> reason might be why someone doesn't know or isn't
> sure which buffer had the focus, why not have a
> message that tells you what Emacs actually did?
> 
> Please reopen this bug and apply the trivial fix.
> Thx.  I'd really not like to have to redefine
> `define-minor-mode' for my own use, just to fix
> this annoyance.  To me, this message improvement
> for users should be a no-brainer.

I'm asking again that this be fixed.  I'm not
asking that such a message be changed for all
modes, i.e., a change in `define-minor-mode'.

Whether that would be appropriate is TBD - a
different question.  It could be asked, but
I'm not asking it here.
 
For this enhancement request I'm asking only
that this be fixed for `read-only-mode'.  In
various situations it can be nonobvious which
buffer's read-only state was changed.

And there's really no good reason why the
buffer name shouldn't be included in the msg.
And no objective reason was given - the only
reason given was that Lars subjectively found
the fix to be "more annoying than informative".

Whether or not the code below is the right
fix is for you to decide.  It gets the job
done and shows what the behavior should be.
I don't care how the fix gets implemented.

(defun ro-echo-buffer ()
  "Echo `buffer-read-only' value, showing buffer name."
  (message "Read-only mode is %s in buffer `%s'"
           (if buffer-read-only 'ON 'OFF)
           (current-buffer)))

(add-hook 'read-only-mode-hook 'ro-echo-buffer)

Please reconsider Emacs not letting users see
this little bit of important info in the msg.

___

As for whether ON/OFF is kosher, vs the more
verbose and less noticeable enabled/disabled:

I think it should be.  In fact, I think it's
preferable, at least in a message.  And Emacs
itself sometimes says that a mode is "active"
instead of "enabled".  (e.g. allout.el,
autorevert.el)  I think uppercase ON and OFF
stand out clearly in such a message, and that
helps.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 Aug 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.