[Top][All Lists]

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

minibuffer completion differences between emacs 22.3, 23.1, and xemacs

From: Christopher Grubert
Subject: minibuffer completion differences between emacs 22.3, 23.1, and xemacs
Date: Mon, 30 Apr 2012 03:32:56 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110428 Fedora/3.1.10-1.fc13 Lightning/1.0b2 Thunderbird/3.1.10

I'm in the process of converting from xemacs to gnu emacs and I have a question about minibuffer completion of env variables.

I see that in 22.3 (and earlier) if I do the following:

C-x C-f /whatever/path/im/in/$HOM <TAB>

it says there is no match, but if I complete the var by hand and try again:

C-x C-f /whatever/path/im/in/$HOME <TAB>

it will substitute the value and continue on completing from the location (/home/chris in this example). It will also strip off the originating path (/whatever/path/im/in/) and just leave the value of $HOME as shown from file system root.

I see that in 23.1 (and later) the behavior has changed such that:

C-x C-f /whatever/path/im/in/$HOM <TAB>

will complete to "/whatever/path/im/in/$HOME [Sole completion]" and stop. If I then type a trailing "/" after the completed $HOME it will continue completing from "/whatever/path/im/in//home/chris/..." after it does the substitution, but this requires the extra step of typing / after the var and it doesn't compress the path. That's not such a big deal in this example, but I tend to keep lots of long project paths in env vars and the above behavior can lead to a really long minibuffer line.

What I would like to have is the behavior from xemacs, which does a combination of the above:

C-x C-f /whatever/path/im/in/$HOM <TAB>

would first list any variable completions, then substitute the value, compress the path, and keep completing, all just by pressing tab:
C-x C-f /whatever/path/im/in/$HOM <TAB>
/whatever/path/im/in/$HOME <TAB>
/home/chris/ <TAB>

I've searched around and found practically no mention of this behavior anywhere, which seems surprising. I only noticed the 22.3/23.1 behavior change after compiling several versions to see if the current behavior has always been there in gnu emacs. I tried looking at the differences in the completion code from 22.3 to 23.1 thinking maybe I could just merge the features, but it looks like it was all rewritten for 23. I do see some internal functions which perform at least part of this (expand-file-name), but I don't see any obvious configuration settings for tweaking this, and oddly have not come across any lisp snippets to mimic the xemacs behavior.

Any suggestions would be welcomed. For reference, the behaviors described can all be seen in a default setup (emacs -q or xemacs --vanilla). I'm currently using 24.0.96 so any suggestions which are specific to version 24 would also be welcomed.

reply via email to

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