From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Bad moves with xref-find-definitions Date: Sun, 26 Apr 2015 02:50:51 +0300 Message-ID: <553C285B.4070400@yandex.ru> References: <87h9s6c27z.fsf@gmail.com> <87zj5wnlyt.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1430005887 30975 80.91.229.3 (25 Apr 2015 23:51:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Apr 2015 23:51:27 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: joaotavora@gmail.com (João Távora), Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 26 01:51:14 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ym9qr-00053k-Md for ged-emacs-devel@m.gmane.org; Sun, 26 Apr 2015 01:51:13 +0200 Original-Received: from localhost ([::1]:49528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym9qq-0002RD-VY for ged-emacs-devel@m.gmane.org; Sat, 25 Apr 2015 19:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym9qm-0002Qx-QA for emacs-devel@gnu.org; Sat, 25 Apr 2015 19:51:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym9qi-00057Y-PZ for emacs-devel@gnu.org; Sat, 25 Apr 2015 19:51:08 -0400 Original-Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:36568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym9qi-00053Y-IE for emacs-devel@gnu.org; Sat, 25 Apr 2015 19:51:04 -0400 Original-Received: by wizk4 with SMTP id k4so60572504wiz.1 for ; Sat, 25 Apr 2015 16:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7ywiaQ9G1SaJq7tIwj5UeS9q3HPcOf52dMnSte43kqY=; b=QG+dH6BzMktfBGBvkGO6d/S4o9YJ5o6L27EF8WJVsivSJ7T+ZA19M6lGk8tuZGB0p7 huQl1X3nbiuNjenHX7muULw15j6BbZHHwb3CujVljK0X9jugliiMchGrVP+U67RsKF+F HT/caQqPkk6HURha+09WzGlLrj5AW7bu9nkMD3jCJl2u3UAw0rmLX1sAARpHxpCRNxqb N6/sbm8511V2LNX49aS2ZqLiRWXq808yK+r5ylbPI1yx/HkVqflEF7xglF8PhvkrovXJ poE5O75bRecxhPe3gqd8sfOH6n1FHxF8tskijzkgDK92mySrb4O9WTpjaJYSae6HosER cOMw== X-Received: by 10.194.61.171 with SMTP id q11mr9515838wjr.110.1430005855051; Sat, 25 Apr 2015 16:50:55 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id y7sm8883116wjw.16.2015.04.25.16.50.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Apr 2015 16:50:54 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185896 Archived-At: On 04/25/2015 09:56 PM, joaotavora@gmail.com (João Távora) wrote: > While we're on the subject, is a patch welcome to set > `xref-find-function' to `elisp-xref-find' more pervasively in the > apropos, debugger and help buffers? I'm fine with that, but the effect will also make it harder for Eli to undo that change. :) Dunno how important that is. See http://debbugs.gnu.org/19466. > The patch attached does this to a certain degree, but takes some care to > not do this is the major mode's definitions, since in theory these modes > could be used for something other than emacs-lisp. Makes sense. > On the other hand, should we care? Currently, M-. in the *Help* buffer > always prompts to find a tag, which is less useful (if not useless) than > having it try to navigate to an elisp symbol definition. If you run 'make tags', it'll create lisp/TAGS linked with src/TAGS, the former containing the core Lisp definitions. Though not any third-party ones. > diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el > index ce5c786..7585215 100644 > --- a/lisp/emacs-lisp/debug.el > +++ b/lisp/emacs-lisp/debug.el > @@ -338,7 +338,8 @@ That buffer should be current already." > (with-current-buffer (car tem) > (point)))) > (pop tem)))) > - (debugger-make-xrefs)) > + (debugger-make-xrefs) > + (setq-local xref-find-function #'elisp-xref-find)) Both this and the other places should probably set xref-identifier-completion-table-function as well. You could extract those three lines from emacs-lisp-mode. > +(advice-add 'describe-mode :after #'help--setup-xref-find-function) > +(advice-add 'describe-function :after #'help--setup-xref-find-function) > +(advice-add 'describe-variable :after #'help--setup-xref-find-function) > +(advice-add 'describe-bindings :after #'help--setup-xref-find-function) Why not add the call to the command definitions directly?