]> code.delx.au - gnu-emacs/blobdiff - lisp/proced.el
* vc/vc-hooks.el (vc-before-save): Clear cache if file has been
[gnu-emacs] / lisp / proced.el
index 06056ed26831a0aa09a28a4f215655d7dd57cc49..78afcac9f502e44d23ce50ab763dd82e1ea62df0 100644 (file)
@@ -1,8 +1,8 @@
 ;;; proced.el --- operate on system processes like dired
 
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
-;; Author: Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
+;; Author: Roland Winkler <winkler@gnu.org>
 ;; Keywords: Processes, Unix
 
 ;; This file is part of GNU Emacs.
@@ -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)
 
@@ -1170,14 +1170,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 +1334,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."
@@ -1651,8 +1653,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??
@@ -1676,7 +1678,7 @@ After updating a displayed Proced buffer run the normal hook
         (message (if revert "Updating process information...done."
                    "Updating process display...done.")))))
 
-(defun proced-revert (&rest args)
+(defun proced-revert (&rest _args)
   "Reevaluate the process listing based on the currently running processes.
 Preserves point and marks."
   (proced-update t))
@@ -1724,7 +1726,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)
@@ -1735,8 +1739,9 @@ After sending the signal, this command runs the normal hook
                    (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)))))
+                   (completion-extra-properties
+                    '(:annotation-function
+                      (lambda (s) (cdr (assoc s proced-signal-list))))))
               (setq signal
                     (completing-read (concat "Send signal [" pnum
                                              "] (default TERM): ")
@@ -1770,7 +1775,7 @@ After sending the signal, this command runs the normal hook
                                       (number-to-string signal) signal))))
           (dolist (process process-alist)
             (with-temp-buffer
-              (condition-case err
+              (condition-case nil
                   (if (zerop (call-process
                               proced-signal-function nil t nil
                               signal (number-to-string (car process))))
@@ -1868,17 +1873,6 @@ buffer.  You can use it to recover marks."
   (message "Change in Proced buffer undone.
 Killed processes cannot be recovered by Emacs."))
 
-(defun proced-unload-function ()
-  "Unload the Proced library."
-  (save-current-buffer
-    (dolist (buf (buffer-list))
-      (set-buffer buf)
-      (when (eq major-mode 'proced-mode)
-        (funcall (or (default-value 'major-mode) 'fundamental-mode)))))
-  ;; continue standard unloading
-  nil)
-
 (provide 'proced)
 
-;; arch-tag: a6e312ad-9032-45aa-972d-31a8cfc545af
 ;;; proced.el ends here