From 65d4207af2e2cab2c202ec47683de23c8d8cdb16 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 8 Jan 2011 20:29:04 +0100 Subject: [PATCH] Fix some pop-to-buffer callers. --- lisp/ChangeLog | 16 ++++++++++++++++ lisp/net/ange-ftp.el | 5 ++--- lisp/vc/log-edit.el | 2 +- lisp/vc/pcvs-util.el | 8 -------- lisp/vc/pcvs.el | 15 +++++++-------- lisp/vc/vc-dir.el | 8 ++++++-- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 285a3cc5517..b9e0ac55426 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2011-01-08 Martin Rudalics + + * net/ange-ftp.el (ange-ftp-error): Use + pop-to-buffer-same-frame-other-window. + + * vc/log-edit.el (log-edit-show-files): Use + pop-to-buffer-same-frame. + + * vc/pcvs-util.el (cvs-pop-to-buffer-same-frame): Remove. + + * vc/pcvs.el (cvs-cmd-do, cvs-quickdir): Do not bind + pop-up-windows. + (cvs-do-removal): Call pop-to-buffer-same-frame. + + * vc/vc-dir.el (vc-dir): Do not bind pop-up-windows. + 2011-01-08 Glenn Morris * makefile.w32-in (EMACSOPT): Add --no-site-lisp. diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 07091663471..7dd1210f633 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1485,9 +1485,8 @@ only return the directory part of FILE." ;; USER pair, and signal an error including MSG in the text. (defun ange-ftp-error (host user msg) (save-excursion ;; Prevent pop-to-buffer from changing current buffer. - (let ((cur (selected-window)) - (pop-up-windows t)) - (pop-to-buffer + (let ((cur (selected-window))) + (pop-to-buffer-same-frame-other-window (get-buffer-create (ange-ftp-ftp-process-buffer host user))) (goto-char (point-max)) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index c7f37c50011..5ca746a14a5 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -528,7 +528,7 @@ If you want to abort the commit, simply delete the buffer." (setq buffer-read-only t) (goto-char (point-min)) (save-selected-window - (cvs-pop-to-buffer-same-frame buf) + (pop-to-buffer-same-frame buf) (shrink-window-if-larger-than-buffer) (selected-window))))) diff --git a/lisp/vc/pcvs-util.el b/lisp/vc/pcvs-util.el index f3f579bf6a2..bc527350879 100644 --- a/lisp/vc/pcvs-util.el +++ b/lisp/vc/pcvs-util.el @@ -81,14 +81,6 @@ the other elements. The ordering among elements is maintained." ;;; frame, window, buffer handling ;;; -(defun cvs-pop-to-buffer-same-frame (buf) - "Pop to BUF like `pop-to-buffer' but staying on the same frame. -If `pop-to-buffer' would have opened a new frame, this function would -try to split a new window instead." - (pop-to-buffer - (current-buffer) '(same-frame (new-window (selected . below)) - (reuse-buffer-window . nil)))) - (defun cvs-bury-buffer (buf &optional mainbuf) "Hide the buffer BUF that was temporarily popped up. BUF is assumed to be a temporary buffer used from the buffer MAINBUF." diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 305e109b6d6..c13565f500c 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -495,11 +495,9 @@ If non-nil, NEW means to create a new buffer no matter what." (cvs-mode-run cmd flags fis :cvsargs cvsargs :dont-change-disc dont-change-disc) - (if noshow cvsbuf - (let ((pop-up-windows nil)) (pop-to-buffer cvsbuf))))) -;; (funcall (if (and (boundp 'pop-up-frames) pop-up-frames) -;; 'pop-to-buffer 'switch-to-buffer) -;; cvsbuf)))) + (if noshow + cvsbuf + (pop-to-buffer cvsbuf)))) (defun cvs-run-process (args fis postprocess &optional single-dir) (assert (cvs-buffer-p cvs-buffer)) @@ -1018,8 +1016,9 @@ FLAGS is ignored." (eq cvs-auto-remove-handled t) cvs-auto-remove-directories nil) - (if noshow cvsbuf - (let ((pop-up-windows nil)) (pop-to-buffer cvsbuf))))) + (if noshow + cvsbuf + (pop-to-buffer cvsbuf)))) ;;;###autoload (defun cvs-examine (directory flags &optional noshow) @@ -2148,7 +2147,7 @@ Returns a list of FIS that should be `cvs remove'd." (with-current-buffer tmpbuf (let ((inhibit-read-only t)) (cvs-insert-strings (mapcar 'cvs-fileinfo->full-name fis)) - (cvs-pop-to-buffer-same-frame (current-buffer)) + (pop-to-buffer-same-frame (current-buffer)) (shrink-window-if-larger-than-buffer)))) (if (not (or silent (unwind-protect diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index cd40468199f..544c0b4b857 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1192,8 +1192,12 @@ These are the commands available for use in the file status buffer: nil t nil nil))))) (unless backend (setq backend (vc-responsible-backend dir))) - (let (pop-up-windows) ; based on cvs-examine; bug#6204 - (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend))) + ;; Earlier this one did bind `pop-up-windows' to nil, based on + ;; cvs-examine; bug#6204. Now, if a user wants to pop up this buffer + ;; in the same window, she should use the (reuse-window 'same ) + ;; specifier for *vc-dir* buffers. + (pop-to-buffer + (vc-dir-prepare-status-buffer "*vc-dir*" dir backend)) (if (derived-mode-p 'vc-dir-mode) (vc-dir-refresh) ;; FIXME: find a better way to pass the backend to `vc-dir-mode'. -- 2.39.5