Path: utzoo!utgpu!watmath!uunet!bu-cs!jbw From: jbw@bucsf.bu.edu (Joe Wells) Newsgroups: gnu.emacs.bug Subject: Re: Completion and environment variables don't cooperate Message-ID: <38644@bu-cs.BU.EDU> Date: 22 Sep 89 00:08:41 GMT References: <1989Sep21.191411.3071@cs.rochester.edu> Sender: daemon@bu-cs.BU.EDU Organization: Boston University Computer Science Department Lines: 35 In-reply-to: quiroz@cs.rochester.edu's message of 21 Sep 89 19:14:11 GMT In article <1989Sep21.191411.3071@cs.rochester.edu> quiroz@cs.rochester.edu (Cesar Quiroz) writes: Suspect is minibuffer-complete-word. When asked to complete a filename that contains environment variables, it reduces the entire filename to "/". After getting the completion, minibuffer-complete-word looks at what is in the minibuffer and finds length of the largest suffix of the minibuffer contents that is a prefix of the completion. It starts from that character in the completion and finds the next non-word character. Everything in the completion up to and including that non-word character becomes the new contents of the minibuffer. Normally this works like this: Contents of minibuffer: "/usr/jbw/misc/junk" Completion: "/usr/jbw/misc/junk-file" Suffix that is prefix: "/usr/jbw/misc/junk" New minibuffer contents: "/usr/jbw/misc/junk-" In your case, this worked like this: Contents of minibuffer: "$HOME/misc/junk" Completion: "/usr/jbw/misc/junk-file" Suffix that is prefix: "" New minibuffer contents: "/" I believe the best solution to this problem would be to automatically expand the environment variables before trying to do the completion. Since the current code is not specialized for filename completion, this might be difficult. -- Joe Wells jbw%bucsf.bu.edu@bu-it.bu.edu ...!harvard!bu-cs!bucsf!jbw