From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: Bad moves with xref-find-definitions Date: Sat, 25 Apr 2015 19:56:39 +0100 Message-ID: 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 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1429989063 17478 80.91.229.3 (25 Apr 2015 19:11:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Apr 2015 19:11:03 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 25 21:10:55 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 1Ym5TZ-0007uX-Fb for ged-emacs-devel@m.gmane.org; Sat, 25 Apr 2015 21:10:54 +0200 Original-Received: from localhost ([::1]:49186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym5TY-0008Eb-ND for ged-emacs-devel@m.gmane.org; Sat, 25 Apr 2015 15:10:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym5Ss-000835-Ls for emacs-devel@gnu.org; Sat, 25 Apr 2015 15:10:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym5Fs-0004jt-F1 for emacs-devel@gnu.org; Sat, 25 Apr 2015 14:56:47 -0400 Original-Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:34813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym5Fs-0004jh-8l for emacs-devel@gnu.org; Sat, 25 Apr 2015 14:56:44 -0400 Original-Received: by wgso17 with SMTP id o17so79960283wgs.1 for ; Sat, 25 Apr 2015 11:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=7X2DVmguyaSII6vel6+vuXTUyZTfXzmzVzcCX/nG+y8=; b=xc4xwQUnB/kKdo0E+C8Ro8bkV8nxGeIVi5LWa7bCknkGVE9fBR6XjG/YchnGilAGp/ /4Qy3h4E2A1eps/B8wLndegvoxpAPEXDrjpRNKBAFv+imlG4w68wWp8qeVmcxPw2tFwS 1mm8UHNquPT+Ebj5GYUzUe7lXIdcOZEKhvE+wG23stEk7U2FasBP+Hx2wlHsXeG6JkEp HSkxWSntV26SLK3LxggplnctZEFVJLR4h/1ghRK35hF9HJMi/8X3VP/8QWZ/2cW3SwR4 6isAUuyNdeRE3ZNlsz27vlcntX33g8kghgPKRVM6zY9Apn2tXaD2tIvzp7+4bJ/h3kai hyCQ== X-Received: by 10.180.104.4 with SMTP id ga4mr7268226wib.86.1429988203219; Sat, 25 Apr 2015 11:56:43 -0700 (PDT) Original-Received: from king.yourcompany.com (31.57.37.188.rev.vodafone.pt. [188.37.57.31]) by mx.google.com with ESMTPSA id dl2sm4347433wib.2.2015.04.25.11.56.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Apr 2015 11:56:42 -0700 (PDT) In-Reply-To: <87zj5wnlyt.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 25 Apr 2015 19:42:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::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:185888 Archived-At: On Sat, Apr 25, 2015 at 6:42 PM, Vitalie Spinu wrote: > C-u is an awkward solution. You always have to think before the actual > key press.=20 You don't have to really. If you make a mistake,press M-, to get back.=20 I used to feel like you and then quickly got used to the new behaviour.=20 The speed up really is worth it.=20 > So please. Could you please bring the standard Emacs UI back? Please don't. Or at least make it customizable. If you do, I vote to keep the current behaviour the default. 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? 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. 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. Thanks, Jo=C3=A3o diff --git a/lisp/apropos.el b/lisp/apropos.el index 023ba4b..b91c77a 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -1140,8 +1140,9 @@ If non-nil, TEXT is a string that will be printed as = a heading." (apropos-print-doc 6 'apropos-face t) (apropos-print-doc 5 'apropos-widget t) (apropos-print-doc 4 'apropos-plist nil)) - (set (make-local-variable 'truncate-partial-width-windows) t) - (set (make-local-variable 'truncate-lines) t)))) + (setq-local truncate-partial-width-windows t) + (setq-local truncate-lines t) + (setq-local xref-find-function #'elisp-xref-find)))) (prog1 apropos-accumulator (setq apropos-accumulator ()))) ; permit gc =20 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)) =20 (defun debugger-make-xrefs (&optional buffer) "Attach cross-references to function names in the `*Backtrace*' buffer." diff --git a/lisp/help.el b/lisp/help.el index fb1719a..3980f21 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1346,6 +1346,15 @@ the help window if the current value of the user opt= ion (with-output-to-temp-buffer " *Char Help*" (princ msg))))) =20 +(defun help--setup-xref-find-function (&rest _args) + (with-current-buffer (help-buffer) + (setq-local xref-find-function #'elisp-xref-find))) + +(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) + ;; The following functions used to be in help-fns.el, which is not preload= ed. ;; But for various reasons, they are more widely needed, so they were