emacs-devel
[Top][All Lists]
Advanced

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

Re: switch-to-buffer: for interactive use only


From: Stefan Monnier
Subject: Re: switch-to-buffer: for interactive use only
Date: Sun, 10 Jul 2011 23:45:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> ! If the selected window is weakly dedicated, switch to
> ! BUFFER-OR-NAME anyway (see `set-window-dedicated-p').  If the
> ! selected window is strongly dedicated, display BUFFER-OR-NAME in
> ! another window if FORCE-SAME-WINDOW is nil, and signal an error
> ! if FORCE-SAME-WINDOW if non-nil.

I don't think it's necessary to talk so much about dedicated windows.
And FORCE-SAME-WINDOW should simply means that it will signal an error
if it can't use the selected window.

> ! Return the buffer switched to."
>     (interactive
>      (list (read-buffer-to-switch "Switch to buffer: ")))
>     (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
> !     (when force-same-window
> !       (cond
> !        ((window-minibuffer-p)
> !     (error "Cannot switch buffers in minibuffer window"))
> !        ((eq (window-dedicated-p) t)
> !     (error "Cannot switch buffers in a dedicated window"))))
> !     (pop-to-buffer buffer-or-name
> !                '(same-window (reuse-window-dedicated . weak))
> !                norecord nil)))
  
AFAIU, this can still use another window when force-same-window is
non-nil.


        Stefan



reply via email to

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