In Fset_window_configuration install revison of reverted fix.
[bpt/emacs.git] / lisp / proced.el
index cc18560..d98bf7d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; proced.el --- operate on system processes like dired
 
-;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
 ;; Author: Roland Winkler <winkler@gnu.org>
 ;; Keywords: Processes, Unix
@@ -395,7 +395,7 @@ It is a list of lists (KEY PREDICATE REVERSE).")
   :group 'proced-faces)
 
 (defface proced-marked
-  '((t (:inherit font-lock-warning-face)))
+  '((t (:inherit error)))
   "Face used for marked processes."
   :group 'proced-faces)
 
@@ -659,11 +659,14 @@ After displaying or updating a Proced buffer, Proced runs the normal hook
 ;;;###autoload
 (defun proced (&optional arg)
   "Generate a listing of UNIX system processes.
-If invoked with optional ARG the window displaying the process
-information will be displayed but not selected.
-Runs the normal hook `proced-post-display-hook'.
+\\<proced-mode-map>
+If invoked with optional ARG, do not select the window displaying
+the process information.
 
-See `proced-mode' for a description of features available in Proced buffers."
+This function runs the normal hook `proced-post-display-hook'.
+
+See `proced-mode' for a description of features available in
+Proced buffers."
   (interactive "P")
   (unless proced-available
     (error "Proced is not available on this system"))
@@ -1170,14 +1173,16 @@ Return nil otherwise."
 (defun proced-time-lessp (t1 t2)
   "Return t if time value T1 is less than time value T2.
 Return `equal' if T1 equals T2.  Return nil otherwise."
-  (with-decoded-time-value ((high1 low1 micro1 t1)
-                           (high2 low2 micro2 t2))
+  (with-decoded-time-value ((high1 low1 micro1 pico1 type1 t1)
+                           (high2 low2 micro2 pico2 type2 t2))
     (cond ((< high1 high2))
           ((< high2 high1) nil)
           ((< low1 low2))
           ((< low2 low1) nil)
           ((< micro1 micro2))
           ((< micro2 micro1) nil)
+         ((< pico1 pico2))
+         ((< pico2 pico1) nil)
           (t 'equal))))
 
 ;;; Sorting
@@ -1332,7 +1337,7 @@ Prefix ARG controls sort order, see `proced-sort-interactive'."
             (proced-sort-interactive key arg)
           (message "No sorter defined here."))))))
 
-;;; Formating
+;;; Formatting
 
 (defun proced-format-time (time)
   "Format time interval TIME."
@@ -1509,16 +1514,6 @@ Replace newline characters by \"^J\" (two characters)."
     (if (string-match "[ \t]+$" proced-header-line)
         (setq proced-header-line (substring proced-header-line 0
                                             (match-beginning 0))))
-     (setq proced-header-line (concat "  " proced-header-line))
-     ;; From buff-menu.el: Turn whitespace chars in the header into
-     ;; stretch specs so they work regardless of the header-line face.
-     (let ((pos 0)
-         (header proced-header-line))
-       (while (string-match "[ \t\n]+" header pos)
-         (setq pos (match-end 0))
-         (put-text-property (match-beginning 0) pos 'display
-                            (list 'space :align-to pos)
-                            header)))
     ;; (delete-trailing-whitespace)
     (goto-char (point-min))
     (while (re-search-forward "[ \t\r]+$" nil t)
@@ -1612,6 +1607,7 @@ After updating a displayed Proced buffer run the normal hook
     (while (not (eobp))
       (insert "  ")
       (forward-line))
+    (setq proced-header-line (concat "  " proced-header-line))
     (if revert (set-buffer-modified-p nil))
 
     ;; set `goal-column'
@@ -1660,8 +1656,8 @@ After updating a displayed Proced buffer run the normal hook
           (goto-char new-pos)
         (goto-char (point-min))
         (proced-move-to-goal-column)))
-    ;; update modeline
-    ;; Does the long `mode-name' clutter the modeline?  It would be nice
+    ;; update mode line
+    ;; Does the long `mode-name' clutter the mode line?  It would be nice
     ;; to have some other location for displaying the values of the various
     ;; flags that affect the behavior of proced (flags one might want
     ;; to change on the fly).  Where??
@@ -1733,7 +1729,9 @@ After sending the signal, this command runs the normal hook
             (buffer-disable-undo)
             (setq buffer-read-only t)
             (dolist (process process-alist)
-              (insert "  " (cdr process) "\n")))
+              (insert "  " (cdr process) "\n"))
+            (delete-char -1)
+            (goto-char (point-min)))
           (save-window-excursion
             ;; Analogous to `dired-pop-to-buffer'
             ;; Don't split window horizontally.  (Bug#1806)