From unknown Sat Jun 21 08:54:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73637 <73637@debbugs.gnu.org> To: bug#73637 <73637@debbugs.gnu.org> Subject: Status: [PATCH] New hook 'help-setup-hook' Reply-To: bug#73637 <73637@debbugs.gnu.org> Date: Sat, 21 Jun 2025 15:54:17 +0000 retitle 73637 [PATCH] New hook 'help-setup-hook' reassign 73637 emacs submitter 73637 Eshel Yaron severity 73637 normal tag 73637 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 03:17:18 2024 Received: (at submit) by debbugs.gnu.org; 5 Oct 2024 07:17:18 +0000 Received: from localhost ([127.0.0.1]:37162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swz2T-0003dq-S1 for submit@debbugs.gnu.org; Sat, 05 Oct 2024 03:17:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:45370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swz2S-0003df-5g for submit@debbugs.gnu.org; Sat, 05 Oct 2024 03:17:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swz0F-0002Iv-HU for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 03:14:59 -0400 Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swz0D-0007he-Kf for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 03:14:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1728112496; bh=yE34yZ1wpatx2i2Dq+/OywsY7Io5IvPDIWvDsfplxS4=; h=From:To:Subject:Date:From; b=VfDkXfOB2QK5bYTBgE3lxVgo8dUPG7RpV7irqI9sRo6JtIv+bZEZ4K0zbMYKh3uzA Z+64P0kgM73dqtiHkEKk/Rmxmu4kVDdHsbbxNymLoFRl/j0fK4eDYUzjagQ/bdA58m ZUMexWGVe5tO3mmHlGszg+n+V4tbU9az+sTvBnwbbjaEJ/gNSbNvtS4LvhuQFMH8oX mWcG4d0TGOyT6jzeiLdwGXkqyMFKT5Qyni3KwxCRBF6RMBXuXtUBQFVUOiUtvsz9Hi fZ3CT3tyS70y54d1xXLEQ1vcxOCb63dMxV1FUaG8UF8Zg2UiJMi6B4ZeJN4BMiUMcV QIMdfn+00kfvQ== From: Eshel Yaron To: bug-gnu-emacs@gnu.org Subject: [PATCH] New hook 'help-setup-hook' X-Hashcash: 1:20:241005:bug-gnu-emacs@gnu.org::nfn0hFK5z29O5izC:Cx0N Date: Sat, 05 Oct 2024 09:14:54 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Add a new hook that allows commands that make use of bespoke variable settings in the *Help* buffer to clean up after themselves. This generalizes and improves the accuracy of the hard-coded clean up that help-setup-xref currently performs. --=-=-= Content-Type: text/patch; charset=utf-8 Content-Disposition: attachment; filename=0001-New-hook-help-setup-hook.patch Content-Transfer-Encoding: quoted-printable >From e4d633d55370265f25cf229553ff16435b1c23b8 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 5 Oct 2024 09:04:10 +0200 Subject: [PATCH] New hook 'help-setup-hook' * lisp/help-mode.el (help-setup-hook): New hook. (help-setup-xref): Run it. * lisp/help.el (describe-bindings): * lisp/help-fns.el (help-fns--setup-xref-backend): Use it for clean up. --- lisp/help-fns.el | 7 ++++++- lisp/help-mode.el | 25 +++++++++---------------- lisp/help.el | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 5cc8df6497f..c01529f410a 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -280,7 +280,12 @@ xref-backend-references =20 (defun help-fns--setup-xref-backend () (add-hook 'xref-backend-functions #'elisp--xref-backend nil t) - (setq-local semantic-symref-filepattern-alist '((help-mode "*.el")))) + (setq-local semantic-symref-filepattern-alist '((help-mode "*.el"))) + (add-hook 'help-setup-hook + (lambda () + (kill-local-variable 'xref-backend-functions) + (kill-local-variable 'semantic-symref-filepattern-alist)) + nil t)) =20 ;;;###autoload (defun describe-function (function) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 7bb69a9389f..e14285269df 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -492,6 +492,13 @@ help-xref-url-regexp (purecopy "\\<[Uu][Rr][Ll][ \t\n]+['`=E2=80=98]\\([^'=E2=80=99]+\\)['=E2= =80=99]") "Regexp matching doc string references to a URL.") =20 +(defvar-local help-setup-hook nil + "Functions to call with no arguments when populating \"*Help*\" buffers. + +Emacs resets the buffer-local value of this variable after calling these +functions, so that functions that you add to this hook buffer-locally +are only called once, when another command reuses the \"*Help*\" buffer.") + ;;;###autoload (defun help-setup-xref (item interactive-p) "Invoked from commands using the \"*Help*\" buffer to install some xref = info. @@ -505,22 +512,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) - ;; Disable `outline-minor-mode' in a reused Help buffer - ;; created by `describe-bindings' that enables this mode. - (when (bound-and-true-p outline-minor-mode) - (outline-minor-mode -1) - (mapc #'kill-local-variable - '(outline-search-function - outline-regexp - outline-heading-end-regexp - outline-level - outline-minor-mode-cycle - outline-minor-mode-highlight - outline-minor-mode-use-buttons - outline-default-state - outline-default-rules))) - (kill-local-variable 'xref-backend-functions) - (kill-local-variable 'semantic-symref-filepattern-alist) + (run-hooks 'help-setup-hook) + (kill-local-variable 'help-setup-hook) (when help-xref-stack-item (push (cons (point) help-xref-stack-item) help-xref-stack) (setq help-xref-forward-stack nil)) diff --git a/lisp/help.el b/lisp/help.el index 5efe207c624..fd206480dcb 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -806,7 +806,20 @@ describe-bindings ;; Hide ^Ls. (while (search-forward "\n\f\n" nil t) (put-text-property (1+ (match-beginning 0)) (1- (match-end 0)) - 'invisible t))))))))) + 'invisible t)))) + (add-hook 'help-setup-hook + (lambda () + (outline-minor-mode -1) + (mapc #'kill-local-variable + '(outline-regexp + outline-heading-end-regexp + outline-level + outline-minor-mode-cycle + outline-minor-mode-highlight + outline-minor-mode-use-buttons + outline-default-state + outline-default-rules))) + nil t)))))) =20 (defun where-is (definition &optional insert) "Print message listing key sequences that invoke the command DEFINITION. --=20 2.46.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 03:43:22 2024 Received: (at 73637) by debbugs.gnu.org; 5 Oct 2024 07:43:22 +0000 Received: from localhost ([127.0.0.1]:37209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swzRi-0004xl-5C for submit@debbugs.gnu.org; Sat, 05 Oct 2024 03:43:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swzRf-0004xX-Tc for 73637@debbugs.gnu.org; Sat, 05 Oct 2024 03:43:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swzPQ-0001tJ-Aa; Sat, 05 Oct 2024 03:41:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qHIT4cQ/zM6KGprphdRGbwYokg0KwhovtEQXhKC2S8w=; b=Tw+NdVwC3JhBzXMlPLtm SjUsaaDXTtU8be2xCdiNGmxmyaROdnFCpWqRoWxHDHrkHSwM55kxbrJ0PQ3LD+7CqsBVsng+cwBD9 9vLd5Xi1rF+nZL4EEw3usE9vXmq4YxcvyyomnzPMy/igUMqYFvbI01eg80Lqs3ynsfciwrhB3uFjD tPdDjPuGgSkt2/hq5HVGlK+DAQcKxJgzUEZ9hlYP9L28XNbXPVRDH4NlyGTX84oSvN/RN1go6idAO X2EdJ65hUTBPT5q+TszIHbp3UQzmqV6cjcUi4hvf3oh2n0YH7BUSbNvjOOJDS//RXh55PnHfFyUK9 6sgbsxZrlviYdg==; Date: Sat, 05 Oct 2024 10:40:56 +0300 Message-Id: <86wminvvxz.fsf@gnu.org> From: Eli Zaretskii To: Eshel Yaron , Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73637 Cc: 73637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 05 Oct 2024 09:14:54 +0200 > From: Eshel Yaron via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" Stefan, any comments? > --- a/lisp/help-fns.el > +++ b/lisp/help-fns.el > @@ -280,7 +280,12 @@ xref-backend-references > > (defun help-fns--setup-xref-backend () > (add-hook 'xref-backend-functions #'elisp--xref-backend nil t) > - (setq-local semantic-symref-filepattern-alist '((help-mode "*.el")))) > + (setq-local semantic-symref-filepattern-alist '((help-mode "*.el"))) > + (add-hook 'help-setup-hook > + (lambda () > + (kill-local-variable 'xref-backend-functions) > + (kill-local-variable 'semantic-symref-filepattern-alist)) > + nil t)) Please add comments here to explain why the hook does these things. > --- a/lisp/help-mode.el > +++ b/lisp/help-mode.el > @@ -492,6 +492,13 @@ help-xref-url-regexp > (purecopy "\\<[Uu][Rr][Ll][ \t\n]+['`‘]\\([^'’]+\\)['’]") > "Regexp matching doc string references to a URL.") > > +(defvar-local help-setup-hook nil > + "Functions to call with no arguments when populating \"*Help*\" buffers. Please mention in the doc string which function(s) call(s) this hook. > - ;; Disable `outline-minor-mode' in a reused Help buffer > - ;; created by `describe-bindings' that enables this mode. This useful comment is lost as result of your patch. Is that on purpose? Finally, I think this hook should be added to the list of the standard hooks in the ELisp manual. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 04:46:16 2024 Received: (at 73637) by debbugs.gnu.org; 5 Oct 2024 08:46:16 +0000 Received: from localhost ([127.0.0.1]:37270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx0QZ-0008Eq-TY for submit@debbugs.gnu.org; Sat, 05 Oct 2024 04:46:16 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:39992 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx0QX-0008Eg-91 for 73637@debbugs.gnu.org; Sat, 05 Oct 2024 04:46:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1728117968; bh=yKAr/YbG1NcsuASA3qnojzEXypkOaeSJ2uf1MPLzA9Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Hh0Yk2Dr7qHik6sN5tVbkF0uSs619ve2W+Qb4m76ms+bpdBfPIeZw+L80W69P3+m2 KuxsYAOcsX39y5OYcI5SZjAZob133xup5dNp46cH+tf0ayFIK9+JyiRI2KCybT+ICi DF+QFL1MmNPK/BgX8OhytAf8RwIFAVRibASSpwZgrqYNer2gHRaiNzOTOukXs3lcBf AGLpe2Om9NsKt5jD2yBv6RbZDG4x9cxpHOduw6aaTBHa7Q9vSNKHNbZ/32io//Qbfl cOrywpIIlOfH67ivWP9Ns6xSh/pJFWIGTAiXsm1uotdVVFxiHb4ZWa/8I80PP7rwAm XfYOi4UFZ2pMw== From: Eshel Yaron To: Eli Zaretskii Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' In-Reply-To: <86wminvvxz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Oct 2024 10:40:56 +0300") References: <86wminvvxz.fsf@gnu.org> Date: Sat, 05 Oct 2024 10:46:06 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73637 Cc: Stefan Monnier , 73637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Eli Zaretskii writes: >> Date: Sat, 05 Oct 2024 09:14:54 +0200 >> From: Eshel Yaron via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" > > Stefan, any comments? > >> --- a/lisp/help-fns.el >> +++ b/lisp/help-fns.el >> @@ -280,7 +280,12 @@ xref-backend-references >>=20=20 >> (defun help-fns--setup-xref-backend () >> (add-hook 'xref-backend-functions #'elisp--xref-backend nil t) >> - (setq-local semantic-symref-filepattern-alist '((help-mode "*.el")))) >> + (setq-local semantic-symref-filepattern-alist '((help-mode "*.el"))) >> + (add-hook 'help-setup-hook >> + (lambda () >> + (kill-local-variable 'xref-backend-functions) >> + (kill-local-variable 'semantic-symref-filepattern-alist)) >> + nil t)) > > Please add comments here to explain why the hook does these things. OK, see updated patch below. >> --- a/lisp/help-mode.el >> +++ b/lisp/help-mode.el >> @@ -492,6 +492,13 @@ help-xref-url-regexp >> (purecopy "\\<[Uu][Rr][Ll][ \t\n]+['`=E2=80=98]\\([^'=E2=80=99]+\\)['= =E2=80=99]") >> "Regexp matching doc string references to a URL.") >>=20=20 >> +(defvar-local help-setup-hook nil >> + "Functions to call with no arguments when populating \"*Help*\" buffe= rs. > > Please mention in the doc string which function(s) call(s) this hook. Done. >> - ;; Disable `outline-minor-mode' in a reused Help buffer >> - ;; created by `describe-bindings' that enables this mode. > > This useful comment is lost as result of your patch. Is that on > purpose? Yes, this change obviates the need for this comment, as the code no longer caters for describe-bindings specifically, it just runs a hook. > Finally, I think this hook should be added to the list of the standard > hooks in the ELisp manual. Done in the patch below. Thanks for taking a look. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=v2-0001-New-hook-help-setup-hook-bug-73637.patch Content-Transfer-Encoding: quoted-printable >From 1a67fe980a80537da18a95119829806b031b33b4 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 5 Oct 2024 09:04:10 +0200 Subject: [PATCH v2] New hook 'help-setup-hook' (bug#73637) * lisp/help-mode.el (help-setup-hook): New hook. (help-setup-xref): Run it. * lisp/help.el (describe-bindings): * lisp/help-fns.el (help-fns--setup-xref-backend): Use it for clean up. * doc/lispref/help.texi (Help Functions): Document it. * doc/lispref/hooks.texi (Standard Hooks): Mention it. --- doc/lispref/help.texi | 6 ++++++ doc/lispref/hooks.texi | 3 +++ lisp/help-fns.el | 8 +++++++- lisp/help-mode.el | 26 ++++++++++---------------- lisp/help.el | 16 +++++++++++++++- 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index cc3c16f896d..7d3ae070ab2 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -772,6 +772,7 @@ Help Functions last value in @var{body}. @end defmac =20 +@vindex help-setup-hook @defun help-setup-xref item interactive-p This function updates the cross reference data in the @file{*Help*} buffer, which is used to regenerate the help information when the user @@ -783,6 +784,11 @@ Help Functions The @var{interactive-p} argument is non-@code{nil} if the calling command was invoked interactively; in that case, the stack of items for the @file{*Help*} buffer's @samp{Back} buttons is cleared. + +This function runs the hook @code{help-setup-hook}, and resets the +buffer-local value of that hook to its global value. Functions that +rely on bespoke settings in the @file{*Help*} buffer can use this hook +to restore a clean state when another function reuses that buffer. @end defun =20 @xref{describe-symbols example}, for an example of using diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index 9231d7573f9..645ec0f5bdf 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi @@ -180,6 +180,9 @@ Standard Hooks @item menu-bar-update-hook @xref{Menu Bar}. =20 +@item help-setup-hook +@xref{Help Functions}. + @item minibuffer-setup-hook @itemx minibuffer-exit-hook @xref{Minibuffer Misc}. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 5cc8df6497f..42463ea898b 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -280,7 +280,13 @@ xref-backend-references =20 (defun help-fns--setup-xref-backend () (add-hook 'xref-backend-functions #'elisp--xref-backend nil t) - (setq-local semantic-symref-filepattern-alist '((help-mode "*.el")))) + (setq-local semantic-symref-filepattern-alist '((help-mode "*.el"))) + ;; Clean up after ourselves when the *Help* buffer is reused. + (add-hook 'help-setup-hook + (lambda () + (kill-local-variable 'xref-backend-functions) + (kill-local-variable 'semantic-symref-filepattern-alist)) + nil t)) =20 ;;;###autoload (defun describe-function (function) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 7bb69a9389f..8dece261581 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -492,6 +492,14 @@ help-xref-url-regexp (purecopy "\\<[Uu][Rr][Ll][ \t\n]+['`=E2=80=98]\\([^'=E2=80=99]+\\)['=E2= =80=99]") "Regexp matching doc string references to a URL.") =20 +(defvar-local help-setup-hook nil + "Functions to call with no arguments when populating \"*Help*\" buffers. + +`help-setup-xref' runs this hook. It resets the buffer-local value of +this variable after calling these functions, so that functions that you +add to this hook buffer-locally are only called once, when another +command reuses the \"*Help*\" buffer.") + ;;;###autoload (defun help-setup-xref (item interactive-p) "Invoked from commands using the \"*Help*\" buffer to install some xref = info. @@ -505,22 +513,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) - ;; Disable `outline-minor-mode' in a reused Help buffer - ;; created by `describe-bindings' that enables this mode. - (when (bound-and-true-p outline-minor-mode) - (outline-minor-mode -1) - (mapc #'kill-local-variable - '(outline-search-function - outline-regexp - outline-heading-end-regexp - outline-level - outline-minor-mode-cycle - outline-minor-mode-highlight - outline-minor-mode-use-buttons - outline-default-state - outline-default-rules))) - (kill-local-variable 'xref-backend-functions) - (kill-local-variable 'semantic-symref-filepattern-alist) + (run-hooks 'help-setup-hook) + (kill-local-variable 'help-setup-hook) (when help-xref-stack-item (push (cons (point) help-xref-stack-item) help-xref-stack) (setq help-xref-forward-stack nil)) diff --git a/lisp/help.el b/lisp/help.el index 5efe207c624..4f5646d9e93 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -806,7 +806,21 @@ describe-bindings ;; Hide ^Ls. (while (search-forward "\n\f\n" nil t) (put-text-property (1+ (match-beginning 0)) (1- (match-end 0)) - 'invisible t))))))))) + 'invisible t)))) + ;; Clean up after ourselves when the *Help* buffer is reused. + (add-hook 'help-setup-hook + (lambda () + (outline-minor-mode -1) + (mapc #'kill-local-variable + '(outline-regexp + outline-heading-end-regexp + outline-level + outline-minor-mode-cycle + outline-minor-mode-highlight + outline-minor-mode-use-buttons + outline-default-state + outline-default-rules))) + nil t)))))) =20 (defun where-is (definition &optional insert) "Print message listing key sequences that invoke the command DEFINITION. --=20 2.46.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 08:19:45 2024 Received: (at 73637) by debbugs.gnu.org; 5 Oct 2024 12:19:45 +0000 Received: from localhost ([127.0.0.1]:37421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx3lB-0003gV-BX for submit@debbugs.gnu.org; Sat, 05 Oct 2024 08:19:45 -0400 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]:49567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx3l8-0003gI-Dd for 73637@debbugs.gnu.org; Sat, 05 Oct 2024 08:19:43 -0400 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 306F213806C7; Sat, 5 Oct 2024 08:19:32 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sat, 05 Oct 2024 08:19:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1728130772; x=1728217172; bh=syCd88D13DyMOvEuPmf3VxHatDjzKYBzRWTZq2EX8jY=; b= FG8IoOCrwD3HUKKXYw9c326BMNAWLoeijgg3nnK15oXsrt3hasyA/5t36m7St2RD gP5Kkt8tipSQ8htmciaLW1RbAQptjdyfZ6Nas8PvmO089dXsEPL4iiGX5ozgd7CZ VJ6MOylVomVo4zlsi0CrT1rAqA2DKvz3yoF2UglojEaFMQvJs+aLLUQZPD/Sd6Cj CmBAkrhBiuoMt5B+KpNldR4bLuqICne9KlLhS8doTPKgyqda0HbqTcurjy9WEWs3 n4Kn/AgVpQNOt0jFUZ9pfrKPe0IOwnaV0UZrBTIyQXwnL8GghN4Ajg/sx3tZWfnd /DsAtY8sGKJbdCVGIQ+6aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728130772; x= 1728217172; bh=syCd88D13DyMOvEuPmf3VxHatDjzKYBzRWTZq2EX8jY=; b=e twHjmWlY45lrEASwKpu4b4ZQ4fL/9dlaRT2Y2d483dxrvY+3/iwah4/mFy3iBF9b 9aOMXQo7rH5p3LAf3zUuhQMDBiWNqfY1ZT7oeqrRlie6S9UTH+7tAV+QBnx+1C/r YzZq3c/+HtdxY4PJvzOhCIonn7jB4fk4XbBJRpgYzY/c+g0OSAIoWo7JqON//BCg ewMp2I5vOWA2AHypyTeGYM0rzTaY1f082UBZ+39YjAmhzCOeQZeMWiqmrAuEV3SZ ld9ICtE9Y1i3NcpmWWb7wEp/OuG/7noLyx1YsE5eMVyzBFNFYOQqT8OWMfYlAVYa ea43Y3iR6KMd95CrcXLCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvhedgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcu oegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvghrnheptdfhuedvtd evleegueelvedvjeevheffveevhedvuefftdefhfdvueeggfetgfdtnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtoh hvrdguvghvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphht thhopehmvgesvghshhgvlhihrghrohhnrdgtohhmpdhrtghpthhtohepjeefieefjeesug gvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Oct 2024 08:19:30 -0400 (EDT) Message-ID: <58c63a58-2764-43da-9d65-efb6f95ec2bc@gutov.dev> Date: Sat, 5 Oct 2024 15:19:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' To: Eshel Yaron , 73637@debbugs.gnu.org References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73637 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi again! On 05/10/2024 10:14, Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Add a new hook that allows commands that make use of bespoke variable > settings in the*Help* buffer to clean up after themselves. This > generalizes and improves the accuracy of the hard-coded clean up that > help-setup-xref currently performs. Thanks for looking into it. Have you tried going in the other direction? Meaning, killing all locals by default but keeping the ones that are really needed. This is less backward compatible, but ultimately a more predictable and common design. This seems to work okay here: diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 7bb69a9389f..8e37c138588 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -505,30 +505,19 @@ 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) - ;; Disable `outline-minor-mode' in a reused Help buffer - ;; created by `describe-bindings' that enables this mode. - (when (bound-and-true-p outline-minor-mode) - (outline-minor-mode -1) - (mapc #'kill-local-variable - '(outline-search-function - outline-regexp - outline-heading-end-regexp - outline-level - outline-minor-mode-cycle - outline-minor-mode-highlight - outline-minor-mode-use-buttons - outline-default-state - outline-default-rules))) - (kill-local-variable 'xref-backend-functions) - (kill-local-variable 'semantic-symref-filepattern-alist) - (when help-xref-stack-item - (push (cons (point) help-xref-stack-item) help-xref-stack) - (setq help-xref-forward-stack nil)) - (when interactive-p - (let ((tail (nthcdr 10 help-xref-stack))) - ;; Truncate the stack. - (if tail (setcdr tail nil)))) - (setq help-xref-stack-item item))) + (let ((stack-item help-xref-stack-item) + (stack help-xref-stack)) + (kill-all-local-variables) + (setq help-xref-stack-item stack-item + help-xref-stack stack) + (when help-xref-stack-item + (push (cons (point) help-xref-stack-item) help-xref-stack) + (setq help-xref-forward-stack nil)) + (when interactive-p + (let ((tail (nthcdr 10 help-xref-stack))) + ;; Truncate the stack. + (if tail (setcdr tail nil)))) + (setq help-xref-stack-item item)))) (defvar help-xref-following nil "Non-nil when following a help cross-reference.") From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 09:11:13 2024 Received: (at 73637) by debbugs.gnu.org; 5 Oct 2024 13:11:13 +0000 Received: from localhost ([127.0.0.1]:37483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx4Yz-0006TH-BU for submit@debbugs.gnu.org; Sat, 05 Oct 2024 09:11:13 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx4Yx-0006T2-2l for 73637@debbugs.gnu.org; Sat, 05 Oct 2024 09:11:12 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2AF2080974; Sat, 5 Oct 2024 09:11:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1728133860; bh=ow9mJSXuhAtQEwugargYcuMEK47P62zJ2q0RrprpEL8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VUqduQ1Di0lY586+qxMBpAMmVmvPPKacTGYcZnX0jAk8KKe/F9f6faWYY8S8XJXG4 aZPWUCLXkHOd9MLi689IOOLW4sLhAv0XbOunIXPBn5fChZZIWlsUry3En7w/gPlHId 7mG2TcambJUy6nyAECCCoVPzk9NxtzcRTKTPLBhH1vj84OY0X7prvySS75WPYrHOs7 fTNraqrd7fp0rikDK53Quu84xb1UHaSdxciwelSEvavyrEdfGhLwestIV88Thc4nRn 6ApxcZgbY9eHq8YiaAPlgLINc5SdhcO9dBJ8Fcg4WRhwX54tpRrjKegA9WKFqRxfhO eS5dEDi3pxqTA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6C536805C5; Sat, 5 Oct 2024 09:11:00 -0400 (EDT) Received: from pastel (unknown [216.154.14.167]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 429061202BB; Sat, 5 Oct 2024 09:11:00 -0400 (EDT) From: Stefan Monnier To: Eshel Yaron Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' In-Reply-To: (Eshel Yaron's message of "Sat, 05 Oct 2024 10:46:06 +0200") Message-ID: References: <86wminvvxz.fsf@gnu.org> Date: Sat, 05 Oct 2024 09:10:59 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.134 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73637 Cc: Eli Zaretskii , 73637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> Stefan, any comments? Looking at the patch from a distance it makes me wonder whether we shouldn't call `kill-all-local-variables` instead? IOW instead of listing all the vars that need to be killed, change to code to preserve the few vars that should not be killed. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 09:33:08 2024 Received: (at 73637) by debbugs.gnu.org; 5 Oct 2024 13:33:08 +0000 Received: from localhost ([127.0.0.1]:37493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx4uC-0007i4-Bb for submit@debbugs.gnu.org; Sat, 05 Oct 2024 09:33:08 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:44670 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx4uA-0007ht-JX for 73637@debbugs.gnu.org; Sat, 05 Oct 2024 09:33:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1728135181; bh=JajI0y9bAiwYnhwd93L2kyvmQXXCM8eHsFjTfsJWoqQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=xL5z4wIGsgtxxvxBuOf0yjIyi0FgmAgHwX0+XNOwd5hveeDW6ECuBPtPw9OYAicvi FYgUvChsbrN3OFBipIQhpSP/QvWRHTC2sN8XIwSKxh9EdWo/La7w3xt7OWbLuLLCgr V5x18FEaeBnma/Ar66U98DjPX+/3zIMOREwvQfViGAeKnc/bk20eIn5mlw9LsOeh83 ZmOqOKB2dScVHLIv7ZLFDf5tn2CqIOj68HLuTY5P4RNk5rkMJVZa8IBuRcjiZv1P6V n85Ax8hcqBZHgR1TjJZMajr7jdkRNERTA4MHBuV0Di/dWuHvpqeThKCO7jDsbfhPe4 M3RYDJSOqkANQ== From: Eshel Yaron To: Stefan Monnier Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' In-Reply-To: (Stefan Monnier via's message of "Sat, 05 Oct 2024 09:10:59 -0400") References: <86wminvvxz.fsf@gnu.org> Date: Sat, 05 Oct 2024 15:32:56 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73637 Cc: Dmitry Gutov , Eli Zaretskii , 73637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > Have you tried going in the other direction? Meaning, killing all locals > by default but keeping the ones that are really needed. > > This is less backward compatible, but ultimately a more predictable and > common design. This seems to work okay here: Stefan Monnier writes: > Looking at the patch from a distance it makes me wonder whether we > shouldn't call `kill-all-local-variables` instead? > IOW instead of listing all the vars that need to be killed, change to > code to preserve the few vars that should not be killed. SGTM, that works too and it's definitely a simpler approach. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 21:34:54 2024 Received: (at 73637-done) by debbugs.gnu.org; 6 Oct 2024 01:34:54 +0000 Received: from localhost ([127.0.0.1]:39763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxGAg-0004IE-3I for submit@debbugs.gnu.org; Sat, 05 Oct 2024 21:34:54 -0400 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]:56625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxGAe-0004I0-Oq for 73637-done@debbugs.gnu.org; Sat, 05 Oct 2024 21:34:53 -0400 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 3F4C7138004F; Sat, 5 Oct 2024 21:34:42 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sat, 05 Oct 2024 21:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1728178482; x=1728264882; bh=7CXDDwDnx4ujbT/57g2glgs9K7d/qtqdZn7LgmM0Wlw=; b= eoS2wXMAsze2KmQlNUtFnbP8Zy9eNMrkBmc3c0e3OhSle/c2aQ8LLZq8pPBvy3gW y+SXdwRMuNiKoJmiMCIb5c8AuTPXFD5l27pTiJ4tPaNya/fe2buGQ/5cN6r5xPIv 3J50Clmsnf2WDxyteIvOlWd83nHm2de4/hEqELV9RkbzDPiELp7zeS6WPXKsn0dW /1nXwksAtBwxq6hoGi3zbPDjQ4a9C7q75JXjxePBoniygbFrPIVxkYbLac2hnrdn 2cLD2z/qVyQOOjxhPfIVh8USgbhJopw+YNikOCklWDQo29L57xtbhNjIFoczC09d 9OlnXs3TO905E40ZxWY+xg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728178482; x= 1728264882; bh=7CXDDwDnx4ujbT/57g2glgs9K7d/qtqdZn7LgmM0Wlw=; b=o f66oB2QHLJ1GjnBh9nI1NrvGAKg+EEzu+QaThqxStx9rNW92ClLNVggksQFxgY/d /iBtZPz1VEu2mZpS+DxS5AkYb2BiSQuxgrEK3xRPsId1zQb6ieXckVB3Q/utRO4G Chk+fYSNkEzVXpmWqgrUgVTqV0rkmze2V9iT3a7XhPOo468xo43NHk8lTnAEGFqU XiHr+/G2/yYBJgVJbCzU3FCGinBG7jB7yW/U2FD7Zd6T4UlaSNq50L56bzBh9mby HUzKueh8bv0poVrlNUp9ISPjVjIzlA11XnBQnFSmX1yA9d4k+o4mDH97DEWNJEJi jysTknHDgk5B2TYH2r/Lg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddviedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmvgesvghshhgvlhihrghroh hnrdgtohhmpdhrtghpthhtohepmhhonhhnihgvrhesihhrohdruhhmohhnthhrvggrlhdr tggrpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepjeefieefje dqughonhgvseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Oct 2024 21:34:40 -0400 (EDT) Message-ID: <53fb6ab2-e733-4c3d-af33-4bd7814090e9@gutov.dev> Date: Sun, 6 Oct 2024 04:34:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' To: Eshel Yaron , Stefan Monnier References: <86wminvvxz.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73637-done Cc: Eli Zaretskii , 73637-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 05/10/2024 16:32, Eshel Yaron wrote: > Dmitry Gutov writes: > >> Have you tried going in the other direction? Meaning, killing all locals >> by default but keeping the ones that are really needed. >> >> This is less backward compatible, but ultimately a more predictable and >> common design. This seems to work okay here: > Stefan Monnier writes: > >> Looking at the patch from a distance it makes me wonder whether we >> shouldn't call `kill-all-local-variables` instead? >> IOW instead of listing all the vars that need to be killed, change to >> code to preserve the few vars that should not be killed. > SGTM, that works too and it's definitely a simpler approach. Great! I've pushed that patch, please report any new regressions. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 06 03:00:14 2024 Received: (at 73637) by debbugs.gnu.org; 6 Oct 2024 07:00:14 +0000 Received: from localhost ([127.0.0.1]:40013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxLFW-0004z1-CW for submit@debbugs.gnu.org; Sun, 06 Oct 2024 03:00:14 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:39481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxLFV-0004xZ-1x for 73637@debbugs.gnu.org; Sun, 06 Oct 2024 03:00:13 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9AABCFF802; Sun, 6 Oct 2024 06:59:59 +0000 (UTC) From: Juri Linkov To: 73637@debbugs.gnu.org Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' In-Reply-To: <53fb6ab2-e733-4c3d-af33-4bd7814090e9@gutov.dev> (Dmitry Gutov's message of "Sun, 6 Oct 2024 04:34:38 +0300") Organization: LINKOV.NET References: <86wminvvxz.fsf@gnu.org> <53fb6ab2-e733-4c3d-af33-4bd7814090e9@gutov.dev> Date: Sun, 06 Oct 2024 09:56:32 +0300 Message-ID: <86set9919z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73637 Cc: dmitry@gutov.dev, me@eshelyaron.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Great! I've pushed that patch, please report any new regressions. Maybe 'help-xref-forward-stack' and 'help-xref-stack-forward-item' should be preserved as well? From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 06 10:41:20 2024 Received: (at 73637) by debbugs.gnu.org; 6 Oct 2024 14:41:21 +0000 Received: from localhost ([127.0.0.1]:41895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxSRk-0005Lk-I4 for submit@debbugs.gnu.org; Sun, 06 Oct 2024 10:41:20 -0400 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]:52301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxSRi-0005LS-5A for 73637@debbugs.gnu.org; Sun, 06 Oct 2024 10:41:19 -0400 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id 7BB2A1380237; Sun, 6 Oct 2024 10:41:06 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sun, 06 Oct 2024 10:41:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1728225666; x=1728312066; bh=oKKlMlUPZ/846q7Ry5P4CwbemDO1EBlepNVrWIaark0=; b= N/81VlmHH39yvqXwmkDG3b3eOfwBcsyuX4Obb9m2mFUzTlVfZMfEe5o6AO9+7GXt QifbK1HOyh3F6Bf8NekcnuE7dfTijFzVdTn9EogeMmhqfFoKKXrQDt3AGOXG5T+h Z6M385I16WzX1/gVMZlCQ6AbtBgxHbbDJ6+waEEOflfXbLPgNWWnEkeGDE/7AoSY W4fpYcLhRv+1tqWrMzAANoq2PcVkmXQLf6AI3pqrxcsICOJkK4/qfiqtlda5uiN4 LbRoXXAIBgXu24/vuAjDAi7PJfQxoITN84uXxErj+6ept4zbEdXzeZyEwtzqYCrA 63R/zDcoU7GdHpLKP8umfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728225666; x= 1728312066; bh=oKKlMlUPZ/846q7Ry5P4CwbemDO1EBlepNVrWIaark0=; b=a OUWJQ9ppPfgvPc4U8USaFPgPkpe8H3ztRMWjx7v/2cpT3SywBoNDNyNzehiP+yh/ 3DoVZnGztATM/qBd1bLd/xFDfiiuyYJQzrownDF36BwAHqd4ZeAyGdurEiHwtRaH p75Fym48PFlq6FHPcdXTuhHwBzmJaZa5oqDIBcF/SBOgK/RrvX8hAzcsYZ+GHfap Zq3bXsL9U/UtmsrSgI10y34ePSIOmn9EaYB1HPv6pUJwbeTzyP84hd94bhaPxw4r bxOGHW2O5Ov63JCWWsU+Oh4gBOYeTb7RYgUmzWhRsOEjWLG9StbD2Zcj3Syg5DD7 SVHZjgra5vAqZncHIHdjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvjedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjuhhriheslhhinhhkohhvrd hnvghtpdhrtghpthhtohepjeefieefjeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgt phhtthhopehmvgesvghshhgvlhihrghrohhnrdgtohhm X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 6 Oct 2024 10:41:05 -0400 (EDT) Message-ID: Date: Sun, 6 Oct 2024 17:41:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' To: Juri Linkov , 73637@debbugs.gnu.org References: <86wminvvxz.fsf@gnu.org> <53fb6ab2-e733-4c3d-af33-4bd7814090e9@gutov.dev> <86set9919z.fsf@mail.linkov.net> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86set9919z.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73637 Cc: me@eshelyaron.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 06/10/2024 09:56, Juri Linkov wrote: >> Great! I've pushed that patch, please report any new regressions. > Maybe 'help-xref-forward-stack' and 'help-xref-stack-forward-item' > should be preserved as well? Good question - looks like both of these vars are marked as 'permanent-local' already. And the ones I set up to be restored are too. This suggests a further simplification, pushed to master now: diff --git a/lisp/help-mode.el b/lisp/help-mode.el index a44749d1fe9..4ee4f4156a1 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -505,19 +505,15 @@ 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) - (let ((stack-item help-xref-stack-item) - (stack help-xref-stack)) - (kill-all-local-variables) - (setq help-xref-stack-item stack-item - help-xref-stack stack) - (when help-xref-stack-item - (push (cons (point) help-xref-stack-item) help-xref-stack) - (setq help-xref-forward-stack nil)) - (when interactive-p - (let ((tail (nthcdr 10 help-xref-stack))) - ;; Truncate the stack. - (if tail (setcdr tail nil)))) - (setq help-xref-stack-item item)))) + (kill-all-local-variables) + (when help-xref-stack-item + (push (cons (point) help-xref-stack-item) help-xref-stack) + (setq help-xref-forward-stack nil)) + (when interactive-p + (let ((tail (nthcdr 10 help-xref-stack))) + ;; Truncate the stack. + (if tail (setcdr tail nil)))) + (setq help-xref-stack-item item))) (defvar help-xref-following nil "Non-nil when following a help cross-reference.") From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 07 22:54:04 2024 Received: (at 73637) by debbugs.gnu.org; 8 Oct 2024 02:54:04 +0000 Received: from localhost ([127.0.0.1]:49911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy0MN-00065Z-Ry for submit@debbugs.gnu.org; Mon, 07 Oct 2024 22:54:04 -0400 Received: from mail-108-mta73.mxroute.com ([136.175.108.73]:41063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy0ML-000657-Aj for 73637@debbugs.gnu.org; Mon, 07 Oct 2024 22:54:02 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta73.mxroute.com (ZoneMTA) with ESMTPSA id 1926a0bdf610003e01.001 for <73637@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 08 Oct 2024 02:53:35 +0000 X-Zone-Loop: d72fb7a3584642b997ead7094e0a534acf636a25ca43 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QORK/BM4wxpYplYmSoih6e2Xe9kqzoC4Jnb+/YbBnGY=; b=m+0krxl4RWgVq224SG+lIhtWeZ JUfjUAAI04RvIFrB3jZ+hUpI1kDY1JKz8yW7S/wf1u1Wf/KeGJQXWw1mgbPuf61dnXPJ4HGZhwggy dpmTKmYHj7XmTe9NEm7l4uVq7DBjLMNgSr9na74t0ZlNrBy+mUU99dLOe+sup6x5Rn/YZE0UIjivB gjA1VvVjivxSDLJXqlDBhXKAmQ3QKP6bp7xD4p4xSW8TrB4pjPSadsjjIbiEhkEefB3jhZo9pZiFs GzgkekPSZV7G9eObssxao5SysMY2umu1fuxF50gS6bq/4pGRj3tGDlizUHFnqo4Js2Wfrw5HrOB9O CK5iRDaA==; From: "J.P." To: Dmitry Gutov Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' In-Reply-To: (Dmitry Gutov's message of "Sun, 6 Oct 2024 17:41:02 +0300") References: <86wminvvxz.fsf@gnu.org> <53fb6ab2-e733-4c3d-af33-4bd7814090e9@gutov.dev> <86set9919z.fsf@mail.linkov.net> Date: Mon, 07 Oct 2024 19:53:33 -0700 Message-ID: <87v7y371aq.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73637 Cc: me@eshelyaron.com, 73637@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi people, Dmitry Gutov writes: > On 06/10/2024 09:56, Juri Linkov wrote: >>> Great! I've pushed that patch, please report any new regressions. >> Maybe 'help-xref-forward-stack' and 'help-xref-stack-forward-item' >> should be preserved as well? > > Good question - looks like both of these vars are marked as > 'permanent-local' already. And the ones I set up to be restored are too. > > This suggests a further simplification, pushed to master now: > > > (defvar help-xref-following nil > "Non-nil when following a help cross-reference.") Just linking to a possibly related bug: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from describe-face via erc-nicks-list-face Thanks, J.P. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 17:17:24 2024 Received: (at 73637) by debbugs.gnu.org; 8 Oct 2024 21:17:24 +0000 Received: from localhost ([127.0.0.1]:54699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syHa8-00076G-9z for submit@debbugs.gnu.org; Tue, 08 Oct 2024 17:17:24 -0400 Received: from mail-108-mta199.mxroute.com ([136.175.108.199]:33415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syHa5-000767-21 for 73637@debbugs.gnu.org; Tue, 08 Oct 2024 17:17:23 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta199.mxroute.com (ZoneMTA) with ESMTPSA id 1926dfe13060003e01.001 for <73637@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 08 Oct 2024 21:17:00 +0000 X-Zone-Loop: de2be2b6bb7fc48701d413664e3e2ee10c6fccc68705 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=O85p52zEz9GXSsto25cvcMg9JTMzn9YTfI3OvuMwE4k=; b=IN4b18B6gd4AOcIwbfLq+2+EA2 LlSZewEEjTzLd0IGe3AgHQ85d0gx3a/LyFfdkOVMaoir9CWneAvJ8+uHfPYmrLu67lH+iOOwwVI3q M6YgGBDQ8mXTohHAF7nBc/OqGMGbM/rMEw8me3on6sROEFKvtsLegykP49cw73eBxpffF1nHQkScx PQeg0rAVk2hAm+Ka6Fs5HKM9qLWsqx4+750SLqKLbGmveVSvrvJhgrmflPUCbvVp/WUWZpzjUN+5O /JXHbPdGQgFTk3LUIiLr+5Fd587hYO7CWrTIvmQX3RUpp3GtixBfwF7dgB/ETXkEXgouHRNuwTJ5T bw2oIJrg==; From: "J.P." To: Dmitry Gutov Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook' In-Reply-To: <87v7y371aq.fsf@neverwas.me> (J. P.'s message of "Mon, 07 Oct 2024 19:53:33 -0700") References: <86wminvvxz.fsf@gnu.org> <53fb6ab2-e733-4c3d-af33-4bd7814090e9@gutov.dev> <86set9919z.fsf@mail.linkov.net> <87v7y371aq.fsf@neverwas.me> Date: Tue, 08 Oct 2024 14:16:57 -0700 Message-ID: <87ed4q1eie.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73637 Cc: me@eshelyaron.com, 73637@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "J.P." writes: > Just linking to a possibly related bug: > > bug#73686: 31.0.50; ERC 5.6.1-git: > back button gone from describe-face via erc-nicks-list-face Looking into this a bit, I'm now pretty convinced this change introduced a regression involving non-default names for help buffers. Details here: https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-10/msg00385.html From unknown Sat Jun 21 08:54:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 06 Nov 2024 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator