GNU bug report logs - #73637
[PATCH] New hook 'help-setup-hook'

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Sat, 5 Oct 2024 07:18:02 UTC

Severity: normal

Tags: patch

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eshel Yaron <me <at> eshelyaron.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 73637 <at> debbugs.gnu.org
Subject: Re: bug#73637: [PATCH] New hook 'help-setup-hook'
Date: Sat, 05 Oct 2024 10:40:56 +0300
> 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" <bug-gnu-emacs <at> gnu.org>

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.




This bug report was last modified 226 days ago.

Previous Next


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