Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to remove buffers created during command completion from an emacs shell

18 views
Skip to first unread message

bharmaji

unread,
Nov 13, 2012, 1:53:15 AM11/13/12
to
Hello
Can someone please help with the following problem. I do M-x shell to enter a shell. Then if I type a command and press TAB, a buffer is created for command completion. Now if I do not click on an entry in that buffer, the buffer continues to stay there. I have to do C-x 0 to get it removed. Is there a way for it to automatically get removed if I fill the command myself and press ENTER or is there a way for me to select an entry without using a mouse?

Peter Dyballa

unread,
Nov 13, 2012, 4:44:35 AM11/13/12
to bharmaji, help-gn...@gnu.org

Am 13.11.2012 um 07:53 schrieb bharmaji:

> Is there a way for it to automatically get removed if I fill the command myself and press ENTER or is there a way for me to select an entry without using a mouse?

Add one more character to the incomplete command and then press TAB to complete. The *Completions* window will disappear. When reaching the end of a word and you don't need a longer completed word you can type SPACE and the *Completions* window will disappear as well.

--
Greetings

Pete

The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners.
– Ernest Jan Plugge


Xavier Maillard

unread,
Nov 13, 2012, 3:48:54 PM11/13/12
to bharmaji, help-gn...@gnu.org
Hi,
Here is how you can circumvent that simply:

;; Reduce open buffer list: first the completion buffer
(add-hook 'minibuffer-exit-hook
'(lambda ()
(let ((buffer "*Completions*"))
(and (get-buffer buffer)
(kill-buffer buffer)
(message "Killing buffer %s" buffer)))))


Xavier
--
http://www.gnu.org
http://www.april.org
http://www.lolica.org

Stefan Monnier

unread,
Nov 14, 2012, 11:23:38 AM11/14/12
to
Which version of Emacs are you using?
AFAIK this problem is fixed in Emacs-24.


Stefan
0 new messages