From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Bad moves with xref-find-definitions Date: Sat, 25 Apr 2015 23:34:36 -0400 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 X-Trace: ger.gmane.org 1430019898 21528 80.91.229.3 (26 Apr 2015 03:44:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Apr 2015 03:44:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 26 05:44:48 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 1YmDUs-0002bl-42 for ged-emacs-devel@m.gmane.org; Sun, 26 Apr 2015 05:44:46 +0200 Original-Received: from localhost ([::1]:49810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDUq-00006F-GC for ged-emacs-devel@m.gmane.org; Sat, 25 Apr 2015 23:44:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDUX-0008Vd-JU for emacs-devel@gnu.org; Sat, 25 Apr 2015 23:44:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmDL7-0004FL-8P for emacs-devel@gnu.org; Sat, 25 Apr 2015 23:34:46 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:47388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDL7-0004Ep-23 for emacs-devel@gnu.org; Sat, 25 Apr 2015 23:34:41 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t3Q3Ya7j007576; Sat, 25 Apr 2015 23:34:37 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B7FC62CD4; Sat, 25 Apr 2015 23:34:36 -0400 (EDT) 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 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5287=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5287> : inlines <2795> : streams <1428690> : uri <1915875> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:185900 Archived-At: > That's a bit besides the point. I want my interface to behave exactly > the same independently of the context at point. You're talking here about the fact that M-. will prompt if there's no "thing at point"? We could make it signal an error, indeed. > And, most importantly, I don't want to foster bad habits because my > brain always chooses the easy path - navigate to a symbol instead of > C-u. Thing is: the two are different. In some languages, figuring out "the thing at point" may itself not be obvious and even finding a human-palatable textual representation of "the thing at point" may turn out to be extra work. So M-. really means "pass the current buffer position to the backend and let it figure out what are the possible corresponding definitions". Whereas C-u M-. asks the user for a textual representation of some definition, and then tries to find matching definitions. Of course, we could make the "empty minibuffer" mean "use the current buffer position", but it seems cleaner to short-circuit the minibuffer so we don't have to use a special string for it. > Such changes should be broadly discussed. Somewhat surprisingly the > thread that started the generalization [1] hasn't touched the issues > that I have raised. We did discuss those UI issues. You're not the first to bring it up. I personally don't think it's such a major change. > As to my 2nd original point. I think the exclusive approach of tags *or* > dynamic completion is not the correct one. There should be a way to > merge tag candidates with dynamic candidates. In theory at least there is (as Dmitry points out) by having the major modes change the variable via `add-function' using :around or something like that. I haven't tried doing so, so I don't know if it turns out to be easy to do that. If it's not, then I'd welcome a patch that makes it easier. But if you want to override the major mode to use etags, you probably want to use xref-etags-mode. > Having C/C++ api interface to higher order languages is a commonality > rather than an exception nowadays. I do not understand what you're trying to say here (more specifically, I can't see how this relates to the discussion). Stefan