From: Roland Winkler Date: Sat, 7 Feb 2009 17:07:56 +0000 (+0000) Subject: (proced-after-send-signal-hook): Use defcustom. X-Git-Tag: emacs-pretest-23.0.91~349 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=016151bb4c1612bf993f2dcfc9b3adfda3f157d9;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a15576965b5..42ea49e377b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2009-02-07 Roland Winkler + + * proced.el (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. + 2009-02-07 Eli Zaretskii * mail/rmail.el (rmail-redecode-body): Don't encode/decode the 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))