+2011-01-12 Martin Rudalics <rudalics@gmx.at>
+
+ * dired.el (dired-display-file, dired-why): Use
+ display-buffer-other-window with label.
+ (dired-pop-to-buffer): Remove.
+ (dired-mark-pop-up): Use display-buffer and quit-restore-window.
+
+ * proced.el (proced-send-signal): Use display-buffer and
+ quit-restore-window.
+
2011-01-11 Martin Rudalics <rudalics@gmx.at>
* vc/ediff-ptch.el (ediff-show-patch-diagnostics): Use
(defun dired-display-file ()
"In Dired, display this file or directory in another window."
(interactive)
- (display-buffer (find-file-noselect (dired-get-file-for-visit))))
+ (display-buffer-other-window
+ (find-file-noselect (dired-get-file-for-visit)) 'dired-display-file))
\f
;;; Functions for extracting and manipulating file names in Dired buffers.
(format "[next %d files]" arg)
(format "%c [%d files]" dired-marker-char count)))))
-(defun dired-pop-to-buffer (buf)
- "Pop up buffer BUF in a way suitable for Dired.
-Currently this means in another window on the same frame."
- (pop-to-buffer-same-frame-other-window (get-buffer-create buf))
- ;; If dired-shrink-to-fit is t, make its window fit its contents.
- (when dired-shrink-to-fit
- ;; Try to not delete window when we want to display less than
- ;; `window-min-height' lines.
- (fit-window-to-buffer (get-buffer-window buf) nil 1)))
-
(defcustom dired-no-confirm nil
"A list of symbols for commands Dired should not confirm, or t.
Command symbols are `byte-compile', `chgrp', `chmod', `chown', `compress',
;; 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))))
+ '(mouse-face nil help-echo nil))
+
+ (let ((window (display-buffer nil nil 'dired-mark-pop-up)))
+ (when dired-shrink-to-fit
+ (fit-window-to-buffer window nil 1))
+ (select-window window t)
+ (apply function args)
+ ;; We could kill the buffer here.
+ (quit-restore-window window)))))
(defun dired-format-columns-of-files (files)
(let ((beg (point)))
(interactive)
(if (get-buffer dired-log-buffer)
(let ((owindow (selected-window))
- (window (display-buffer (get-buffer dired-log-buffer))))
+ (window (display-buffer-other-window
+ (get-buffer dired-log-buffer) 'dired-why)))
(unwind-protect
(progn
(select-window window)
(setq buffer-read-only t)
(dolist (process process-alist)
(insert " " (cdr process) "\n")))
- (save-window-excursion
- ;; Analogous to `dired-pop-to-buffer'
- ;; Don't split window horizontally. (Bug#1806)
- (let (split-width-threshold)
- (pop-to-buffer (current-buffer)))
- (fit-window-to-buffer (get-buffer-window) nil 1)
- (let* ((completion-ignore-case t)
- (pnum (if (= 1 (length process-alist))
- "1 process"
- (format "%d processes" (length process-alist))))
- (completion-annotate-function
- (lambda (s) (cdr (assoc s proced-signal-list)))))
- (setq signal
- (completing-read (concat "Send signal [" pnum
- "] (default TERM): ")
- proced-signal-list
- nil nil nil nil "TERM")))))))
+ ;; Don't split window horizontally. (Bug#1806) We now do
+ ;; split windows horizontally again - override this via
+ ;; `display-buffer-alist' if you want to.
+ (let* ((window (display-buffer nil nil 'proced-send-signal))
+ (completion-ignore-case t)
+ (pnum (if (= 1 (length process-alist))
+ "1 process"
+ (format "%d processes" (length process-alist))))
+ (completion-annotate-function
+ (lambda (s) (cdr (assoc s proced-signal-list)))))
+ (fit-window-to-buffer window nil 1)
+ (select-window window t)
+ (setq signal
+ (completing-read (concat "Send signal [" pnum
+ "] (default TERM): ")
+ proced-signal-list
+ nil nil nil nil "TERM"))
+ (quit-restore-window window)))))
;; send signal
(let ((count 0)
failures)