From a8a1595cc36e607049e5bc39b658e085d62d83c9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 9 Sep 2022 03:38:42 +0200 Subject: [PATCH] Prefer defvar-keymap in proced.el * lisp/proced.el (proced-mode-map): Prefer defvar-keymap. --- lisp/proced.el | 106 ++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/lisp/proced.el b/lisp/proced.el index a27638d3679..52389beff79 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -445,60 +445,58 @@ Important: the match ends just after the marker.") (,(concat "^[" (char-to-string proced-marker-char) "]") ".+" (proced-move-to-goal-column) nil (0 'proced-marked)))) -(defvar proced-mode-map - (let ((km (make-sparse-keymap))) - ;; moving - (define-key km " " 'next-line) - (define-key km "n" 'next-line) - (define-key km "p" 'previous-line) - (define-key km "\C-n" 'next-line) - (define-key km "\C-p" 'previous-line) - (define-key km "\C-?" 'previous-line) - (define-key km [?\S-\ ] 'previous-line) - (define-key km [down] 'next-line) - (define-key km [up] 'previous-line) - ;; marking - (define-key km "d" 'proced-mark) ; Dired compatibility ("delete") - (define-key km "m" 'proced-mark) - (put 'proced-mark :advertised-binding "m") - (define-key km "u" 'proced-unmark) - (define-key km "\177" 'proced-unmark-backward) - (define-key km "M" 'proced-mark-all) - (define-key km "U" 'proced-unmark-all) - (define-key km "t" 'proced-toggle-marks) - (define-key km "C" 'proced-mark-children) - (define-key km "P" 'proced-mark-parents) - ;; filtering - (define-key km "f" 'proced-filter-interactive) - (define-key km [mouse-2] 'proced-refine) - (define-key km "\C-m" 'proced-refine) - ;; sorting - (define-key km "sc" 'proced-sort-pcpu) - (define-key km "sm" 'proced-sort-pmem) - (define-key km "sp" 'proced-sort-pid) - (define-key km "ss" 'proced-sort-start) - (define-key km "sS" 'proced-sort-interactive) - (define-key km "st" 'proced-sort-time) - (define-key km "su" 'proced-sort-user) - ;; similar to `Buffer-menu-sort-by-column' - (define-key km [header-line mouse-1] 'proced-sort-header) - (define-key km [header-line mouse-2] 'proced-sort-header) - (define-key km "T" 'proced-toggle-tree) - ;; formatting - (define-key km "F" 'proced-format-interactive) - ;; operate - (define-key km "o" 'proced-omit-processes) - (define-key km "x" 'proced-send-signal) ; Dired compatibility - (define-key km "k" 'proced-send-signal) ; kill processes - (define-key km "r" 'proced-renice) ; renice processes - ;; misc - (define-key km "h" 'describe-mode) - (define-key km "?" 'proced-help) - (define-key km [remap undo] 'proced-undo) - (define-key km [remap advertised-undo] 'proced-undo) - ;; Additional keybindings are inherited from `special-mode-map' - km) - "Keymap for Proced commands.") +(defvar-keymap proced-mode-map + :doc "Keymap for Proced commands." + ;; moving + "SPC" #'next-line + "n" #'next-line + "p" #'previous-line + "C-n" #'next-line + "C-p" #'previous-line + "S-SPC" #'previous-line + "" #'next-line + "" #'previous-line + ;; marking + "d" #'proced-mark ; Dired compatibility ("delete") + "m" #'proced-mark + "u" #'proced-unmark + "DEL" #'proced-unmark-backward + "M" #'proced-mark-all + "U" #'proced-unmark-all + "t" #'proced-toggle-marks + "C" #'proced-mark-children + "P" #'proced-mark-parents + ;; filtering + "f" #'proced-filter-interactive + "" #'proced-refine + "RET" #'proced-refine + ;; sorting + "s c" #'proced-sort-pcpu + "s m" #'proced-sort-pmem + "s p" #'proced-sort-pid + "s s" #'proced-sort-start + "s S" #'proced-sort-interactive + "s t" #'proced-sort-time + "s u" #'proced-sort-user + ;; similar to `Buffer-menu-sort-by-column' + " " #'proced-sort-header + " " #'proced-sort-header + "T" #'proced-toggle-tree + ;; formatting + "F" #'proced-format-interactive + ;; operate + "o" #'proced-omit-processes + "x" #'proced-send-signal ; Dired compatibility + "k" #'proced-send-signal ; kill processes + "r" #'proced-renice ; renice processes + ;; misc + "h" #'describe-mode + "?" #'proced-help + " " #'proced-undo + " " #'proced-undo + ;; Additional keybindings are inherited from `special-mode-map' + ) +(put 'proced-mark :advertised-binding "m") (easy-menu-define proced-menu proced-mode-map "Proced Menu." -- 2.39.2