GNU bug report logs - #73686
31.0.50; ERC 5.6.1-git: back button gone from describe-face via erc-nicks-list-faces

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Tue, 8 Oct 2024 02:48:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: "J.P." <jp <at> neverwas.me>

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 73686 in the body.
You can then email your comments to 73686 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 emacs-erc <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Tue, 08 Oct 2024 02:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "J.P." <jp <at> neverwas.me>:
New bug report received and forwarded. Copy sent to emacs-erc <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Tue, 08 Oct 2024 02:48:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; ERC 5.6.1-git: back button gone from describe-face via
 erc-nicks-list-faces
Date: Mon, 07 Oct 2024 19:47:41 -0700
The test `erc-nicks-list-faces' in test/lisp/erc/erc-nicks-tests.el now
fails [1]. This appears to be related to a recent change involving the
killing of local variables in `help-setup-xref'.

  e776df2a3eae0454ea85287e15ebba649bf8e918 is the first bad commit
  commit e776df2a3eae0454ea85287e15ebba649bf8e918
  Author: Dmitry Gutov <dmitry <at> gutov.dev>
  Date:   Sun Oct 6 04:31:31 2024 +0300
      help-setup-xref: Keep the local values only of some variables
      
      ,* lisp/help-mode.el (help-setup-xref): Kill all local variables,
      saving ones that are known to need to be preserved (bug#73637).
   lisp/help-mode.el | 37 +++++++++++++------------------------
   1 file changed, 13 insertions(+), 24 deletions(-)

The change also affects `list-faces-display' in faces.el, which
`erc-nicks-list-faces' depends on.

From emacs -Q:
1. M-x list-faces-display RET
2. TAB TAB RET C-x o (but see below*)
3. l -> (user-error "No previous help buffer")

Regarding (2), the Help buffer now opens in a split whereas before it
opened in the current window. The failing test expects the old behavior
but obviously doesn't have to for Emacs 31+. (That is to say we should
ensure the command still works and the test still passes on older Emacs
versions.)

I may not be able to look into this for a few days. Just filing a bug
now so folks will see it's been spotted.

Thanks.

[1] https://emba.gnu.org/emacs/emacs/-/jobs/90900/raw


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.0) of 2024-10-07 built on localhost
Repository revision: ff4de9eff30ade164655354f71e7cbca48135858
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12401002
System Description: Fedora Linux 40 (Workstation Edition)

Configured using:
 'configure --enable-check-lisp-object-type --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3'
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: ERC

Minor modes in effect:
  erc-truncate-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-ring-mode: t
  erc-nicks-mode: t
  erc-netsplit-mode: t
  erc-menu-mode: t
  erc-match-mode: t
  erc-list-mode: t
  erc-irccontrols-mode: t
  erc-keep-place-indicator-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-scrolltobottom-mode: t
  erc-imenu-mode: t
  erc-pcomplete-mode: t
  erc-button-mode: t
  erc-fill-wrap-mode: t
  erc-fill-mode: t
  erc-stamp--date-mode: t
  erc-stamp--display-margin-mode: t
  erc-stamp-mode: t
  erc-autojoin-mode: t
  erc-networks-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-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
  minibuffer-regexp-mode: t
  line-number-mode: t
  visual-line-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message yank-media dired dired-loaddefs
rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
facemenu help-fns radix-tree mule-util compile text-property-search
comp-run comp-common network-stream puny nsm erc-truncate erc-track
erc-ring erc-nicks color erc-netsplit erc-menu erc-match erc-list
erc-goodies erc-imenu imenu erc-pcomplete time-date pcomplete comint
ansi-osc ansi-color ring erc-button browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util url-parse url-vars mailcap erc-fill erc-stamp
erc-join cus-edit pp wid-edit view cus-start cus-load erc derived
auth-source eieio eieio-core icons password-cache json map format-spec
erc-backend erc-networks easy-mmode byte-opt bytecomp byte-compile
erc-common inline cl-extra help-mode erc-compat cl-seq cl-macs gv pcase
rx compat subr-x cl-loaddefs cl-lib erc-loaddefs rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process native-compile emacs)

Memory information:
((conses 16 310654 14020) (symbols 48 15823 0) (strings 32 41880 7379)
 (string-bytes 1 1446301) (vectors 16 22633)
 (vector-slots 8 247090 18865) (floats 8 201 7029)
 (intervals 56 5336 0) (buffers 984 20))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Tue, 08 Oct 2024 06:07:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 73686 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Mon, 07 Oct 2024 23:06:20 -0700
"J.P." <jp <at> neverwas.me> writes:

> This appears to be related to a recent change involving the killing of
> local variables in `help-setup-xref'.

Poking around some, it seems the various `describe-*' commands in
help-fns.el run `help-setup-xref' before doing

  (with-help-window (help-buffer) ...)

And because `major-mode' is buffer-local, it gets wiped out with these
latest changes before `help-buffer' ever sees it:

  (defun help-buffer ()
    (buffer-name
     (if (and help-xref-following
              (derived-mode-p 'help-mode))
         (current-buffer)
       (get-buffer-create "*Help*"))))

(Here, `help-xref-following' is t thanks to `help-do-xref'.)

> Regarding (2), the Help buffer now opens in a split whereas before it
> opened in the current window. The failing test expects the old behavior

This appears to happen when the `help-mode' (turned `fundamental-mode')
buffer from which `describe-*' is run isn't named `*Help*', as is the
case with `list-faces-display' and `erc-nicks-list-faces'.

As for fixing this, I wonder if we can somehow expand the role of
`help-buffer-under-preparation' (or `help-xref-following') so that
instead of t, it's bound to the last value of `major-mode' prior to
`help-setup-xref' running. And then `help-buffer' could first check this
stashed value before considering the current `major-mode' (like via
`provided-mode-derived-p' or whatever).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Tue, 08 Oct 2024 21:09:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 73686 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Tue, 08 Oct 2024 14:07:46 -0700
Small correction:

> From emacs -Q:
> 1. M-x list-faces-display RET
> 2. TAB TAB RET C-x o (but see below*)
     ^
Missing a C-x o here in the original recipe.

So I doubt this is directly related, but I'm noticing another
peculiarity regarding help buffers not named `*Help*'. As you'd expect,
going back via a back button replaces the window buffer with the
previous one. And though typing "l" does that as well, it also
re-creates the previous buffer in a new window, resulting in different
buffers with the same content (the new one being the default "*Help*").

From emacs -Q (on Emacs 30):

1. M-x list-faces-display RET
2. C-x o TAB TAB RET
3. In the help buffer for `abbrev-table-name':
   <backtab> <backtab> RET
4. In the help buffer for `font-lock-function-name-face':
   <backtab> RET
5. Back in `abbrev-table-name':
   TAB RET (should take you back to "*Faces*")

Now start a new session, repeating 1-3. For 4, hit "l" instead, and
witness the unwanted default "*Help*" buffer pop up in another window.
Superficially, I think the disparity results from `help-xref-following'
being t in the base recipe (at the hands of `help-do-xref'):

  * help-xref-go-back(#<buffer *Faces*>)
    help-do-xref(nil help-xref-go-back (#<buffer *Faces*>))
    help-button-action(#<marker (moves after insertion) at 751 in *Faces*>)
    button-activate(#<marker (moves after insertion) at 751 in *Faces*> nil)
    push-button(751)

Which allows for buffer reuse in `help-buffer'. No such arrangement
occurs with the "l" variant:

  * help-xref-go-back(#<buffer *Faces*>)
    help-go-back()
    funcall-interactively(help-go-back)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Tue, 08 Oct 2024 23:42:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 73686 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Tue, 08 Oct 2024 16:41:04 -0700
[Message part 1 (text/plain, inline)]
The attached PoC patch blindly tries to implement the approach loosely
theorized about in previous posts. While it seems to solve the issue at
hand (in a vacuum), it may well introduce others because I know
basically nothing about the help system and how it's meant to work.

[0001-POC-Overload-help-xref-following-for-non-default-hel.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Tue, 08 Oct 2024 23:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Wed, 09 Oct 2024 01:01:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 73686 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Tue, 08 Oct 2024 17:59:54 -0700
[Message part 1 (text/plain, inline)]
Actually, we can't count on `help-buffer-under-preparation' being
non-nil in `describe-*' commands (unless we're willing to modify all the
ones in which it isn't, which sounds rather dubious). Patch updated.

[0000-v1-v2.diff (text/x-patch, attachment)]
[0001-POC-Overload-help-xref-following-for-non-default-hel.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Wed, 09 Oct 2024 01:06:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: "J.P." <jp <at> neverwas.me>, 73686 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Wed, 9 Oct 2024 04:05:04 +0300
Hi!

On 08/10/2024 09:06, J.P. wrote:
> And because `major-mode' is buffer-local, it gets wiped out with these
> latest changes before `help-buffer' ever sees it:

This is a problem, sorry.

The command in question (erc-nicks-list-faces) doesn't really work for 
me -- it errors with

  No faces matching "\`erc-nicks-"

I've just pushed the patch below to master. Could you try it and see if 
it helps?

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 4ee4f4156a1..f233633d2ca 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -505,7 +505,8 @@ help-setup-xref
 because we want to record the \"previous\" position of point so we can
 restore it properly when going back."
   (with-current-buffer (help-buffer)
-    (kill-all-local-variables)
+     ;; Re-enable major mode, killing all other local vars.
+    (funcall major-mode)
     (when help-xref-stack-item
       (push (cons (point) help-xref-stack-item) help-xref-stack)
       (setq help-xref-forward-stack nil))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73686; Package emacs. (Wed, 09 Oct 2024 01:26:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: emacs-erc <at> gnu.org, 73686 <at> debbugs.gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Tue, 08 Oct 2024 18:24:52 -0700
Dmitry Gutov <dmitry <at> gutov.dev> writes:

> Hi!
>
> On 08/10/2024 09:06, J.P. wrote:
>> And because `major-mode' is buffer-local, it gets wiped out with these
>> latest changes before `help-buffer' ever sees it:
>
> This is a problem, sorry.

No worries.

>
> The command in question (erc-nicks-list-faces) doesn't really work for 
> me -- it errors with
>
>    No faces matching "\`erc-nicks-"

Oh, right. That command only works when `erc-nicks-mode' is enabled. But
you just can use `list-faces-display' instead, and then click on one of
the "abcdefghijklmnopqrstuvwxyz" buttons.

>
> I've just pushed the patch below to master. Could you try it and see if 
> it helps?

Seems to fix the issue. Thanks!




Reply sent to "J.P." <jp <at> neverwas.me>:
You have taken responsibility. (Wed, 09 Oct 2024 03:01:02 GMT) Full text and rfc822 format available.

Notification sent to "J.P." <jp <at> neverwas.me>:
bug acknowledged by developer. (Wed, 09 Oct 2024 03:01:02 GMT) Full text and rfc822 format available.

Message #30 received at 73686-done <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 73686-done <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from
 describe-face via erc-nicks-list-faces
Date: Tue, 08 Oct 2024 20:00:41 -0700
This has been fixed by:

  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ef87ce0f

I will open another bug for the help-go-back stuff mentioned up thread.

Thanks and closing.




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

This bug report was last modified 283 days ago.

Previous Next


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