Is there any way to automatically close filename completetion buffers in Emacs?

后端 未结 2 1413
陌清茗
陌清茗 2021-02-07 13:39

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

2条回答
  •  悲哀的现实
    2021-02-07 14:20

    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

提交回复
热议问题