GNU bug report logs -
#44629
28.0.50; Eglot noisy with gfm-view-mode and view-read-only
Previous Next
Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Date: Sat, 14 Nov 2020 10:59:02 UTC
Severity: minor
Tags: fixed, patch
Found in version 28.0.50
Fixed in version 28.1
Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>
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 44629 in the body.
You can then email your comments to 44629 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
joaotavora <at> gmail.com, bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 10:59:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Basil L. Contovounesios" <contovob <at> tcd.ie>
:
New bug report received and forwarded. Copy sent to
joaotavora <at> gmail.com, bug-gnu-emacs <at> gnu.org
.
(Sat, 14 Nov 2020 10:59:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
X-Debbugs-Cc: "João Távora" <joaotavora <at> gmail.com>
Severity: minor
With Eglot, gfm-view-mode, and non-nil view-read-only, the echo area
becomes quite congested. Here's an example that assumes you have
previously installed the eglot (GNU ELPA) and markdown-mode (MELPA)
packages using a vanilla package.el configuration, as well as pyls, the
default Python language server that Eglot expects:
0. emacs -Q
1. (setq view-read-only t) C-j
2. M-x package-initialize RET
3. C-x C-f /tmp/foo.py RET
4. Enter the following Python:
def foo():
bar = 1
5. M-x eglot RET (and wait for things to settle down)
6. M-x flymake-goto-next-error RET (and wait for things to settle down)
The echo area is now taken over by the view-mode-enter message
"View mode: type C-h for help, h for commands, q to quit."
This message also appears at various other stages of editing, but when
hovering over variables or flymake errors it seems to be the last one
standing in the echo area.
This happens because eglot--format-markup calls gfm-view-mode, which in
turn enables read-only-mode, which in turn calls view-mode-enter.
I can't disable this by setting view-read-only or
view-inhibit-help-message locally, since Eglot does its doc processing
in a different buffer.
Perhaps Eglot could/should bind view-inhibit-help-message around
gfm-view-mode? Any other ideas?
Thanks,
--
Basil
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
of 2020-11-11 built on thunk
Repository revision: e7b4f465e8b2ec1c8d54a611db7eca44ae350711
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid
Configured using:
'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
--prefix=/home/blc/.local --with-x-toolkit=lucid
--with-file-notification=yes --with-x'
Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT
LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS
LIBSYSTEMD JSON PDUMPER LCMS2
Important settings:
value of $LANG: en_IE.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Python
Minor modes in effect:
eglot--managed-mode: t
flymake-mode: t
shell-dirtrack-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils markdown-mode color noutline outline
cl-extra view vc-mtn vc-hg vc-git diff-mode easy-mmode vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher eglot array filenotify
jsonrpc ert pp ewoc debug backtrace help-mode find-func xref
flymake-proc flymake thingatpt warnings compile text-property-search
pcase project imenu python tramp-sh tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete parse-time
iso8601 time-date ls-lisp format-spec comint ring ansi-color finder-inf
tex-site debian-el edmacro kmacro rx w3m-load info package easymenu
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
x multi-tty make-network-process emacs)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 11:16:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 44629 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> The echo area is now taken over by the view-mode-enter message
> "View mode: type C-h for help, h for commands, q to quit."
>
> This message also appears at various other stages of editing, but when
> hovering over variables or flymake errors it seems to be the last one
> standing in the echo area.
>
> This happens because eglot--format-markup calls gfm-view-mode, which in
> turn enables read-only-mode, which in turn calls view-mode-enter.
>
> I can't disable this by setting view-read-only or
> view-inhibit-help-message locally, since Eglot does its doc processing
> in a different buffer.
>
> Perhaps Eglot could/should bind view-inhibit-help-message around
> gfm-view-mode? Any other ideas?
I tried advising eglot--format-markup to bind view-inhibit-help-message,
which gets rid of the most annoying messages, but some still seem to
emanate from jsonrpc, which calls read-only-mode in
jsonrpc-events-buffer and initialize-instance. I'd rather not have to
rely on advising internal functions, but maybe I can't have my cake and
eat it, too. ;)
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 12:03:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 44629 <at> debbugs.gnu.org (full text, mbox):
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Date: Sat, 14 Nov 2020 11:15:48 +0000
> Cc: João Távora <joaotavora <at> gmail.com>
>
> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
> > Perhaps Eglot could/should bind view-inhibit-help-message around
> > gfm-view-mode? Any other ideas?
>
> I tried advising eglot--format-markup to bind view-inhibit-help-message,
> which gets rid of the most annoying messages, but some still seem to
> emanate from jsonrpc, which calls read-only-mode in
> jsonrpc-events-buffer and initialize-instance. I'd rather not have to
> rely on advising internal functions, but maybe I can't have my cake and
> eat it, too. ;)
Can what you want be achieved by setting set-message-function to
something suitable?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 12:27:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 44629 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Date: Sat, 14 Nov 2020 11:15:48 +0000
>> Cc: João Távora <joaotavora <at> gmail.com>
>>
>> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>>
>> > Perhaps Eglot could/should bind view-inhibit-help-message around
>> > gfm-view-mode? Any other ideas?
>>
>> I tried advising eglot--format-markup to bind view-inhibit-help-message,
>> which gets rid of the most annoying messages, but some still seem to
>> emanate from jsonrpc, which calls read-only-mode in
>> jsonrpc-events-buffer and initialize-instance. I'd rather not have to
>> rely on advising internal functions, but maybe I can't have my cake and
>> eat it, too. ;)
>
> Can what you want be achieved by setting set-message-function to
> something suitable?
I don't have a preference for one or the other approach, but I'm not
sure how that would be much different to binding
view-inhibit-help-message. The problem in both cases is that eglot and
jsonrpc internally make calls, either directly or indirectly, to
read-only-mode, which can be noisy.
I'd like read-only-mode to remain noisy (via view-read-only) in all
other cases, if possible, such as when visiting a read-only file. How
can the use of set-message-function distinguish between calls to
read-only-mode from internal Eglot plumbing, vs those from
e.g. find-file?
The only clean approaches off the top of my head are:
a) inhibit these messages in one way or another around calls to
gfm-view-mode/read-only-mode in eglot/jsonrpc;
b) disable view-read-only and/or enable view-inhibit-help-message
in my configuration.
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 13:49:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 44629 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> X-Debbugs-Cc: "João Távora" <joaotavora <at> gmail.com>
> Severity: minor
Hi Basil, and thanks for X-Debbugs-CC'ing me in this message. This is
indeed the way I hope to handle Eglot bugs in the future: via email and
the Emacs bug tracker.
> Perhaps Eglot could/should bind view-inhibit-help-message around
> gfm-view-mode? Any other ideas?
I'd have no problem with that, but as you've noted, it doesn't work when
other modes also use `read-only-mode`.
I think this is more of an Emacs echo-area congestion problem than an
Eglot one. view-read-only seems a bit akward, I'd say, but it's been
around such a long time that I won't argue for changing it.
I'd say the fix here is for Eglot, jsonrpc.el and all all other code
that needs to set a buffer read only for implementation purposes just
sets the variable buffer-read-only. In fact, the docstring of
read-only-mode hints at this:
...
Do not call this from a Lisp program unless you really intend to
do the same thing as the C-x C-q command, including
possibly enabling or disabling View mode.
...
I wasn't aware of caveat until just now.
Alternatively, and very cautiously, we could also say that the echo area
message issued by view-mode should only be displayed to the user if it's
running interactively, i.e. if it's a direct synchronous consequence of
an interactive command. That would exclude elisp code running
asynchronously like jsonrpc.el's updating of the events buffer, and
probably also the use that ElDoc clients make of `read-only-mode`.
In fact, the docstring of called-interactively-p seems to indicate its
main use is to cover these use cases.
...
The only known proper use of `interactive' for KIND is in deciding
whether to display a helpful message, or how to display it.
...
In that spirit, maybe this could fix it?
diff --git a/lisp/view.el b/lisp/view.el
index 204e28c2a2..6233f3ba7d 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -559,7 +559,8 @@ view-mode-enter
(unless view-mode
(view-mode 1)
- (unless view-inhibit-help-message
+ (unless (or view-inhibit-help-message
+ (not (called-interactively-p 'interactive)))
(message "%s"
(substitute-command-keys "\
View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit.")))))
João
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 14:47:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 44629 <at> debbugs.gnu.org (full text, mbox):
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: 44629 <at> debbugs.gnu.org, joaotavora <at> gmail.com
> Date: Sat, 14 Nov 2020 12:26:28 +0000
>
> The only clean approaches off the top of my head are:
>
> a) inhibit these messages in one way or another around calls to
> gfm-view-mode/read-only-mode in eglot/jsonrpc;
Bind inhibit-message to non-nil around the calls to these?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 15:14:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 44629 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Maybe, for gfm-view-mode, but in general I think I should just stop
using read-only-mode, and set buffer-read-only instead.
João
On Sat, Nov 14, 2020 at 2:46 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> > Cc: 44629 <at> debbugs.gnu.org, joaotavora <at> gmail.com
> > Date: Sat, 14 Nov 2020 12:26:28 +0000
> >
> > The only clean approaches off the top of my head are:
> >
> > a) inhibit these messages in one way or another around calls to
> > gfm-view-mode/read-only-mode in eglot/jsonrpc;
>
> Bind inhibit-message to non-nil around the calls to these?
>
--
João Távora
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 14 Nov 2020 17:15:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 44629 <at> debbugs.gnu.org (full text, mbox):
João Távora <joaotavora <at> gmail.com> writes:
[...]
> I'd say the fix here is for Eglot, jsonrpc.el and all all other code
> that needs to set a buffer read only for implementation purposes just
> sets the variable buffer-read-only. In fact, the docstring of
> read-only-mode hints at this:
[...]
> Alternatively, and very cautiously, we could also say that the echo area
> message issued by view-mode should only be displayed to the user if it's
> running interactively, i.e. if it's a direct synchronous consequence of
> an interactive command. That would exclude elisp code running
> asynchronously like jsonrpc.el's updating of the events buffer, and
> probably also the use that ElDoc clients make of `read-only-mode`.
[...]
> In that spirit, maybe this could fix it?
>
> diff --git a/lisp/view.el b/lisp/view.el
> index 204e28c2a2..6233f3ba7d 100644
> --- a/lisp/view.el
> +++ b/lisp/view.el
> @@ -559,7 +559,8 @@ view-mode-enter
>
> (unless view-mode
> (view-mode 1)
> - (unless view-inhibit-help-message
> + (unless (or view-inhibit-help-message
> + (not (called-interactively-p 'interactive)))
> (message "%s"
> (substitute-command-keys "\
> View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit.")))))
I don't think so, at least not in that exact manifestation, because
view-mode-enter is seldom, if ever, called interactively. I.e. this
will suppress the help message even when you visit a read-only file.
So it's sounding like replacing read-only-mode with buffer-read-only,
and an inhibit-message around gfm-view-mode, is indeed the way to go.
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sun, 15 Nov 2020 09:56:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 44629 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> João Távora <joaotavora <at> gmail.com> writes:
>
> [...]
>
>> I'd say the fix here is for Eglot, jsonrpc.el and all all other code
>> that needs to set a buffer read only for implementation purposes just
>> sets the variable buffer-read-only. In fact, the docstring of
>> read-only-mode hints at this:
>
> [...]
>
>> Alternatively, and very cautiously, we could also say that the echo area
>> message issued by view-mode should only be displayed to the user if it's
>> running interactively, i.e. if it's a direct synchronous consequence of
>> an interactive command. That would exclude elisp code running
>> asynchronously like jsonrpc.el's updating of the events buffer, and
>> probably also the use that ElDoc clients make of `read-only-mode`.
>
> [...]
>
>> In that spirit, maybe this could fix it?
>>
>> diff --git a/lisp/view.el b/lisp/view.el
>> index 204e28c2a2..6233f3ba7d 100644
>> --- a/lisp/view.el
>> +++ b/lisp/view.el
>> @@ -559,7 +559,8 @@ view-mode-enter
>>
>> (unless view-mode
>> (view-mode 1)
>> - (unless view-inhibit-help-message
>> + (unless (or view-inhibit-help-message
>> + (not (called-interactively-p 'interactive)))
>> (message "%s"
>> (substitute-command-keys "\
>> View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit.")))))
>
> I don't think so, at least not in that exact manifestation, because
> view-mode-enter is seldom, if ever, called interactively. I.e. this
> will suppress the help message even when you visit a read-only file.
You're of course right. This is for the immediately "containing
function", not for the "current stack". But 'this-command' could do
the trick;
diff --git a/lisp/view.el b/lisp/view.el
index 204e28c2a2..2a0fc85cb8 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -559,7 +559,8 @@ view-mode-enter
(unless view-mode
(view-mode 1)
- (unless view-inhibit-help-message
+ (unless (or view-inhibit-help-message
+ (not this-command))
(message "%s"
(substitute-command-keys "\
View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit.")))))
When I have this, and view-read-only set to t, C-x C-f'ing to /etc/fstab
gets me the message but this:
(run-with-timer 1 nil (lambda () (find-file "/etc/fstab")))
does not.
Anyway, feel free to beat me to the patches to jsonrpc.el and Eglot (the
former you can do directly on the tree, the latter can be done via
GitHub, or just send me the patch here).
João
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sun, 15 Nov 2020 20:29:03 GMT)
Full text and
rfc822 format available.
Message #32 received at 44629 <at> debbugs.gnu.org (full text, mbox):
> Can what you want be achieved by setting set-message-function to
> something suitable?
Inhibiting messages selectively was discussed in bug#42865
where I forgot that this is indeed easily implementable
with the help of set-message-function, e.g.:
(defcustom inhibit-message-regexp "^View mode: type"
"Regexp to inhibit messages."
:type 'regexp)
(defun inhibit-message-function (message)
(string-match-p inhibit-message-regexp message))
(setq set-message-function 'inhibit-message-function)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sun, 15 Nov 2020 21:53:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 44629 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
>> Can what you want be achieved by setting set-message-function to
>> something suitable?
>
> Inhibiting messages selectively was discussed in bug#42865
> where I forgot that this is indeed easily implementable
> with the help of set-message-function, e.g.:
>
> (defcustom inhibit-message-regexp "^View mode: type"
> "Regexp to inhibit messages."
> :type 'regexp)
>
> (defun inhibit-message-function (message)
> (string-match-p inhibit-message-regexp message))
>
> (setq set-message-function 'inhibit-message-function)
The selectivity is that I want the "View mode: ..." message to appear
most of the time, except not when Eglot is doing background processing.
I therefore don't see how this set-message-function is any different to
the other ways of silencing the message that were already mentioned in
this thread. There are many ways of silencing the message, but they
have to be installed somewhere non-globally.
I'll try to write a patch for that tomorrow if no-one else beats me to
it.
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sun, 15 Nov 2020 23:15:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 44629 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sun, Nov 15, 2020 at 9:52 PM Basil L. Contovounesios <contovob <at> tcd.ie>
wrote:
> The selectivity is that I want the "View mode: ..." message to appear
> most of the time, except not when Eglot is doing background processing.
Exactly. Or any type of background processing, for that matter.
So, if this is a principle, the check for `this-command`, as I proposed
it in a patch,should suffice
This doesn't change the fact that jsonrpc.el's use of `read-only-mode`
should probably be replaced by a simple setting of buffer-read-only,
but it could avoid the change to eglot when it calls `gfm-view-mode`.
Though maybe that change could be there, too.
João
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Mon, 16 Nov 2020 09:38:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 44629 <at> debbugs.gnu.org (full text, mbox):
>> Inhibiting messages selectively was discussed in bug#42865
>>
>> (defcustom inhibit-message-regexp "^View mode: type"
>> "Regexp to inhibit messages."
>> :type 'regexp)
>>
>> (defun inhibit-message-function (message)
>> (string-match-p inhibit-message-regexp message))
>>
>> (setq set-message-function 'inhibit-message-function)
>
> The selectivity is that I want the "View mode: ..." message to appear
> most of the time, except not when Eglot is doing background processing.
I agree - the primary intention was to use this for user customization
in bug#42865.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Tue, 17 Nov 2020 20:17:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 44629 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 44629 + patch
quit
João Távora <joaotavora <at> gmail.com> writes:
> On Sun, Nov 15, 2020 at 9:52 PM Basil L. Contovounesios <contovob <at> tcd.ie> wrote:
>
>> The selectivity is that I want the "View mode: ..." message to appear
>> most of the time, except not when Eglot is doing background processing.
>
> Exactly. Or any type of background processing, for that matter.
> So, if this is a principle, the check for `this-command`, as I proposed
> it in a patch,should suffice
This initially felt a bit heavy-handed (since view-mode-enter is called
in various places), so I was hesitant to go with it, but upon further
consideration I couldn't think of a better way.
For example, binding inhibit-message or set-message-function in
eglot--format-markup may avoid spamming the echo area, but it may also
inadvertently clear the echo area of other messages during Eglot usage,
and still spams *Messages*.
The point is that view-mode-enter shouldn't call message under all
circumstances, and this-command seems like an accurate enough condition.
> This doesn't change the fact that jsonrpc.el's use of `read-only-mode`
> should probably be replaced by a simple setting of buffer-read-only,
> but it could avoid the change to eglot when it calls `gfm-view-mode`.
> Though maybe that change could be there, too.
See my thoughts above on why Eglot needn't be changed in this regard.
How's the attached patch for view.el and jsonrpc.el?
Thanks,
--
Basil
[0001-Avoid-spamming-view-mode-enter-help-message.patch (text/x-diff, attachment)]
Added tag(s) patch.
Request was from
"Basil L. Contovounesios" <contovob <at> tcd.ie>
to
control <at> debbugs.gnu.org
.
(Tue, 17 Nov 2020 20:17:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Tue, 17 Nov 2020 20:22:01 GMT)
Full text and
rfc822 format available.
Message #49 received at 44629 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> How's the attached patch for view.el and jsonrpc.el?
I forgot to ask - if this goes in, does it need calling out in etc/NEWS?
I wouldn't have thought so, but I'm not against it, either.
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Tue, 17 Nov 2020 22:57:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 44629 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>> This doesn't change the fact that jsonrpc.el's use of `read-only-mode`
>> should probably be replaced by a simple setting of buffer-read-only,
>> but it could avoid the change to eglot when it calls `gfm-view-mode`.
>> Though maybe that change could be there, too.
>
> See my thoughts above on why Eglot needn't be changed in this regard.
They make sense.
> How's the attached patch for view.el and jsonrpc.el?
Looks good, and the mini-refactoring in jsonrpc.el is also welcome.
IMO, this doesn't need to be called out in NEWS. But let's hear from
Lars.
João
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sat, 28 Nov 2020 21:28:02 GMT)
Full text and
rfc822 format available.
Message #55 received at 44629 <at> debbugs.gnu.org (full text, mbox):
João Távora <joaotavora <at> gmail.com> writes:
> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> How's the attached patch for view.el and jsonrpc.el?
>
> Looks good, and the mini-refactoring in jsonrpc.el is also welcome.
>
> IMO, this doesn't need to be called out in NEWS. But let's hear from
> Lars.
I'll wait a few more days for comments/objections before pushing.
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Sun, 29 Nov 2020 10:37:03 GMT)
Full text and
rfc822 format available.
Message #58 received at 44629 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> How's the attached patch for view.el and jsonrpc.el?
[...]
> By default, entering view-mode echoes a usage message. This is
> particularly helpful with non-nil view-read-only, to notify the user
> that view-mode has been enabled. It is less useful and more spammy,
> however, if view-mode is (possibly inadvertently) entered from some
> non-interactive code running in the background, such as when a major
> mode is enabled in a temporary buffer for text formatting
> purposes (bug#44629).
I've only skimmed the code, but this makes sense to me.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
"Basil L. Contovounesios" <contovob <at> tcd.ie>
to
control <at> debbugs.gnu.org
.
(Thu, 03 Dec 2020 15:27:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
44629 <at> debbugs.gnu.org and "Basil L. Contovounesios" <contovob <at> tcd.ie>
Request was from
"Basil L. Contovounesios" <contovob <at> tcd.ie>
to
control <at> debbugs.gnu.org
.
(Thu, 03 Dec 2020 15:27:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44629
; Package
emacs
.
(Thu, 03 Dec 2020 15:27:03 GMT)
Full text and
rfc822 format available.
Message #65 received at 44629-done <at> debbugs.gnu.org (full text, mbox):
tags 44629 fixed
close 44629 28.1
quit
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> How's the attached patch for view.el and jsonrpc.el?
>
> [...]
>
>> By default, entering view-mode echoes a usage message. This is
>> particularly helpful with non-nil view-read-only, to notify the user
>> that view-mode has been enabled. It is less useful and more spammy,
>> however, if view-mode is (possibly inadvertently) entered from some
>> non-interactive code running in the background, such as when a major
>> mode is enabled in a temporary buffer for text formatting
>> purposes (bug#44629).
>
> I've only skimmed the code, but this makes sense to me.
Thanks, now pushed to master.
Avoid spamming view-mode-enter help message
805d82197f 2020-12-03 15:22:00 +0000
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=805d82197f050d1aba8fb796e604c55ce3d6333a
--
Basil
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 01 Jan 2021 12:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 228 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.