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 21:41:47 +0300 Message-ID: <553D316B.5050802@yandex.ru> References: <87h9s6c27z.fsf@gmail.com> <87zj5wnlyt.fsf@gmail.com> <553BE6F2.4030604@yandex.ru> <87fv7ondlr.fsf@gmail.com> <553C5D75.9060706@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1430073754 13346 80.91.229.3 (26 Apr 2015 18:42:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Apr 2015 18:42:34 +0000 (UTC) Cc: Vitalie Spinu , Stefan Monnier , emacs-devel To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 26 20:42:30 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 1YmRVa-00057x-1X for ged-emacs-devel@m.gmane.org; Sun, 26 Apr 2015 20:42:26 +0200 Original-Received: from localhost ([::1]:51760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmRVZ-0007Sq-8P for ged-emacs-devel@m.gmane.org; Sun, 26 Apr 2015 14:42:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmRVM-0007Og-Oz for emacs-devel@gnu.org; Sun, 26 Apr 2015 14:42:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmRVG-0004e1-7f for emacs-devel@gnu.org; Sun, 26 Apr 2015 14:42:12 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:33129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmRVG-0004cU-1E for emacs-devel@gnu.org; Sun, 26 Apr 2015 14:42:06 -0400 Original-Received: by wiax7 with SMTP id x7so68935705wia.0 for ; Sun, 26 Apr 2015 11:41: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=RBDbPO79FBQ4f6EU3oNDhR7EQ8uO9YnbRL1tq9uf5iw=; b=Ky0AWJFNMtw3Mv1y/ihkuqlkuFLprAKIDNIqET0VjKsjXVCEnAAn93Hq95FtK0goQM xbMLYRQdlaIIbWHsAxLRxzGqEJLtS5jsc1V5gk1Ac6AAOAjgZidd8/D1AEyZ2PMJuc3U Q/4rU5wO5IOnYh7vls2ioHJNdgxHlf+dBShMl0l1gkK5do6dyNFM6pOG1GbS1Z077Zfx S2ZylP/I5y962ji5nTkh0jF+3yv6AtV7BWVN8UYUGxZnQVxG+oxDJ/6oWgujY1H0TnBu 4W20NmQMgQiMUWURqNn/BN/ygZSReQlZek7EHAYPx4wo0TqaoR/yi4TLKTGVvMeOUcVR Oo+g== X-Received: by 10.180.208.99 with SMTP id md3mr14330320wic.34.1430073715353; Sun, 26 Apr 2015 11:41:55 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id az2sm26109722wjb.4.2015.04.26.11.41.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Apr 2015 11:41:55 -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::236 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:185920 Archived-At: On 04/26/2015 09:38 AM, Bozhidar Batsov wrote: > * find some suitable place to invoke a command (e.g. move their cursor > to a symbol or to an empty place in the buffer) > * start wondering what prefix to prepend to the command to alter its > behaviour "Press C-u to explicitly enter something" is a pretty common Emacs pattern. If all modes use the xref interface, it'll become even less of a problem. But on the subject of "what prefix", I think you've made a mistake using `C-u' for "show in the other window". Emacs normally uses `C-x 4' for that, which is only one keypress longer. The users who prefer the "other window" behavior can simply switch the bindings. > While I think that for navigating sources acting on the thing at point > probably makes more sense, It can also be beneficial in other ways. Like I've described in another thread, if you're reading a function, say, for the first time and are trying to trace its control flow, moving point to the symbol before `M-.' means you'll immediately know where you "came from" after pressing `M-,'. > when writing code (meaning you'll need to do > some doc lookups) you're often wondering "What was the behavior of this > function?" or "What were I supposed to use here?" and it's unlikely that > the thing at point will help you much (unless you're simply reading code). Which function? Where's the set of functions you're choosing from? If the function name is not at point, I'm guessing it's just not typed out fully. In that case, you'll probably delegate to the "find doc" or the "find sources" function of the completion interface you're using. In `completion-at-point''s case, you'll probably first complete the name fully and then jump to it. However, using xref-find-apropos is not out of the question either. > The global config, as implemented now in CIDER ,has the disadvantage of > insufficient granularity - e.g. I'd like to always jump to the source of > thing at point, but I wouldn't like for other commands to behave like > this. The settings granularity shouldn't be that much a problem: introduce another possible value for cider-prompt-for-symbol, which will be a list of commands for which to always prompt. > But as the config option controls all similar commands, all of > them behave in the same way - either acting on the thing at point or > always prompting for confirmation. The key question is which set of commands the variable can affect at all. For me, "jump to", "show references" and "show doc", all should use the contents at point by default. > Maybe two sets of matching commands per each such operation or something > (although handy keybindings are always in short supply). Probably not: being able to press `C-u' together with a per-command user option should be enough for everyone.