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: martin rudalics
Subject: Re: switch-to-buffer: for interactive use only
Date: Sun, 10 Jul 2011 11:00:44 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> How's this patch?

IIUC in interactive use `switch-to-buffer' wants `force-same-window'
non-nil.  How do you address that here?

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

martin



reply via email to

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