aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-12-01 20:15:52 +0200
committerEli Zaretskii2022-12-01 20:15:52 +0200
commit9c58ea37afc044a49fdd59fb4d1b8b6dd2d49ca9 (patch)
treea590b1156e35f51a158fd515f5bb96ec7dee64e9
parent0c1495574a14b9131a0c0a8ef126976393a00e3d (diff)
downloademacs-9c58ea37afc044a49fdd59fb4d1b8b6dd2d49ca9.tar.gz
emacs-9c58ea37afc044a49fdd59fb4d1b8b6dd2d49ca9.zip
; Fix last change in proced.el
* lisp/proced.el (proced-low-memory-usage-threshold) (proced-medium-memory-usage-threshold, proced-run-status-code) (proced-interruptible-sleep-status-code) (proced-uninterruptible-sleep-status-code, proced-executable): Fix doc strings. (proced-format-time): Simplify the format, to avoid bogus warnings from the byte-compiler. * etc/NEWS: Move Proced entries to one place and fix their wording.
-rw-r--r--etc/NEWS32
-rw-r--r--lisp/proced.el91
2 files changed, 71 insertions, 52 deletions
diff --git a/etc/NEWS b/etc/NEWS
index bfd9b5f26e7..547b488a57b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -504,14 +504,6 @@ option) and can be set to nil to disable Just-in-time Lock mode.
504 504
505* Changes in Emacs 29.1 505* Changes in Emacs 29.1
506 506
507---
508** New user option `proced-enable-color-flag` to enable coloring of proced buffers
509This option prompts some format functions to furnish their respective
510process attributes with colors in a manner similar to htop.
511
512This option is disabled by default and needs setting to a non-nil
513value to take effect.
514
515+++ 507+++
516** New user option 'major-mode-remap-alist' to specify favorite major modes. 508** New user option 'major-mode-remap-alist' to specify favorite major modes.
517This user option lets you remap the default modes (e.g. 'perl-mode' or 509This user option lets you remap the default modes (e.g. 'perl-mode' or
@@ -2818,6 +2810,22 @@ Set it to nil to exclude line numbering from kills and copies.
2818argument which allows tree-widget display to be activated and computed 2810argument which allows tree-widget display to be activated and computed
2819only when the user expands the node. 2811only when the user expands the node.
2820 2812
2813** Proced
2814
2815---
2816*** proced.el shows system processes of remote hosts.
2817When 'default-directory' is remote, and 'proced' is invoked with a
2818negative argument like 'C-u - proced', the system processes of that
2819remote host are shown. Alternatively, the user option
2820'proced-show-remote-processes' can be set to non-nil.
2821'proced-signal-function' has been marked obsolete.
2822
2823---
2824*** Proced can now optionally show process details in color.
2825New user option 'proced-enable-color-flag' enables coloring of Proced
2826buffers. This option is disabled by default; customize it to a
2827non-nil value to enable colors.
2828
2821** Miscellaneous 2829** Miscellaneous
2822 2830
2823--- 2831---
@@ -2904,14 +2912,6 @@ also been renamed:
2904 'unread-bib' to 'bib-unread' 2912 'unread-bib' to 'bib-unread'
2905 2913
2906--- 2914---
2907*** proced.el shows system processes of remote hosts.
2908When 'default-directory' is remote, and 'proced' is invoked with a
2909negative argument like 'C-u - proced', the system processes of that
2910remote host are shown. Alternatively, the user option
2911'proced-show-remote-processes' can be set to non-nil.
2912'proced-signal-function' has been marked obsolete.
2913
2914---
2915*** 'outlineify-sticky' command is renamed to 'allout-outlinify-sticky'. 2915*** 'outlineify-sticky' command is renamed to 'allout-outlinify-sticky'.
2916The old name is still available as an obsolete function alias. 2916The old name is still available as an obsolete function alias.
2917 2917
diff --git a/lisp/proced.el b/lisp/proced.el
index f91d3d2f223..c7419288edf 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -114,38 +114,55 @@ the external command (usually \"kill\")."
114(defcustom proced-grammar-alist 114(defcustom proced-grammar-alist
115 '( ;; attributes defined in `process-attributes' 115 '( ;; attributes defined in `process-attributes'
116 (euid "EUID" "%d" right proced-< nil (euid pid) (nil t nil)) 116 (euid "EUID" "%d" right proced-< nil (euid pid) (nil t nil))
117 (user "User" proced-format-user left proced-string-lessp nil (user pid) (nil t nil)) 117 (user "User" proced-format-user left proced-string-lessp nil
118 (user pid) (nil t nil))
118 (egid "EGID" "%d" right proced-< nil (egid euid pid) (nil t nil)) 119 (egid "EGID" "%d" right proced-< nil (egid euid pid) (nil t nil))
119 (group "Group" nil left proced-string-lessp nil (group user pid) (nil t nil)) 120 (group "Group" nil left proced-string-lessp nil (group user pid)
121 (nil t nil))
120 (comm "Command" nil left proced-string-lessp nil (comm pid) (nil t nil)) 122 (comm "Command" nil left proced-string-lessp nil (comm pid) (nil t nil))
121 (state "Stat" proced-format-state left proced-string-lessp nil (state pid) (nil t nil)) 123 (state "Stat" proced-format-state left proced-string-lessp nil
124 (state pid) (nil t nil))
122 (ppid "PPID" proced-format-ppid right proced-< nil (ppid pid) 125 (ppid "PPID" proced-format-ppid right proced-< nil (ppid pid)
123 ((lambda (ppid) (proced-filter-parents proced-process-alist ppid)) 126 ((lambda (ppid)
124 "refine to process parents")) 127 (proced-filter-parents proced-process-alist ppid))
125 (pgrp "PGrp" proced-format-pgrp right proced-< nil (pgrp euid pid) (nil t nil)) 128 "refine to process parents"))
126 (sess "Sess" proced-format-sess right proced-< nil (sess pid) (nil t nil)) 129 (pgrp "PGrp" proced-format-pgrp right proced-< nil (pgrp euid pid)
127 (ttname "TTY" proced-format-ttname left proced-string-lessp nil (ttname pid) (nil t nil)) 130 (nil t nil))
131 (sess "Sess" proced-format-sess right proced-< nil (sess pid)
132 (nil t nil))
133 (ttname "TTY" proced-format-ttname left proced-string-lessp nil
134 (ttname pid) (nil t nil))
128 (tpgid "TPGID" "%d" right proced-< nil (tpgid pid) (nil t nil)) 135 (tpgid "TPGID" "%d" right proced-< nil (tpgid pid) (nil t nil))
129 (minflt "MinFlt" "%d" right proced-< nil (minflt pid) (nil t t)) 136 (minflt "MinFlt" "%d" right proced-< nil (minflt pid) (nil t t))
130 (majflt "MajFlt" "%d" right proced-< nil (majflt pid) (nil t t)) 137 (majflt "MajFlt" "%d" right proced-< nil (majflt pid) (nil t t))
131 (cminflt "CMinFlt" "%d" right proced-< nil (cminflt pid) (nil t t)) 138 (cminflt "CMinFlt" "%d" right proced-< nil (cminflt pid) (nil t t))
132 (cmajflt "CMajFlt" "%d" right proced-< nil (cmajflt pid) (nil t t)) 139 (cmajflt "CMajFlt" "%d" right proced-< nil (cmajflt pid) (nil t t))
133 (utime "UTime" proced-format-time right proced-time-lessp t (utime pid) (nil t t)) 140 (utime "UTime" proced-format-time right proced-time-lessp t (utime pid)
134 (stime "STime" proced-format-time right proced-time-lessp t (stime pid) (nil t t)) 141 (nil t t))
135 (time "Time" proced-format-time right proced-time-lessp t (time pid) (nil t t)) 142 (stime "STime" proced-format-time right proced-time-lessp t (stime pid)
136 (cutime "CUTime" proced-format-time right proced-time-lessp t (cutime pid) (nil t t)) 143 (nil t t))
137 (cstime "CSTime" proced-format-time right proced-time-lessp t (cstime pid) (nil t t)) 144 (time "Time" proced-format-time right proced-time-lessp t (time pid)
138 (ctime "CTime" proced-format-time right proced-time-lessp t (ctime pid) (nil t t)) 145 (nil t t))
146 (cutime "CUTime" proced-format-time right proced-time-lessp t (cutime pid)
147 (nil t t))
148 (cstime "CSTime" proced-format-time right proced-time-lessp t (cstime pid)
149 (nil t t))
150 (ctime "CTime" proced-format-time right proced-time-lessp t (ctime pid)
151 (nil t t))
139 (pri "Pr" "%d" right proced-< t (pri pid) (nil t t)) 152 (pri "Pr" "%d" right proced-< t (pri pid) (nil t t))
140 (nice "Ni" "%3d" 3 proced-< t (nice pid) (t t nil)) 153 (nice "Ni" "%3d" 3 proced-< t (nice pid) (t t nil))
141 (thcount "THCount" "%d" right proced-< t (thcount pid) (nil t t)) 154 (thcount "THCount" "%d" right proced-< t (thcount pid) (nil t t))
142 (start "Start" proced-format-start 6 proced-time-lessp nil (start pid) (t t nil)) 155 (start "Start" proced-format-start 6 proced-time-lessp nil (start pid)
143 (vsize "VSize" proced-format-memory right proced-< t (vsize pid) (nil t t)) 156 (t t nil))
157 (vsize "VSize" proced-format-memory right proced-< t (vsize pid)
158 (nil t t))
144 (rss "RSS" proced-format-rss right proced-< t (rss pid) (nil t t)) 159 (rss "RSS" proced-format-rss right proced-< t (rss pid) (nil t t))
145 (etime "ETime" proced-format-time right proced-time-lessp t (etime pid) (nil t t)) 160 (etime "ETime" proced-format-time right proced-time-lessp t (etime pid)
161 (nil t t))
146 (pcpu "%CPU" proced-format-cpu right proced-< t (pcpu pid) (nil t t)) 162 (pcpu "%CPU" proced-format-cpu right proced-< t (pcpu pid) (nil t t))
147 (pmem "%Mem" proced-format-mem right proced-< t (pmem pid) (nil t t)) 163 (pmem "%Mem" proced-format-mem right proced-< t (pmem pid) (nil t t))
148 (args "Args" proced-format-args left proced-string-lessp nil (args pid) (nil t nil)) 164 (args "Args" proced-format-args left proced-string-lessp nil
165 (args pid) (nil t nil))
149 ;; 166 ;;
150 ;; attributes defined by proced (see `proced-process-attributes') 167 ;; attributes defined by proced (see `proced-process-attributes')
151 (pid "PID" proced-format-pid right proced-< nil (pid) 168 (pid "PID" proced-format-pid right proced-< nil (pid)
@@ -373,23 +390,23 @@ May be used to revert the process listing."
373 :version "29.1") 390 :version "29.1")
374 391
375(defcustom proced-low-memory-usage-threshold 0.1 392(defcustom proced-low-memory-usage-threshold 0.1
376 "The upper bound for low memory usage, relative to total memory. 393 "The upper bound for low relative memory usage display in Proced.
377 394
378When `proced-enable-color-flag' is non-nil, RSS values denoting a proportion 395When `proced-enable-color-flag' is non-nil, RSS values denoting a
379of memory lower than this value will be displayed using the 396proportion of memory, relative to total memory, that is lower
380`proced-memory-low-usage' face." 397than this value will be displayed using the `proced-memory-low-usage' face."
381 :type 'float 398 :type 'float
382 :version "29.1") 399 :version "29.1")
383 400
384(defcustom proced-medium-memory-usage-threshold 0.5 401(defcustom proced-medium-memory-usage-threshold 0.5
385 "The upper bound for medium memory usage, relative to total memory. 402 "The upper bound for medium relative memory usage display in Proced.
386 403
387When `proced-enable-color-flag' is non-nil, RSS values denoting a proportion 404When `proced-enable-color-flag' is non-nil, RSS values denoting a
388of memory less than this value, but greater than 405proportion of memory, relative to total memory, that is less than
389`proced-low-memory-usage-threshold', will be displayed using the 406this value, but greater than `proced-low-memory-usage-threshold',
390`proced-memory-medium-usage' face. RSS values denoting a greater proportion 407will be displayed using the `proced-memory-medium-usage' face.
391than this value will be displayed using the `proced-memory-high-usage' 408RSS values denoting a greater proportion than this value will be
392face." 409displayed using the `proced-memory-high-usage' face."
393 :type 'float 410 :type 'float
394 :version "29.1") 411 :version "29.1")
395 412
@@ -431,19 +448,19 @@ It is a list of lists (KEY PREDICATE REVERSE).")
431 448
432(defface proced-run-status-code 449(defface proced-run-status-code
433 '((t (:foreground "green"))) 450 '((t (:foreground "green")))
434 "Face used in Proced buffers for the running or runnable status code character \"R\"." 451 "Face used in Proced buffers for running or runnable status code character \"R\"."
435 :version "29.1") 452 :version "29.1")
436 453
437(defface proced-interruptible-sleep-status-code 454(defface proced-interruptible-sleep-status-code
438 '((((class color) (min-colors 88)) (:foreground "DimGrey")) 455 '((((class color) (min-colors 88)) (:foreground "DimGrey"))
439 (t (:italic t))) 456 (t (:italic t)))
440 "Face used in Proced buffers for the interruptible sleep status code character \"S\"." 457 "Face used in Proced buffers for interruptible sleep status code character \"S\"."
441 :version "29.1") 458 :version "29.1")
442 459
443(defface proced-uninterruptible-sleep-status-code 460(defface proced-uninterruptible-sleep-status-code
444 '((((class color)) (:foreground "red")) 461 '((((class color)) (:foreground "red"))
445 (t (:bold t))) 462 (t (:bold t)))
446 "Face used in Proced buffers for the uninterruptible sleep status code character \"D\"." 463 "Face used in Proced buffers for uninterruptible sleep status code character \"D\"."
447 :version "29.1") 464 :version "29.1")
448 465
449(defface proced-executable 466(defface proced-executable
@@ -451,7 +468,9 @@ It is a list of lists (KEY PREDICATE REVERSE).")
451 (((class color) (background dark)) (:foreground "cyan")) 468 (((class color) (background dark)) (:foreground "cyan"))
452 (((class color) (background light)) (:foreground "blue")) 469 (((class color) (background light)) (:foreground "blue"))
453 (t (:bold t))) 470 (t (:bold t)))
454 "Face used in Proced buffers for executables (first word in the args process attribute)." 471 "Face used in Proced buffers for executable names.
472The first word in the process arguments attribute is assumed to
473be the executable that runs in the process."
455 :version "29.1") 474 :version "29.1")
456 475
457(defface proced-memory-high-usage 476(defface proced-memory-high-usage
@@ -1529,9 +1548,9 @@ Prefix ARG controls sort order, see `proced-sort-interactive'."
1529 (propertize ":" 'font-lock-face 'proced-time-colon) 1548 (propertize ":" 'font-lock-face 'proced-time-colon)
1530 ":"))) 1549 ":")))
1531 (cond ((< 0 days) 1550 (cond ((< 0 days)
1532 (format "%d-%02d%3$s%02d%3$s%02d" days hours colon minutes seconds)) 1551 (format "%d-%02d%s%02d%s%02d" days hours colon minutes colon seconds))
1533 ((< 0 hours) 1552 ((< 0 hours)
1534 (format "%02d%2$s%02d%2$s%02d" hours colon minutes seconds)) 1553 (format "%02d%s%02d%s%02d" hours colon minutes colon seconds))
1535 (t 1554 (t
1536 (format "%02d%s%02d" minutes colon seconds))))) 1555 (format "%02d%s%02d" minutes colon seconds)))))
1537 1556