[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/proced.el,v
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/proced.el,v |
Date: |
Thu, 20 Nov 2008 02:43:30 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Glenn Morris <gm> 08/11/20 02:43:29
Index: proced.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/proced.el,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- proced.el 19 Nov 2008 08:08:28 -0000 1.22
+++ proced.el 20 Nov 2008 02:43:29 -0000 1.23
@@ -574,6 +574,9 @@
(setq proced-timer
(run-at-time t proced-timer-interval 'proced-timer))))
+(defvar proced-available nil
+ "Non-nil means Proced is known to work on this system.")
+
;; Proced mode is suitable only for specially formatted data.
(put 'proced-mode 'mode-class 'special)
@@ -585,6 +588,9 @@
See `proced-mode' for a description of features available in Proced buffers."
(interactive "P")
+ (or proced-available
+ (setq proced-available (not (null (list-system-processes))))
+ (error "Proced is not available on this system"))
(let ((buffer (get-buffer-create "*Proced*")) new)
(set-buffer buffer)
(setq new (zerop (buffer-size)))
@@ -1233,8 +1239,6 @@
(defun proced-process-attributes ()
"Return alist of attributes for each system process.
This alist can be customized via `proced-custom-attributes'."
- (let ((procs (list-system-processes)))
- (if procs
(mapcar (lambda (pid)
(let* ((attributes (system-process-attributes pid))
(utime (cdr (assq 'utime attributes)))
@@ -1253,8 +1257,7 @@
(if (setq attr (funcall fun attributes))
(push attr attributes)))
(cons pid attributes)))
- procs)
- (error "Proced is not available on this system"))))
+ (list-system-processes)))
(defun proced-update (&optional revert quiet)
"Update the `proced' process information. Preserves point and marks.