help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-x b w/Multiple Windows and Frames


From: Kevin Rodgers
Subject: Re: C-x b w/Multiple Windows and Frames
Date: Fri, 17 Nov 2006 09:52:08 -0700
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Alan Lue wrote:
Using `C-x b' without an argument displays the most
recent buffer among those not currently displayed.  I
find this behavior annoying when I intend to keep the
same buffer displayed in multiple windows and frames;
oftentimes I need to briefly visit another file, and
when I return to a buffer that is already displayed in
another frames, I need to specify its name explicity.

Is there some way I could modify the behavior of
`switch-to-buffer' so that invoking `C-x b' without an
argument will bring me back to the most recent buffer,
whether or not it is currently displayed in another
window/frame?

Try this:

(defadvice switch-to-buffer (before interactive-default-buffer activate)
  "Consider buffers that are already visible as the default BUFFER."
  (interactive (list (read-buffer "Switch to buffer: "
                                  (other-buffer (current-buffer) t)))))

--
Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]