unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: `M-.' can't skip to the corresponding DEFUN from within the Apropos buffer.
Date: Tue, 6 Jul 2021 08:19:06 +0800	[thread overview]
Message-ID: <CAGP6POJzyjW3eLQst24BrsQ4J7bG0MqPbri5YyK50pCK5FjrMw@mail.gmail.com> (raw)
In-Reply-To: <CAGP6POLPRV5N-rcLvN0F2uKkfj_yKaskNUdtoetA6kdyiF37JQ@mail.gmail.com>

On Tue, Jul 6, 2021 at 8:09 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Tue, Jul 6, 2021 at 8:02 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> >
> > On Tue, Jul 6, 2021 at 5:27 AM Daniel Martín <mardani29@yahoo.es> wrote:
> > >
> > > 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)))
> > >
> >
> > The built-in help document says:
> >
> > ```
> > (add-hook HOOK FUNCTION &optional DEPTH LOCAL)
> >
> > [...]
> > The place where the function is added depends on the DEPTH
> > parameter.  DEPTH defaults to 0.  By convention, it should be
> > a number between -100 and 100 where 100 means that the function
> > should be at the very end of the list, whereas -100 means that
> > the function should always come first.
> > Since nothing is "always" true, don’t use 100 nor -100.
> > When two functions have the same depth, the new one gets added after the
> > old one if depth is strictly positive and before otherwise.
> >
> > For backward compatibility reasons, a symbol other than nil is
> > interpreted as a DEPTH of 90.
> > ```
> >
> > Here, you set DEPTH to nil. I'm not sure if your usage is equivalent
> > to the following?
> >
> >   (add-hook 'apropos-mode-hook
> >            (lambda ()
> >              (add-hook 'xref-backend-functions
> >                        #'elisp--xref-backend 0 t)))
> >
>
> Based on my tries, passing nil or 0 as the third argument is
> equivalent. Thank you again.
>

For this case, according to my understanding, the 3rd argument used
here is just as a placeholder.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



  reply	other threads:[~2021-07-06  0:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04  3:40 `M-.' can't skip to the corresponding DEFUN from within the Apropos buffer Hongyi Zhao
2021-07-04 17:24 ` Daniel Martín
2021-07-05  2:44   ` Hongyi Zhao
2021-07-05 21:26     ` Daniel Martín
2021-07-06  0:02       ` Hongyi Zhao
2021-07-06  0:09         ` Hongyi Zhao
2021-07-06  0:19           ` Hongyi Zhao [this message]
2021-07-06  0:29             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-06  0:46               ` Hongyi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGP6POJzyjW3eLQst24BrsQ4J7bG0MqPbri5YyK50pCK5FjrMw@mail.gmail.com \
    --to=hongyi.zhao@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).