For example, when you open a file via C-x-C-f, you can TAB complete file names, and if there are more than one possible completions, it will pop open a completion buffer with a list of possible completions. The problem is, after you've opened the file, the window the buffer was in switches back to normal, but it doesn't close. Is there any way I can make those buffers close automatically after the file has been opened?
views:
222answers:
2
+6
A:
Although it does not directly solve your problem have you considered ido-mode
as a mechanism for opening files?
ido-mode will bind C-x C-f
to ido-find-file
this allows you to interactively opening files (selecting between name collisions from within the minibuffer C-s
and various other nifty features) I find it a much easier method of finding files and it will get rid of the *Completions*
buffer altogether.
kjfletch
2010-01-03 23:01:21
Thank you. I'll check that out.
Rayne
2010-01-04 00:02:12
Perfect for me. Thanks.
Rayne
2010-01-04 05:27:35
It has many other uses than the ones described here and is part of emacs by default (from version 22 I think). The more you read what it can do, the more you will probably like it.
kjfletch
2010-01-04 08:09:08
+3
A:
Sorry to enter really late on this but this is how I do:
;; Remove completion buffer when done
(add-hook 'minibuffer-exit-hook
'(lambda ()
(let ((buffer "*Completions*"))
(and (get-buffer buffer)
(kill-buffer buffer)))))
Tested on GNU Emacs 22.x and 23.x
Xavier Maillard
2010-05-23 21:33:55