unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Roland Winkler <winkler@nano.uni-hannover.de>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: Switch to other buffer improvement
Date: 30 Jun 2004 14:37:31 +0200	[thread overview]
Message-ID: <m3hdstjk6s.fsf@tfkp07.physik.uni-erlangen.de> (raw)
In-Reply-To: <mailman.2784.1088591069.1953.bug-gnu-emacs@gnu.org>

"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)))

       reply	other threads:[~2004-06-30 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2784.1088591069.1953.bug-gnu-emacs@gnu.org>
2004-06-30 12:37 ` Roland Winkler [this message]
2004-06-30 10:21 Switch to other buffer improvement Adam Purkrt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hdstjk6s.fsf@tfkp07.physik.uni-erlangen.de \
    --to=winkler@nano.uni-hannover.de \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).