* Switch to other buffer improvement
@ 2004-06-30 10:21 Adam Purkrt
0 siblings, 0 replies; 2+ messages in thread
From: Adam Purkrt @ 2004-06-30 10:21 UTC (permalink / raw)
Dear Emacs maintainers,
I'd like to suggest an improvement to Emacs.
Example situation: I have opened "style1.css", "style2.css" and
"foo.html". Active buffer is "style1.css". I want to switch to style2.css.
Press C-x b, type "s", press tab, it completes to "style", then I have to
type "2", press tab again and finally switch to "style2.css".
I think, that Emacs should complete to "style2.css" immediately after
typing "s", because when I'm switching to another buffer I don't want to
stay in the same.
Simply said - when switching, the active buffer should be excluded from
the completion-list.
Best regards,
Adam Purkrt
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Switch to other buffer improvement
[not found] <mailman.2784.1088591069.1953.bug-gnu-emacs@gnu.org>
@ 2004-06-30 12:37 ` Roland Winkler
0 siblings, 0 replies; 2+ messages in thread
From: Roland Winkler @ 2004-06-30 12:37 UTC (permalink / raw)
Cc: bug-gnu-emacs
"Adam Purkrt" <adam.purkrt@cmail.cz> writes:
> I'd like to suggest an improvement to Emacs.
>
> Example situation: I have opened "style1.css", "style2.css" and
> "foo.html". Active buffer is "style1.css". I want to switch to
> style2.css. Press C-x b, type "s", press tab, it completes to
> "style", then I have to type "2", press tab again and finally
> switch to "style2.css".
>
> I think, that Emacs should complete to "style2.css" immediately
> after typing "s", because when I'm switching to another buffer I
> don't want to stay in the same.
>
> Simply said - when switching, the active buffer should be excluded
> from the completion-list.
Put this in your .emacs
(setq read-buffer-function 'read-buffer-different)
(defun read-buffer-different (prompt &optional default require-match)
"Read buffer with minibuffer completion not including current-buffer."
(let ((bl (buffer-list))
(cb (current-buffer))
buf dbl)
(while (setq buf (car bl))
(unless (eq buf cb) (push (buffer-name buf) dbl))
(setq bl (cdr bl)))
(completing-read (if default
(concat prompt "(default " default ") ")
prompt)
dbl nil require-match nil 'buffer-name-history default)))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-30 12:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-30 10:21 Switch to other buffer improvement Adam Purkrt
[not found] <mailman.2784.1088591069.1953.bug-gnu-emacs@gnu.org>
2004-06-30 12:37 ` Roland Winkler
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.