From 079ba9b790ab68ed2fbda83c68560b4752d3b8fe Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 Apr 2008 03:07:49 +0000 Subject: [PATCH] (proced-mode): Redefine as just the major-mode. (proced): Separate it from proced-mode. --- lisp/ChangeLog | 3 +++ lisp/proced.el | 41 +++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d68feaf4bf1..106ed5d2107 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2008-04-16 Stefan Monnier + * proced.el (proced-mode): Redefine as just the major-mode. + (proced): Separate it from proced-mode. + * vc.el: Rename vc-status to vc-dir and the vc-status var to vc-ewoc. 2008-04-15 Stefan Monnier diff --git a/lisp/proced.el b/lisp/proced.el index 743978b42e7..126efdc5587 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -227,7 +227,25 @@ Return the position of the beginning of the process name, or nil if none found." proced-command-alist))) "\\s-+\\S-+"))) -(defun proced-mode (&optional arg) +(define-derived-mode proced-mode nil "Proced" + "Mode for displaying UNIX system processes and sending signals to them. +Type \\[proced-mark-process] to mark a process for later commands. +Type \\[proced-send-signal] to send signals to marked processes. + +\\{proced-mode-map}" + (abbrev-mode 0) + (auto-fill-mode 0) + (setq buffer-read-only t + truncate-lines t) + (set (make-local-variable 'revert-buffer-function) 'proced-revert) + (set (make-local-variable 'font-lock-defaults) + '(proced-font-lock-keywords t nil nil beginning-of-line))) + +;; Proced mode is suitable only for specially formatted data. +(put 'proced-mode 'mode-class 'special) + +;;;###autoload +(defun proced (&optional arg) "Mode for displaying UNIX system processes and sending signals to them. Type \\[proced-mark-process] to mark a process for later commands. Type \\[proced-send-signal] to send signals to marked processes. @@ -240,18 +258,7 @@ information will be displayed but not selected. (let ((proced-buffer (get-buffer-create "*Process Info*")) new) (set-buffer proced-buffer) (setq new (zerop (buffer-size))) - (when new - (kill-all-local-variables) - (use-local-map proced-mode-map) - (abbrev-mode 0) - (auto-fill-mode 0) - (setq buffer-read-only t - truncate-lines t - major-mode 'proced-mode - mode-name "Proced") - (set (make-local-variable 'revert-buffer-function) 'proced-revert) - (set (make-local-variable 'font-lock-defaults) - '(proced-font-lock-keywords t nil nil beginning-of-line))) + (when new (proced-mode)) (if (or new arg) (proced-update)) @@ -260,14 +267,8 @@ information will be displayed but not selected. (display-buffer proced-buffer) (pop-to-buffer proced-buffer) (message (substitute-command-keys - "type \\[quit-window] to quit, \\[proced-help] for help"))) - (if new (run-mode-hooks 'proced-mode-hook)))) + "type \\[quit-window] to quit, \\[proced-help] for help"))))) -;; Proced mode is suitable only for specially formatted data. -(put 'proced-mode 'mode-class 'special) - -;;;###autoload -(defalias 'proced 'proced-mode) (defun proced-mark (&optional count) "Mark the current (or next COUNT) processes." -- 2.39.5