summaryrefslogtreecommitdiff
path: root/lisp/proced.el
diff options
context:
space:
mode:
authorRoland Winkler <Roland.Winkler@physik.uni-erlangen.de>2009-02-07 17:07:56 +0000
committerRoland Winkler <Roland.Winkler@physik.uni-erlangen.de>2009-02-07 17:07:56 +0000
commit016151bb4c1612bf993f2dcfc9b3adfda3f157d9 (patch)
tree690100a3915db9a723970d18c5e2dcbf8a72f822 /lisp/proced.el
parent763e01c4cfd6ce0b4e4f43ff5f3fcbf0de84a1c3 (diff)
downloademacs-016151bb4c1612bf993f2dcfc9b3adfda3f157d9.tar.gz
(proced-after-send-signal-hook): Use defcustom.
(proced-header-line): Handle header lines that are shorter than window-hscroll. (proced-send-signal): Rebind split-width-threshold analogous to dired-pop-to-buffer.
Diffstat (limited to 'lisp/proced.el')
-rw-r--r--lisp/proced.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/proced.el b/lisp/proced.el
index c6ce2034e0e..fc4d6d01cf9 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -356,6 +356,13 @@ May be used to adapt the window size via `fit-window-to-buffer'."
:options '(fit-window-to-buffer)
:group 'proced)
+(defcustom proced-after-send-signal-hook nil
+ "Normal hook run after sending a signal to processes by `proced-send-signal'.
+May be used to revert the process listing."
+ :type 'hook
+ :options '(proced-revert)
+ :group 'proced)
+
;; Internal variables
(defvar proced-available (not (null (list-system-processes)))
@@ -585,8 +592,10 @@ Important: the match ends just after the marker.")
(defun proced-header-line ()
"Return header line for Proced buffer."
(list (propertize " " 'display '(space :align-to 0))
- (replace-regexp-in-string ;; preserve text properties
- "\\(%\\)" "\\1\\1" (substring proced-header-line (window-hscroll)))))
+ (if (<= (window-hscroll) (length proced-header-line))
+ (replace-regexp-in-string ;; preserve text properties
+ "\\(%\\)" "\\1\\1"
+ (substring proced-header-line (window-hscroll))))))
(defun proced-pid-at-point ()
"Return pid of system process at point.
@@ -1711,7 +1720,10 @@ After sending the signal, this command runs the normal hook
(dolist (process process-alist)
(insert " " (cdr process) "\n"))
(save-window-excursion
- (pop-to-buffer (current-buffer))
+ ;; 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))