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?

Drew
  • 75,699
  • 9
  • 109
  • 225
Keks Dose
  • 508
  • 4
  • 19
  • 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 04 '21 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 05 '21 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 05 '21 at 13:07

1 Answers1

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 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 05 '21 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 05 '21 at 11:44
  • @jue Meanwhile ... I got icicles running. – Keks Dose Mar 05 '21 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 05 '21 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 05 '21 at 17:38
  • @KeksDose: Yes, that way you can visit the doc in Emacs. You also have the same doc on the web, with some screenshots etc.: [Icicles](https://www.emacswiki.org/emacs/Icicles). – Drew Mar 05 '21 at 23:09