emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e964705921 1/2: Prefer defvar-keymap for artist-mode-map


From: Stefan Kangas
Subject: master e964705921 1/2: Prefer defvar-keymap for artist-mode-map
Date: Thu, 16 Jun 2022 04:00:23 -0400 (EDT)

branch: master
commit e9647059212116b46cb3e44e398d4db3805f94f7
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Prefer defvar-keymap for artist-mode-map
    
    * lisp/textmodes/artist.el (artist-mode-map): Prefer
    defvar-keymap.
---
 lisp/textmodes/artist.el | 105 +++++++++++++++++++++++------------------------
 1 file changed, 51 insertions(+), 54 deletions(-)

diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index ff4311c3ac..9912c0fcfc 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -475,60 +475,57 @@ This variable is initialized by the 
`artist-make-prev-next-op-alist' function.")
 (defvar artist-arrow-point-1 nil)
 (defvar artist-arrow-point-2 nil)
 
-(defvar artist-mode-map
-  (let ((map (make-sparse-keymap)))
-    (setq artist-mode-map (make-sparse-keymap))
-    (define-key map [down-mouse-1] 'artist-down-mouse-1)
-    (define-key map [S-down-mouse-1] 'artist-down-mouse-1)
-    (define-key map [down-mouse-2] 'artist-mouse-choose-operation)
-    (define-key map [S-down-mouse-2] 'artist-mouse-choose-operation)
-    (define-key map [down-mouse-3] 'artist-down-mouse-3)
-    (define-key map [S-down-mouse-3] 'artist-down-mouse-3)
-    (define-key map [C-mouse-4] 'artist-select-prev-op-in-list)
-    (define-key map [C-mouse-5] 'artist-select-next-op-in-list)
-    (define-key map "\r" 'artist-key-set-point) ; return
-    (define-key map [up] 'artist-previous-line)
-    (define-key map "\C-p" 'artist-previous-line)
-    (define-key map [down] 'artist-next-line)
-    (define-key map "\C-n" 'artist-next-line)
-    (define-key map [left] 'artist-backward-char)
-    (define-key map "\C-b" 'artist-backward-char)
-    (define-key map [right] 'artist-forward-char)
-    (define-key map "\C-f" 'artist-forward-char)
-    (define-key map "<" 'artist-toggle-first-arrow)
-    (define-key map ">" 'artist-toggle-second-arrow)
-    (define-key map "\C-c\C-a\C-e" 'artist-select-erase-char)
-    (define-key map "\C-c\C-a\C-f" 'artist-select-fill-char)
-    (define-key map "\C-c\C-a\C-l" 'artist-select-line-char)
-    (define-key map "\C-c\C-a\C-o" 'artist-select-operation)
-    (define-key map "\C-c\C-a\C-r" 'artist-toggle-rubber-banding)
-    (define-key map "\C-c\C-a\C-t" 'artist-toggle-trim-line-endings)
-    (define-key map "\C-c\C-a\C-s" 'artist-toggle-borderless-shapes)
-    (define-key map "\C-c\C-c"     'artist-mode-off)
-    (define-key map "\C-c\C-al"    'artist-select-op-line)
-    (define-key map "\C-c\C-aL"    'artist-select-op-straight-line)
-    (define-key map "\C-c\C-ar"    'artist-select-op-rectangle)
-    (define-key map "\C-c\C-aR"    'artist-select-op-square)
-    (define-key map "\C-c\C-as"    'artist-select-op-square)
-    (define-key map "\C-c\C-ap"    'artist-select-op-poly-line)
-    (define-key map "\C-c\C-aP"    'artist-select-op-straight-poly-line)
-    (define-key map "\C-c\C-ae"    'artist-select-op-ellipse)
-    (define-key map "\C-c\C-ac"    'artist-select-op-circle)
-    (define-key map "\C-c\C-at"    'artist-select-op-text-see-thru)
-    (define-key map "\C-c\C-aT"    'artist-select-op-text-overwrite)
-    (define-key map "\C-c\C-aS"    'artist-select-op-spray-can)
-    (define-key map "\C-c\C-az"    'artist-select-op-spray-set-size)
-    (define-key map "\C-c\C-a\C-d" 'artist-select-op-erase-char)
-    (define-key map "\C-c\C-aE"    'artist-select-op-erase-rectangle)
-    (define-key map "\C-c\C-av"    'artist-select-op-vaporize-line)
-    (define-key map "\C-c\C-aV"    'artist-select-op-vaporize-lines)
-    (define-key map "\C-c\C-a\C-k" 'artist-select-op-cut-rectangle)
-    (define-key map "\C-c\C-a\M-w" 'artist-select-op-copy-rectangle)
-    (define-key map "\C-c\C-a\C-y" 'artist-select-op-paste)
-    (define-key map "\C-c\C-af"    'artist-select-op-flood-fill)
-    (define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report)
-    map)
-  "Keymap for `artist-mode'.")
+(defvar-keymap artist-mode-map
+  :doc "Keymap for `artist-mode'."
+  "<down-mouse-1>"   #'artist-down-mouse-1
+  "S-<down-mouse-1>" #'artist-down-mouse-1
+  "<down-mouse-2>"   #'artist-mouse-choose-operation
+  "S-<down-mouse-2>" #'artist-mouse-choose-operation
+  "<down-mouse-3>"   #'artist-down-mouse-3
+  "S-<down-mouse-3>" #'artist-down-mouse-3
+  "C-<mouse-4>"      #'artist-select-prev-op-in-list
+  "C-<mouse-5>"      #'artist-select-next-op-in-list
+  "RET"              #'artist-key-set-point ; return
+  "<up>"             #'artist-previous-line
+  "C-p"              #'artist-previous-line
+  "<down>"           #'artist-next-line
+  "C-n"              #'artist-next-line
+  "<left>"           #'artist-backward-char
+  "C-b"              #'artist-backward-char
+  "<right>"          #'artist-forward-char
+  "C-f"              #'artist-forward-char
+  "<"                #'artist-toggle-first-arrow
+  ">"                #'artist-toggle-second-arrow
+  "C-c C-a C-e"      #'artist-select-erase-char
+  "C-c C-a C-f"      #'artist-select-fill-char
+  "C-c C-a C-l"      #'artist-select-line-char
+  "C-c C-a C-o"      #'artist-select-operation
+  "C-c C-a C-r"      #'artist-toggle-rubber-banding
+  "C-c C-a C-t"      #'artist-toggle-trim-line-endings
+  "C-c C-a C-s"      #'artist-toggle-borderless-shapes
+  "C-c C-c"          #'artist-mode-off
+  "C-c C-a l"        #'artist-select-op-line
+  "C-c C-a L"        #'artist-select-op-straight-line
+  "C-c C-a r"        #'artist-select-op-rectangle
+  "C-c C-a R"        #'artist-select-op-square
+  "C-c C-a s"        #'artist-select-op-square
+  "C-c C-a p"        #'artist-select-op-poly-line
+  "C-c C-a P"        #'artist-select-op-straight-poly-line
+  "C-c C-a e"        #'artist-select-op-ellipse
+  "C-c C-a c"        #'artist-select-op-circle
+  "C-c C-a t"        #'artist-select-op-text-see-thru
+  "C-c C-a T"        #'artist-select-op-text-overwrite
+  "C-c C-a S"        #'artist-select-op-spray-can
+  "C-c C-a z"        #'artist-select-op-spray-set-size
+  "C-c C-a C-d"      #'artist-select-op-erase-char
+  "C-c C-a E"        #'artist-select-op-erase-rectangle
+  "C-c C-a v"        #'artist-select-op-vaporize-line
+  "C-c C-a V"        #'artist-select-op-vaporize-lines
+  "C-c C-a C-k"      #'artist-select-op-cut-rectangle
+  "C-c C-a M-w"      #'artist-select-op-copy-rectangle
+  "C-c C-a C-y"      #'artist-select-op-paste
+  "C-c C-a f"        #'artist-select-op-flood-fill
+  "C-c C-a C-b"      #'artist-submit-bug-report)
 
 (easy-menu-define artist-menu-map artist-mode-map
   "Menu for `artist-mode'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]