unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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 --
     [not found] <mailman.2784.1088591069.1953.bug-gnu-emacs@gnu.org>
2004-06-30 12:37 ` Switch to other buffer improvement Roland Winkler
2004-06-30 10:21 Adam Purkrt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).