Function: proced-mode

proced-mode is a byte-compiled function defined in proced.el.gz.

Signature

(proced-mode)

Documentation

Mode for displaying system processes and sending signals to them.

Type M-x proced (proced) to start a Proced session. In a Proced buffer type m (proced-mark) to mark a process for later commands. Type k (proced-send-signal) to send signals to marked processes. Type r (proced-renice) to renice marked processes.

The initial content of a listing is defined by the variable proced-filter(var)/proced-filter(fun) and the variable proced-format(var)/proced-format(fun).

The variable proced-filter(var)/proced-filter(fun) specifies which system processes are displayed.

The variable proced-format(var)/proced-format(fun) specifies which attributes are displayed for each process.

Type f (proced-filter-interactive) and F (proced-format-interactive) to change the values of proced-filter(var)/proced-filter(fun) and proced-format(var)/proced-format(fun). The current value of the variable proced-filter(var)/proced-filter(fun) is indicated in the mode line.

The sort order of Proced listings is defined by the variable proced-sort(var)/proced-sort(fun). Type s S (proced-sort-interactive) or click on a header in the header line to change the sort scheme. The current sort scheme is indicated in the mode line, using
"+" or "-" for ascending or descending sort order.

Type T (proced-toggle-tree) to toggle whether the listing is displayed as process tree.

Type M-x proced-toggle-auto-update (proced-toggle-auto-update) to automatically update the process list. The time interval for updates can be configured via proced-auto-update-interval.

An existing Proced listing can be refined by typing RET (proced-refine). Refining an existing listing does not update the variable proced-filter(var)/proced-filter(fun).

The attribute-specific rules for formatting, filtering, sorting, and refining are defined in proced-grammar-alist.

After displaying or updating a Proced buffer, Proced runs the normal hook proced-post-display-hook.

<down> next-line
<header-line> <mouse-1> proced-sort-header
<header-line> <mouse-2> proced-sort-header
<mouse-2> proced-refine
<up> previous-line
? proced-help
C proced-mark-children
C-n next-line
C-p previous-line
C-x u proced-undo
DEL proced-unmark-backward
F proced-format-interactive
M proced-mark-all
P proced-mark-parents
RET proced-refine
S-SPC previous-line
SPC next-line
T proced-toggle-tree
U proced-unmark-all
d proced-mark
f proced-filter-interactive
h describe-mode
k proced-send-signal
m proced-mark
n next-line
o proced-omit-processes
p previous-line
r proced-renice
s S proced-sort-interactive
s c proced-sort-pcpu
s m proced-sort-pmem
s p proced-sort-pid
s s proced-sort-start
s t proced-sort-time
s u proced-sort-user
t proced-toggle-marks
u proced-unmark
x proced-send-signal

In addition to any hooks its parent mode special-mode might have run, this mode runs the hook proced-mode-hook, as the final or penultimate step during initialization.

Source Code

;; Defined in /usr/src/emacs/lisp/proced.el.gz
;; proced mode

(define-derived-mode proced-mode special-mode "Proced"
  "Mode for displaying system processes and sending signals to them.
Type \\[proced] to start a Proced session.  In a Proced buffer
type \\<proced-mode-map>\\[proced-mark] to mark a process for later commands.
Type \\[proced-send-signal] to send signals to marked processes.
Type \\[proced-renice] to renice marked processes.

The initial content of a listing is defined by the variable
`proced-filter' and the variable `proced-format'.

The variable `proced-filter' specifies which system processes are
displayed.

The variable `proced-format' specifies which attributes are
displayed for each process.

Type \\[proced-filter-interactive] and \\[proced-format-interactive] to \
change the values of `proced-filter' and
`proced-format'.  The current value of the variable
`proced-filter' is indicated in the mode line.

The sort order of Proced listings is defined by the variable `proced-sort'.
Type \\[proced-sort-interactive] or click on a header in the header \
line to change the sort scheme.
The current sort scheme is indicated in the mode line, using
\"+\" or \"-\" for ascending or descending sort order.

Type \\[proced-toggle-tree] to toggle whether the listing is displayed as process tree.

Type \\[proced-toggle-auto-update] to automatically update the
process list.  The time interval for updates can be configured
via `proced-auto-update-interval'.

An existing Proced listing can be refined by typing \\[proced-refine].
Refining an existing listing does not update the variable `proced-filter'.

The attribute-specific rules for formatting, filtering, sorting,
and refining are defined in `proced-grammar-alist'.

After displaying or updating a Proced buffer, Proced runs the
normal hook `proced-post-display-hook'.

\\{proced-mode-map}"
  :interactive nil
  (abbrev-mode 0)
  (auto-fill-mode 0)
  (setq buffer-read-only t
        truncate-lines t
        header-line-format '(:eval (proced-header-line)))
  (add-hook 'post-command-hook #'force-mode-line-update nil t)  ;; FIXME: Why?
  (setq-local revert-buffer-function #'proced-revert)
  (setq-local font-lock-defaults
              '(proced-font-lock-keywords t nil nil beginning-of-line))
  (setq-local switch-to-buffer-preserve-window-point nil)
  ;; So that the heading scales together with the body of the table.
  (setq-local text-scale-remap-header-line t)
  (if (and (not proced-auto-update-timer) proced-auto-update-interval)
      (setq proced-auto-update-timer
            (run-at-time t proced-auto-update-interval
                         'proced-auto-update-timer))))