bzr diff === modified file 'lisp/dired.el' --- lisp/dired.el 2012-04-01 02:44:24 +0000 +++ lisp/dired.el 2012-04-06 13:35:09 +0000 @@ -2950,8 +2950,7 @@ ;; that's possible. (Bug#1806) (split-window-below)) ;; Otherwise, try to split WINDOW sensibly. - (split-window-sensibly window)))) - pop-up-frames) + (split-window-sensibly window))))) (pop-to-buffer (get-buffer-create buf))) ;; If dired-shrink-to-fit is t, make its window fit its contents. (when dired-shrink-to-fit @@ -2993,17 +2992,21 @@ ;; If FILES defaulted to the current line's file. (= (length files) 1)) (apply function args) - (with-current-buffer (get-buffer-create bufname) - (erase-buffer) - ;; Handle (t FILE) just like (FILE), here. - ;; That value is used (only in some cases), to mean - ;; just one file that was marked, rather than the current line file. - (dired-format-columns-of-files (if (eq (car files) t) (cdr files) files)) - (remove-text-properties (point-min) (point-max) - '(mouse-face nil help-echo nil))) - (save-window-excursion - (dired-pop-to-buffer bufname) - (apply function args)))) + (let ((buffer (get-buffer-create bufname))) + (with-current-buffer buffer + (erase-buffer) + ;; Handle (t FILE) just like (FILE), here. + ;; That value is used (only in some cases), to mean + ;; just one file that was marked, rather than the current line file. + (dired-format-columns-of-files (if (eq (car files) t) (cdr files) files)) + (remove-text-properties (point-min) (point-max) + '(mouse-face nil help-echo nil)) + (dired-pop-to-buffer buffer) + (let ((window (get-buffer-window buffer))) + (prog1 + (apply function args) + (when (and window (eq (window-buffer window) buffer)) + (quit-window nil window)))))))) (defun dired-format-columns-of-files (files) (let ((beg (point)))