]> code.delx.au - gnu-emacs/blobdiff - lisp/pcvs-util.el
* net/tramp.el (tramp-read-passwd): Cached passwords shall still be used.
[gnu-emacs] / lisp / pcvs-util.el
index 70b902522bc5bef6cc5190da6841b81c3adda335..5d786a6538ab7b13f3f92547b33299b7b3ed6824 100644 (file)
@@ -1,7 +1,7 @@
 ;;; pcvs-util.el --- utility functions for PCL-CVS  -*- byte-compile-dynamic: t -*-
 
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
@@ -100,7 +100,20 @@ BUF is assumed to be a temporary buffer used from the buffer MAINBUF."
     (let ((win (if (eq buf (window-buffer (selected-window))) (selected-window)
                 (get-buffer-window buf t))))
       (when win
-        (quit-window nil win)))
+       (if (window-dedicated-p win)
+           (condition-case ()
+               (delete-window win)
+             (error (iconify-frame (window-frame win))))
+;;;      (if (and mainbuf (get-buffer-window mainbuf))
+;;;          ;; FIXME: if the buffer popped into a pre-existing window,
+;;;          ;; we don't want to delete that window.
+;;;          t ;;(delete-window win)
+;;;          )
+         )))
+    (with-current-buffer buf
+      (bury-buffer (unless (and (eq buf (window-buffer (selected-window)))
+                               (not (window-dedicated-p (selected-window))))
+                    buf)))
     (when mainbuf
       (let ((mainwin (or (get-buffer-window mainbuf)
                         (get-buffer-window mainbuf 'visible))))