changeset 101880:18c7189fe029

(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.
author Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
date Sat, 07 Feb 2009 17:06:26 +0000
parents 4743ac816d50
children 43b1a5e6eb09
files lisp/proced.el
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/proced.el	Sat Feb 07 16:56:28 2009 +0000
+++ b/lisp/proced.el	Sat Feb 07 17:06:26 2009 +0000
@@ -356,6 +356,13 @@
   :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 @@
 (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 @@
           (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))