2

Often I'd like to open a file in a subdirectory. But poor me, I can't remember the name. So when typing C-x C-f and then TAB TAB for the completion list, the list of all files in this directory is listed, including the subdirectories, which are only marked by a / at the end.

Any idea how to highlight the subdirectories in this buffer *Completions* or to sort the completion list directories first?

3
  • Not what you asked for, but try to to enable icomplete-mode or ido-mode or install ivy or helm. all 4 are so called completion systems. the first 2 are build in, the last both can be installed with package manager.
    – jue
    Mar 4, 2021 at 23:07
  • @jue Thank you for naming these packages / modes. But in the answer of Drew was a direct solution posted, so I tried icicles first and by the way, the name is so funny (ok, deciding because you like the name isn't a really scientific way to make a decision, I know).
    – Keks Dose
    Mar 5, 2021 at 11:51
  • I never experienced icicles, but with the modes I mentioned you never have to remember any name, you see them right at the prompt. Try the oldest one with M-x ido-mode it just takes a minute. That once was a booster for me.
    – jue
    Mar 5, 2021 at 13:07

1 Answer 1

1

If you use Icicles then:

  • Directory candidates are highlighted in *Completions*.
  • You can change the sort order for candidates any time during completion, using C-,.

If you customize option icicle-file-sort to the function icicle-dirs-first-p then directory candidates are sorted first: M-x customize-option RET icicle-file-sort.

6
  • I've spent more than one hour without success. The github files are two years old. The icecles-wizard crashes after downloading 10 files and EmacsWiki times out. Maybe wrong day, but please, Drew, get that package into elpa, melpa, whatever.
    – Keks Dose
    Mar 5, 2021 at 10:37
  • @KeksDose if you consider installing icicles, you could also (instead) consider installing ivy or helm, they are on melpa, you might like them.
    – jue
    Mar 5, 2021 at 11:44
  • @jue Meanwhile ... I got icicles running.
    – Keks Dose
    Mar 5, 2021 at 11:48
  • I can't vouch for whatever the GitHub mirror holds. Please download the Icicles source files from Emacs Wiki. People have no problem doing that.
    – Drew
    Mar 5, 2021 at 17:21
  • @Drew Yes, manually downloaded them from Emacswiki. I found out that can get the help files with M-x icicle-minibuffer-help and then click on Icicles Doc, Part 1. It takes a while but then there is a lot of documentation. Will take a while to get through that.
    – Keks Dose
    Mar 5, 2021 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.