all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bozhidar Batsov <bozhidar@batsov.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Vitalie Spinu <spinuvit@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Bad moves with xref-find-definitions
Date: Sun, 26 Apr 2015 09:38:06 +0300	[thread overview]
Message-ID: <CAM9Zgm1PCoDnUE3Bk=kbP=NSU5fqrWsQEx+6=ny2NN7ryHkGYg@mail.gmail.com> (raw)
In-Reply-To: <553C5D75.9060706@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 3229 bytes --]

Let me join this discussion. As the maintainer of CIDER, I had to
participate into a much longer debate about the merits of both styles on
the CIDER issue tracker and feel I can share a thought or two.

I believe that the fundamental problem we face is that finding something is
not the same as acting on the thing at point. When you opt to immediately
act on the symbol/file/etc on point you're forcing the users to do one of
two things:

* 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

While I think that for navigating sources acting on the thing at point
probably makes more sense, 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).

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.
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.

Clearly I can roll out any custom solution that suits my needs (we're in
Emacs after all), but I feel we have a deeper usability problem in Emacs in
general and it'd be nice if we could come to some universal solution. Maybe
two sets of matching commands per each such operation or something
(although handy keybindings are always in short supply).

As to whether SLIME's behaviour is preferable to Emacs's - as usual that's
super subjective.

Btw, the idea of having standard behaviour in major modes for finding
definitions, usages & documentation is not bad at all.

On 26 April 2015 at 06:37, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 04/25/2015 11:43 PM, Vitalie Spinu wrote:
>
>  It probably should be generic such that other "finding" or "jumping"
>> functionality can reuse it (prompt-before-jump, auto-jump).
>>
>
> Maybe the rule could be whether the command is almost always related to
> the current buffer's contents.
>
> `describe-function' and friends I would actually consider to be
> counter-examples, because they only work with Elisp.
>
> And similarly how certain other people are attached to etags, I'd always
> want to have access to Elisp documentation and sources, even when editing
> unrelated code in another language.
>
> Hence I think we need a separate, generalizable command and binding that
> would work with different modes and depend on the current language or
> project. That one could work like SLIME's `C-c C-d C-d'.
>
>  The problem is of course that "find-file" is also a "finding" behavior,
>> for which you unlikely to want this behavior. So it's difficult to draw
>> a line on what are these commands.
>>
>
> Let's stop at xref, for now.
>
>  More specific name like xref-auto-jump seems quite suggestive to me.
>>
>
> How about `xref-prompt-for-identifier', to mirror CIDER's option name?
>
>

[-- Attachment #2: Type: text/html, Size: 4329 bytes --]

  reply	other threads:[~2015-04-26  6:38 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 15:07 Bad moves with xref-find-definitions Vitalie Spinu
2015-04-25 14:24 ` Stefan Monnier
2015-04-25 16:25   ` Dmitry Gutov
2015-04-25 17:42   ` Vitalie Spinu
2015-04-25 18:49     ` Vitalie Spinu
2015-04-25 19:07       ` Dmitry Gutov
2015-04-25 18:56     ` João Távora
2015-04-25 23:50       ` Dmitry Gutov
2015-04-26 11:51         ` xref backends for elisp-related modes Was: " João Távora
2015-04-26 13:56           ` Dmitry Gutov
2015-04-26 14:51           ` Eli Zaretskii
2015-04-28 11:06             ` Vitalie Spinu
2015-04-28 11:41               ` João Távora
2015-04-28 11:59                 ` Vitalie Spinu
2015-04-28 15:17                   ` Eli Zaretskii
2015-04-28 15:45                     ` Vitalie Spinu
2015-04-28 16:01                       ` Eli Zaretskii
2015-04-28 13:27                 ` Stefan Monnier
2015-04-28 21:28                   ` Dmitry Gutov
2015-04-29 12:35                     ` Vitalie Spinu
2015-04-29 15:45                     ` Eli Zaretskii
2015-04-28 15:15               ` Eli Zaretskii
2015-04-28 15:47                 ` Vitalie Spinu
2015-04-28 16:03                   ` Eli Zaretskii
2015-04-29  6:55               ` Helmut Eller
2015-04-29 12:40                 ` Vitalie Spinu
2015-04-29 13:01                   ` Helmut Eller
2015-04-29 15:30                     ` Vitalie Spinu
2015-04-29 17:09                       ` Dmitry Gutov
2015-04-29 12:47                 ` Dmitry Gutov
2015-04-29 13:04                   ` Helmut Eller
2015-04-29 13:12                     ` Dmitry Gutov
2015-04-27  2:20           ` Stefan Monnier
2015-04-25 19:11     ` Dmitry Gutov
2015-04-25 20:43       ` Vitalie Spinu
2015-04-26  3:37         ` Dmitry Gutov
2015-04-26  6:38           ` Bozhidar Batsov [this message]
2015-04-26 18:41             ` Dmitry Gutov
2015-04-27 19:36               ` Bozhidar Batsov
2015-04-28  1:23                 ` Dmitry Gutov
2015-04-28 11:30               ` Vitalie Spinu
2015-04-26 10:44           ` Vitalie Spinu
2015-04-26 13:14             ` Vitalie Spinu
2015-04-26 15:09             ` Dmitry Gutov
2015-04-26 16:23               ` Vitalie Spinu
2015-04-26 17:51                 ` Dmitry Gutov
2015-04-26 20:56                   ` Vitalie Spinu
2015-04-27 21:57                     ` Dmitry Gutov
2015-04-26  3:34     ` Stefan Monnier
2015-04-26 11:31       ` Vitalie Spinu
2015-04-26 14:50         ` Eli Zaretskii
2015-04-26 15:12           ` Dmitry Gutov
2015-04-26 15:32             ` Eli Zaretskii
2015-04-26 15:20         ` Dmitry Gutov
2015-04-26 16:01           ` Vitalie Spinu
2015-04-26 17:26             ` Dmitry Gutov
2015-04-27  2:26         ` Stefan Monnier
2015-04-25 19:01 ` Dmitry Gutov
2015-04-25 20:34   ` Vitalie Spinu
2015-04-25 21:44     ` Vitalie Spinu
2015-04-26  0:20     ` Dmitry Gutov
2015-04-26  0:28       ` Dmitry Gutov
2015-04-28 15:31       ` Vitalie Spinu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM9Zgm1PCoDnUE3Bk=kbP=NSU5fqrWsQEx+6=ny2NN7ryHkGYg@mail.gmail.com' \
    --to=bozhidar@batsov.com \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=spinuvit@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.