1

When the cursor is in minibuffer typing $ and then a few characters, say $HO offers envar name completion, for example running cygwin Emacs on Windows 7 it offers me $HOME, $HOMEDRIVE and $HOMEPATH. As well, typing a / after a complete variable name such as $HOME/ and tab shows files in that directory.

Is there a way to expand this variable? So that for example, I can delete part the expanded text and continue?

I am using iswitchb but I see the same behavior with emacs -q as well.

I am using cygwin build of Emacs 24.3.1 on Windows 7

Miserable Variable
  • 28,432
  • 15
  • 72
  • 133
  • What does "expand" mean here? – phils Jun 08 '13 at 04:31
  • @phils I mean replace entered text with `substitute-in-file-name` would transform it to – Miserable Variable Jun 08 '13 at 17:07
  • Thanks, there seemed to be some confusion between "expand" and "complete", but I understand why now. I can confirm that the expected behaviour (environment variable expansion of `$HOME/` upon `TAB`) occurs in NTEmacs 24.3.1 and also in my old Cygwin Emacs 23.3.1, but not in 24.3.1 under Linux, so something does appear to have changed here. – phils Jun 09 '13 at 07:48
  • Thanks @phils. I can confirm it does not expand (in the sense of replacing) on my MacBook 24.3.1 either. BTW thanks for the question, I realized the difference between expand-file-name and substitute-in-file-name. – Miserable Variable Jun 09 '13 at 16:07

1 Answers1

1

Once you have chosen which of those variables you want, type a / afterwards, then press TAB.

aap
  • 398
  • 1
  • 7
  • That shows completions the `*Completions*` buffer but the minubuffer continues to show `$envvar` as I entered it. I want to expand in the minubuffer, similar to what `readline` does on `shell-expand-line (M-C-e)` – Miserable Variable Jun 06 '13 at 23:46
  • For me it is expanding when I hit TAB after the slash. Win7, Emacs 24.3.1, non-cygwin build of emacs . – aap Jun 07 '13 at 15:40
  • My fingers too are telling me that is how to expand them but that's not the behavior I see :) I am using 24.31 cygwin build but I can't imagine how this can be cygwin specific. – Miserable Variable Jun 07 '13 at 17:04