[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: can't close *Completions*
From: |
Kevin Rodgers |
Subject: |
Re: can't close *Completions* |
Date: |
Mon, 05 Mar 2007 21:30:39 -0700 |
User-agent: |
Thunderbird 1.5.0.10 (Macintosh/20070221) |
Andrew Yates wrote:
When I use comint-dynamic-complete-filename, the frame is split and a
*Completions* window is opened. At the bottom of *Completions*, it
says "Hit space to flush." Pressing space immediately does close
*Completions*, but if I press any other key before pressing space,
space no longer closes the window. I can close it with kill-buffer or
by switching to that buffer and closing it, but that's inefficient.
What about `C-x 1'?
Is there a way to make RET close the buffer, just as space does? I'm
using that function for file completion in a terminal, so closing it
with RET makes sense in this case.
Hmmm, RET is bound to comint-send-input, and SPC is handled by
comint-dynamic-list-completions, neither of which is easily customized.
Here's what I would try:
(defadvice comint-send-input (after undisplay-completions activate)
"If the *Completions* buffer is displayed in the selected frame,
restore the previous window configuration."
(when (and (get-buffer-window "*Completions*")
comint-dynamic-list-completions-config)
(set-window-configuration comint-dynamic-list-completions-config)))
--
Kevin Rodgers
Denver, Colorado, USA