help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `M-.' can't skip to the corresponding DEFUN from within the Apropos


From: Daniel Martín
Subject: Re: `M-.' can't skip to the corresponding DEFUN from within the Apropos buffer.
Date: Mon, 05 Jul 2021 23:26:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

>>
>> - Create a buffer-local binding for xref-backend-functions in Apropos
>>   buffers where you prepend elisp--xref-backend to the list.
>>
>
> I've read some relevant document [1], but still can't figure out how
> to set this feature in my initialization file.
>
> [1] 
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Buffer_002dLocal.html
>

You could add something like

(add-hook 'apropos-mode-hook
          (lambda ()
            (add-hook 'xref-backend-functions
                      #'elisp--xref-backend nil t)))

apropos-mode-hook is the hook that is invoked when apropos-mode is
turned on.  Notice that I pass t as the fourth argument to add-hook;
that says to modify the buffer-local value of xref-backend-functions,
not the global value.  As the code is evaluated when apropos-mode is
turned on, the current buffer will be the Apropos buffer and the change
will only have an effect on that buffer.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]