GNU bug report logs - #48798
26.3; `define-minor-mode': Message should name the current buffer where enabled/disabled

Previous Next

Package: emacs;

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

Date: Wed, 2 Jun 2021 19:37:02 UTC

Severity: wishlist

Tags: moreinfo

Found in version 26.3

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

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 48798 <at> debbugs.gnu.org
Subject: Re: bug#48798: 26.3; `define-minor-mode': Message should name the
 current buffer where enabled/disabled
Date: Thu, 03 Jun 2021 10:06:16 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Without bothering with a complete patch, I think this is the only code
> change needed, in library `easy-mmode.el':
>
>   (let ((local ,(if globalp "" " in current buffer")))
>
> should be 
>
>   (let ((local ,(if globalp
>                     ""
>                   '(format " in buffer `%s'" (current-buffer)))))

Here's the patch, since Drew couldn't be bothered:

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 0a6d4ec504..4308272e42 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -360,7 +360,10 @@ define-minor-mode
                     (unless (and (current-message)
                                  (not (equal ,last-message
                                              (current-message))))
-                      (let ((local ,(if globalp "" " in current buffer")))
+                      (let ((local ,(if globalp
+                                        ""
+                                      '(format " in buffer `%s'"
+                                               (current-buffer)))))
 			(message ,(format "%s %%sabled%%s" pretty-name)
 			         (if ,getter "en" "dis") local)))))
 	      ,@(when after-hook `(,after-hook)))

But after running with this for a few minutes, I'm not sure I like it.
`C-x C-q' then says "Read-Only mode enabled in buffer `foo'" which makes
me wonder, of course, "why?  what happened to foo?  oh, this is that
buffer".

I.e., it's distracting, not useful information.

So I'm leaning towards leaving it the was it was.  Any opinions?

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




This bug report was last modified 1 year and 325 days ago.

Previous Next


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