[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bad moves with xref-find-definitions

From: Vitalie Spinu
Subject: Bad moves with xref-find-definitions
Date: Thu, 23 Apr 2015 17:07:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hi All,

There has been a breaking change in UI with respect to find definition
functionality. I am all for generic interface but IMO there is no reason
to break standard Emacs interaction mechanism in favor for some not that
well thought UI borrowed from SLIME.

These are the issues with the new interface:

 1) `find-tag` (previously bound to M-.) was prompting for a symbol
     before jumping to the definition. The symbol at point was the
     default. On the expense of one additional RET this was very
     convenient because it leaves the possibility to jump to a different
     symbol and also saves you from useless navigation to a symbol when
     symbol is not directly under the cursor. The desired symbol might
     not be visible, or even present in current buffer.

     Now, "xref-find-definitions" encourages you to navigate to a symbol
     by disrupting the flow twice. Once, when you navigate to a symbol,
     and often for the second time when you need to go back to the
     editing after you saw the definition. This just fosters a bad habit
     of tracking what you read with a cursor. It just cannot be right.

     Needless to say that most other functionality in Emacs does ask for
     completion before performing an action (documentation, find-file

     Having an option to *not* navigate to symbol is very useful and
     Emacs was recognizing this need all this time. Why would you change
     this now?

  2) I haven't investigated the API thoroughly so I might be
     misinterpreting this one.

     Etags is still very useful even with dynamic languages. For example
     the language tool might not load all the files in current
     project/directory, or you might intentionally keep some code in
     non-project directories. You might also define your tags for a
     bunch of other related projects which you want to access from the
     current project.

     Now, when "M-." is gone, if the language re-defines
     `xref-find-function` how do I access tags? Do I need to bind a new
     global key for `find-tag` command?

  3) C-u xref-find-definitions places symbol at point as the initial
     input which forces you to delete it. It's rather annoying.

There has been a lengthy discussion on Cider issue tracker to change the
behavior borrowed from SLIME into standard emacs UI [1][2]. Once that
was changed, emacs itself seems to move into wrong ways.


[1] https://github.com/clojure-emacs/cider/issues/699#start-of-content
[2] https://github.com/clojure-emacs/cider/issues/1014#start-of-content

reply via email to

[Prev in Thread] Current Thread [Next in Thread]