From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: `M-.' can't skip to the corresponding DEFUN from within the Apropos buffer. Date: Tue, 6 Jul 2021 08:09:20 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32395"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: =?UTF-8?Q?Daniel_Mart=C3=ADn?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 06 02:09:56 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0Yey-0008ED-3B for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 06 Jul 2021 02:09:56 +0200 Original-Received: from localhost ([::1]:53754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0Yew-0000B3-6U for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 20:09:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0Yed-0000Au-DF for help-gnu-emacs@gnu.org; Mon, 05 Jul 2021 20:09:35 -0400 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:38703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0Yeb-00014E-Nj for help-gnu-emacs@gnu.org; Mon, 05 Jul 2021 20:09:35 -0400 Original-Received: by mail-lf1-x136.google.com with SMTP id p16so7673871lfc.5 for ; Mon, 05 Jul 2021 17:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=CtksitRbpNM4IoOGabuEi7Xef26ouG9lNfhvWoI5YOQ=; b=SVIfA6Nd7Avyio56RDRsXTfM5eMUfw67XQjdEuOCN1HL5E5IylMTqsYNoxcTDQ1i0k /+ac7Iy5hiF8xRCGCpZhBbeKzkf4YwZ+xVLMSQ+ZbKbMBfd0IslDavJK1EYqtZYwv5pV CXN7rw/FIy8lRwBoRzgkeacj4R/IXP/ayf3Jsn2F98zOmGzVAuU2prAM+ZKm8n39c6Gy mHeDfHlTeoo+dOq6EGiL6PQ9PmOCa1ue7ErxR0VOlIG2YQhk0tnBajieP+vGNB406UX+ iYgItzUScYBUnnAVL29pqVVCY8uOj9Z2F7cCHlbRbfi3MkiOAZM8XO04MFHpv6P4oFAC 65bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=CtksitRbpNM4IoOGabuEi7Xef26ouG9lNfhvWoI5YOQ=; b=IQvj+umUx59exrk8I7Xx9KAm3JWYA/l0ZYidVgE/v20cEe0i4Xb3psitWJGp1aJeFr NkvgbI0IkqWL5hnldz2PYHMsm9bIgaGFej8TSubGNNK03+zFkA5a+9TOx3ul8whitxlv ypLxijtlvM07k0fvL3dtWimlIugjPMIFCx90lkgLbHkUUGyyHecyqRJr8mlfi7ac/LIF 1ge4TTdfWdxpbDAHk7Zy2RRAFYqh/1gFrDmEL+jvSMRahwgYpOx/grcpjHi2ovt0eorr HO0XBZRtbCE7iKEod2DRMLoFFkX6s+NHlt6m1jo2/s9jV7quTWbOcOdPZ4skdJ2Sd7Da 6Q9A== X-Gm-Message-State: AOAM533i6KgISeCQoSsIn2wCxYL3QIwNYJLlV89WBoY4JJnBsyUN2yvz G5qDgMzd0XDRbhIxfWcXnIGNfO8f5KSKyvoMYUM= X-Google-Smtp-Source: ABdhPJyDNP9kWJvtZmJics7ueiSK2ERAuK4quQe5bcLtqx0/9xzhusUtZiFRwY3lGHiRhol/Q83Sa6bJsjsxosurQg0= X-Received: by 2002:ac2:4288:: with SMTP id m8mr12105921lfh.461.1625530171753; Mon, 05 Jul 2021 17:09:31 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x136.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131514 Archived-At: On Tue, Jul 6, 2021 at 8:02 AM Hongyi Zhao wrote: > > On Tue, Jul 6, 2021 at 5:27 AM Daniel Mart=C3=ADn wr= ote: > > > > Hongyi Zhao writes: > > > > >> > > >> - Create a buffer-local binding for xref-backend-functions in Apropo= s > > >> 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/Creatin= g-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=E2=80=99t 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. HY --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China