]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/bs.el (bs-mode-map): Prefer defvar-keymap.
authorStefan Kangas <stefan@marxist.se>
Wed, 22 Jun 2022 10:34:05 +0000 (12:34 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 22 Jun 2022 11:28:25 +0000 (13:28 +0200)
lisp/bs.el

index cff19c81cb0bbf9d16863d67431e8e9586827c79..3b0c8008661a57cb4eab32ded9e64f8de83de959 100644 (file)
@@ -434,58 +434,61 @@ Used internally, only.")
 (defvar bs--marked-buffers nil
   "Currently marked buffers in Buffer Selection Menu.")
 
-(defvar bs-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map " "       'bs-select)
-    (define-key map "f"       'bs-select)
-    (define-key map "v"       'bs-view)
-    (define-key map "!"       'bs-select-in-one-window)
-    (define-key map [mouse-2] 'bs-mouse-select)
-    (define-key map "F"       'bs-select-other-frame)
-    (let ((key ?1))
-      (while (<= key ?9)
-       (define-key map (char-to-string key) 'digit-argument)
-       (setq key (1+ key))))
-    (define-key map "-"       'negative-argument)
-    (define-key map "\e-"     'negative-argument)
-    (define-key map "o"       'bs-select-other-window)
-    (define-key map "\C-o"    'bs-tmp-select-other-window)
-    (define-key map [mouse-3] 'bs-mouse-select-other-frame)
-    (define-key map [up]      'bs-up)
-    (define-key map "n"       'bs-down)
-    (define-key map "p"       'bs-up)
-    (define-key map [down]    'bs-down)
-    (define-key map "\C-m"    'bs-select)
-    (define-key map "b"       'bs-bury-buffer)
-    (define-key map "s"       'bs-save)
-    (define-key map "S"       'bs-show-sorted)
-    (define-key map "a"       'bs-toggle-show-all)
-    (define-key map "d"       'bs-delete)
-    (define-key map "\C-d"    'bs-delete-backward)
-    (define-key map "k"       'bs-delete)
-    (define-key map "g"       'bs-refresh)
-    (define-key map "C"       'bs-set-configuration-and-refresh)
-    (define-key map "c"       'bs-select-next-configuration)
-    (define-key map "q"       'bs-kill)
-    ;; (define-key map "z"       'bs-kill)
-    (define-key map "\C-c\C-c" 'bs-kill)
-    (define-key map "\C-g"    'bs-abort)
-    (define-key map "\C-]"    'bs-abort)
-    (define-key map "%"       'bs-toggle-readonly)
-    (define-key map "~"       'bs-clear-modified)
-    (define-key map "M"       'bs-toggle-current-to-show)
-    (define-key map "+"       'bs-set-current-buffer-to-show-always)
-    ;;(define-key map "-"       'bs-set-current-buffer-to-show-never)
-    (define-key map "t"       'bs-visit-tags-table)
-    (define-key map "m"       'bs-mark-current)
-    (define-key map "u"       'bs-unmark-current)
-    (define-key map "U"       'bs-unmark-all)
-    (define-key map "\177"    'bs-unmark-previous)
-    (define-key map ">"       'scroll-right)
-    (define-key map "<"       'scroll-left)
-    (define-key map "?"       'bs-help)
-    map)
-  "Keymap of `bs-mode'.")
+(defvar-keymap bs-mode-map
+  :doc "Keymap of `bs-mode'."
+  "SPC"     #'bs-select
+  "f"       #'bs-select
+  "v"       #'bs-view
+  "!"       #'bs-select-in-one-window
+  "F"       #'bs-select-other-frame
+  "1"       #'digit-argument
+  "2"       #'digit-argument
+  "3"       #'digit-argument
+  "4"       #'digit-argument
+  "5"       #'digit-argument
+  "6"       #'digit-argument
+  "7"       #'digit-argument
+  "8"       #'digit-argument
+  "9"       #'digit-argument
+  "-"       #'negative-argument
+  "ESC -"   #'negative-argument
+  "o"       #'bs-select-other-window
+  "C-o"     #'bs-tmp-select-other-window
+  "<up>"    #'bs-up
+  "n"       #'bs-down
+  "p"       #'bs-up
+  "<down>"  #'bs-down
+  "C-m"     #'bs-select
+  "b"       #'bs-bury-buffer
+  "s"       #'bs-save
+  "S"       #'bs-show-sorted
+  "a"       #'bs-toggle-show-all
+  "d"       #'bs-delete
+  "C-d"     #'bs-delete-backward
+  "k"       #'bs-delete
+  "g"       #'bs-refresh
+  "C"       #'bs-set-configuration-and-refresh
+  "c"       #'bs-select-next-configuration
+  "q"       #'bs-kill
+  ;; "z"       #'bs-kill
+  "C-c C-c" #'bs-kill
+  "C-g"     #'bs-abort
+  "C-]"     #'bs-abort
+  "%"       #'bs-toggle-readonly
+  "~"       #'bs-clear-modified
+  "M"       #'bs-toggle-current-to-show
+  "+"       #'bs-set-current-buffer-to-show-always
+  ;; "-"       #'bs-set-current-buffer-to-show-never
+  "t"       #'bs-visit-tags-table
+  "m"       #'bs-mark-current
+  "u"       #'bs-unmark-current
+  "U"       #'bs-unmark-all
+  "DEL"     #'bs-unmark-previous
+  ">"       #'scroll-right
+  "<"       #'scroll-left
+  "?"       #'bs-help
+  "<mouse-2>" #'bs-mouse-select
+  "<mouse-3>" #'bs-mouse-select-other-frame)
 
 ;; ----------------------------------------------------------------------
 ;; Functions