emacs-devel
[Top][All Lists]
Advanced

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

Re: Xref completion


From: Dmitry Gutov
Subject: Re: Xref completion
Date: Sat, 5 Dec 2020 23:44:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 05.12.2020 21:52, Juri Linkov wrote:
I've pushed it now with some changes, hope you all like the result.

Shortening the group part (in most common cases) is among them.

Also added some highlighting with corresponding xref faces. It now looks
closer to Pierre's original screenshot.

Thanks, everything works well.  Would be nicer to add all available
choices to xref-show-definitions-function (i.e. "at bottom", "minibuffer").

Of course, a bit later.

BTW, when we do that, should we also rename all involved functions to "public" names?

Putting them into the :type of a defcustom probably involves some kind of social contract.

BTW, Juri, how do you think this new function compares against
xref--show-defs-buffer-at-bottom?

On the one hand, it feels kinda faster, on the other, it lacks the ability
to "look around" when you really need it. In an ideal world, I guess the UI
would be somewhere in the middle.

There are still too many differences between them.  The most noteworthy
is that xref--show-defs-minibuffer doesn't show completions by default,
only after TAB TAB.

That depends on the completion UI in use.

To see them right away, just start with 'M-x fido-mode'.

Or here is the config I'm currently trying out. It needs both ivy and ivy-posframe installed, though:

(setq xref-show-definitions-function 'xref--show-defs-minibuffer)

(defun complete-with-ivy (fun &rest args)
  (let ((completing-read-function #'ivy-completing-read))
    (apply fun args)))

(advice-add #'xref--show-defs-minibuffer :around #'complete-with-ivy)

;; These last two forms are unrelated, here for completeness:

(advice-add #'project-find-file-in :around #'complete-with-ivy)

(advice-add #'project-prompt-project-dir :around #'complete-with-ivy)

;; See the result on the attached screenshot.

Attachment: Screenshot from 2020-12-05 23-25-42.png
Description: PNG image


reply via email to

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