aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-11-19 08:09:22 +0000
committerGlenn Morris2008-11-19 08:09:22 +0000
commit667df88c0dddc0b42230b4f7d3b93d20fd2adb01 (patch)
tree2deea7542645e720853740dc624572c49a7ed5ae
parent8f7028a84cda66daeee45844f351c946dc050b29 (diff)
downloademacs-667df88c0dddc0b42230b4f7d3b93d20fd2adb01.tar.gz
emacs-667df88c0dddc0b42230b4f7d3b93d20fd2adb01.zip
(proced, proced-format-time): Doc fixes.
(proced-process-attributes): Signal an error if unsupported. (Bug#1314)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/proced.el45
2 files changed, 29 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 39fc2682527..a13050b45da 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-11-19 Glenn Morris <rgm@gnu.org>
2
3 * proced.el (proced, proced-format-time): Doc fixes.
4 (proced-process-attributes): Signal an error if unsupported. (Bug#1314)
5
12008-11-19 Karl Fogel <kfogel@red-bean.com> 62008-11-19 Karl Fogel <kfogel@red-bean.com>
2 7
3 * bookmark.el (bookmark-jump-noselect): Move the deprecation 8 * bookmark.el (bookmark-jump-noselect): Move the deprecation
diff --git a/lisp/proced.el b/lisp/proced.el
index 77247eef34c..dcb60e361f8 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -583,7 +583,7 @@ are defined in `proced-grammar-alist'.
583If invoked with optional ARG the window displaying the process 583If invoked with optional ARG the window displaying the process
584information will be displayed but not selected. 584information will be displayed but not selected.
585 585
586See `proced-mode' for a descreption of features available in Proced buffers." 586See `proced-mode' for a description of features available in Proced buffers."
587 (interactive "P") 587 (interactive "P")
588 (let ((buffer (get-buffer-create "*Proced*")) new) 588 (let ((buffer (get-buffer-create "*Proced*")) new)
589 (set-buffer buffer) 589 (set-buffer buffer)
@@ -1074,7 +1074,7 @@ This command updates the variable `proced-sort'."
1074;;; Formating 1074;;; Formating
1075 1075
1076(defun proced-format-time (time) 1076(defun proced-format-time (time)
1077 "Format time intervall TIME." 1077 "Format time interval TIME."
1078 (let* ((ftime (float-time time)) 1078 (let* ((ftime (float-time time))
1079 (days (truncate ftime 86400)) 1079 (days (truncate ftime 86400))
1080 (ftime (mod ftime 86400)) 1080 (ftime (mod ftime 86400))
@@ -1233,25 +1233,28 @@ With prefix REVERT non-nil revert listing."
1233(defun proced-process-attributes () 1233(defun proced-process-attributes ()
1234 "Return alist of attributes for each system process. 1234 "Return alist of attributes for each system process.
1235This alist can be customized via `proced-custom-attributes'." 1235This alist can be customized via `proced-custom-attributes'."
1236 (mapcar (lambda (pid) 1236 (let ((procs (list-system-processes)))
1237 (let* ((attributes (system-process-attributes pid)) 1237 (if procs
1238 (utime (cdr (assq 'utime attributes))) 1238 (mapcar (lambda (pid)
1239 (stime (cdr (assq 'stime attributes))) 1239 (let* ((attributes (system-process-attributes pid))
1240 (cutime (cdr (assq 'cutime attributes))) 1240 (utime (cdr (assq 'utime attributes)))
1241 (cstime (cdr (assq 'cstime attributes))) 1241 (stime (cdr (assq 'stime attributes)))
1242 attr) 1242 (cutime (cdr (assq 'cutime attributes)))
1243 (setq attributes 1243 (cstime (cdr (assq 'cstime attributes)))
1244 (append (list (cons 'pid pid)) 1244 attr)
1245 (if (and utime stime) 1245 (setq attributes
1246 (list (cons 'time (time-add utime stime)))) 1246 (append (list (cons 'pid pid))
1247 (if (and cutime cstime) 1247 (if (and utime stime)
1248 (list (cons 'ctime (time-add cutime cstime)))) 1248 (list (cons 'time (time-add utime stime))))
1249 attributes)) 1249 (if (and cutime cstime)
1250 (dolist (fun proced-custom-attributes) 1250 (list (cons 'ctime (time-add cutime cstime))))
1251 (if (setq attr (funcall fun attributes)) 1251 attributes))
1252 (push attr attributes))) 1252 (dolist (fun proced-custom-attributes)
1253 (cons pid attributes))) 1253 (if (setq attr (funcall fun attributes))
1254 (list-system-processes))) 1254 (push attr attributes)))
1255 (cons pid attributes)))
1256 procs)
1257 (error "Proced is not available on this system"))))
1255 1258
1256(defun proced-update (&optional revert quiet) 1259(defun proced-update (&optional revert quiet)
1257 "Update the `proced' process information. Preserves point and marks. 1260 "Update the `proced' process information. Preserves point and marks.