this post was submitted on 27 Oct 2023
1 points (100.0% liked)

Emacs

311 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

Hi.

Ainother day, another emacs doubt.

I'm using ivy-mode, and when I do M-x and write, the order of candidates for completion seems weird for me. I figure it obeys some logic, but I'd like to change it. For example:

I do M-x and write coun bu

Results are:

counsel-switch-buffer (this one is selected by default)

counsel-ibuffer

counsel-buffer-or-recentf

counsel-minibuffer-history

For me, counsel-buffer-or-recent should be the first candidate, since that's the one with shortest "distance" between a match for coun and a match for bu. Is there a way to make results be sorted by this? So that those 4 candidate should appear like:

counsel-buffer-or-recentf

counsel-ibuffer

counsel-minibuffer-history

counsel-switch-buffer

Another example. I make M-x package-install then write consu. There are almost 15 results before consult. Being the shortest one matching perfectly the string, IMHO this should be the first candidate.

Another example, M-x dire. Results:

A couple of logical results (because they start with dired-)

tramp-crypt-add-directory

dired-jump-other-window

How is it that dired-jump appears after tramp-crypt-add-directory if the match for dire is further in the tramp-... candidate?

Any hint on this?

Thanks in advance.

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 1 year ago

Not sure how plain ivy sorts its candidates, but do you have by chance any additional package installed? A package, which re-sorts the candidate list? A Package like prescient, smex, flx, historian, ...?