From: Stefan Kangas Date: Fri, 16 Sep 2022 10:51:28 +0000 (+0200) Subject: Prefer defvar-keymap in picture.el X-Git-Tag: emacs-29.0.90~1856^2~459 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37e9d6a35aa9fb087490292ca8c2143930b052cf;p=emacs.git Prefer defvar-keymap in picture.el * lisp/textmodes/picture.el (picture-mode-map): Prefer defvar-keymap. --- diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index e8c1e6b14f2..a020b7de850 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -1,6 +1,6 @@ ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model -*- lexical-binding: t -*- -;; Copyright (C) 1985, 1994, 2001-2022 Free Software Foundation, Inc. +;; Copyright (C) 1985-2022 Free Software Foundation, Inc. ;; Author: K. Shane Hartman ;; Maintainer: emacs-devel@gnu.org @@ -615,61 +615,57 @@ Leaves the region surrounding the rectangle." (defalias 'picture-delete-char 'delete-char) -(defvar picture-mode-map - (let ((map (make-keymap))) - (define-key map [remap self-insert-command] 'picture-self-insert) - (define-key map [remap completion-separator-self-insert-command] - 'picture-self-insert) - (define-key map [remap completion-separator-self-insert-autofilling] - 'picture-self-insert) - (define-key map [remap forward-char] 'picture-forward-column) - (define-key map [remap right-char] 'picture-forward-column) - (define-key map [remap backward-char] 'picture-backward-column) - (define-key map [remap left-char] 'picture-backward-column) - (define-key map [remap delete-char] 'picture-clear-column) - ;; There are two possibilities for what is normally on DEL. - (define-key map [remap backward-delete-char-untabify] - 'picture-backward-clear-column) - (define-key map [remap delete-backward-char] 'picture-backward-clear-column) - (define-key map [remap kill-line] 'picture-clear-line) - (define-key map [remap open-line] 'picture-open-line) - (define-key map [remap newline] 'picture-newline) - (define-key map [remap newline-and-indent] 'picture-duplicate-line) - (define-key map [remap next-line] 'picture-move-down) - (define-key map [remap previous-line] 'picture-move-up) - (define-key map [remap move-beginning-of-line] 'picture-beginning-of-line) - (define-key map [remap move-end-of-line] 'picture-end-of-line) - (define-key map [remap mouse-set-point] 'picture-mouse-set-point) - (define-key map "\C-c\C-d" 'picture-delete-char) - (define-key map "\t" 'picture-tab) - (define-key map "\e\t" 'picture-tab-search) - (define-key map "\C-c\t" 'picture-set-tab-stops) - (define-key map "\C-c\C-k" 'picture-clear-rectangle) - (define-key map "\C-c\C-w" 'picture-clear-rectangle-to-register) - (define-key map "\C-c\C-y" 'picture-yank-rectangle) - (define-key map "\C-c\C-x" 'picture-yank-rectangle-from-register) - (define-key map "\C-c\C-r" 'picture-draw-rectangle) - (define-key map "\C-c\C-c" 'picture-mode-exit) - (define-key map "\C-c\C-f" 'picture-motion) - (define-key map "\C-c\C-b" 'picture-motion-reverse) - (define-key map "\C-c<" 'picture-movement-left) - (define-key map "\C-c>" 'picture-movement-right) - (define-key map "\C-c^" 'picture-movement-up) - (define-key map "\C-c." 'picture-movement-down) - (define-key map "\C-c`" 'picture-movement-nw) - (define-key map "\C-c'" 'picture-movement-ne) - (define-key map "\C-c/" 'picture-movement-sw) - (define-key map "\C-c\\" 'picture-movement-se) - (define-key map [(control ?c) left] 'picture-movement-left) - (define-key map [(control ?c) right] 'picture-movement-right) - (define-key map [(control ?c) up] 'picture-movement-up) - (define-key map [(control ?c) down] 'picture-movement-down) - (define-key map [(control ?c) home] 'picture-movement-nw) - (define-key map [(control ?c) prior] 'picture-movement-ne) - (define-key map [(control ?c) end] 'picture-movement-sw) - (define-key map [(control ?c) next] 'picture-movement-se) - map) - "Keymap used in `picture-mode'.") +(defvar-keymap picture-mode-map + :doc "Keymap used in `picture-mode'." + :full t + " " #'picture-self-insert + " " #'picture-self-insert + " " #'picture-self-insert + " " #'picture-forward-column + " " #'picture-forward-column + " " #'picture-backward-column + " " #'picture-backward-column + " " #'picture-clear-column + ;; There are two possibilities for what is normally on DEL. + " " #'picture-backward-clear-column + " " #'picture-backward-clear-column + " " #'picture-clear-line + " " #'picture-open-line + " " #'picture-newline + " " #'picture-duplicate-line + " " #'picture-move-down + " " #'picture-move-up + " " #'picture-beginning-of-line + " " #'picture-end-of-line + " " #'picture-mouse-set-point + "C-c C-d" #'picture-delete-char + "TAB" #'picture-tab + "M-TAB" #'picture-tab-search + "C-c TAB" #'picture-set-tab-stops + "C-c C-k" #'picture-clear-rectangle + "C-c C-w" #'picture-clear-rectangle-to-register + "C-c C-y" #'picture-yank-rectangle + "C-c C-x" #'picture-yank-rectangle-from-register + "C-c C-r" #'picture-draw-rectangle + "C-c C-c" #'picture-mode-exit + "C-c C-f" #'picture-motion + "C-c C-b" #'picture-motion-reverse + "C-c <" #'picture-movement-left + "C-c >" #'picture-movement-right + "C-c ^" #'picture-movement-up + "C-c ." #'picture-movement-down + "C-c `" #'picture-movement-nw + "C-c '" #'picture-movement-ne + "C-c /" #'picture-movement-sw + "C-c \\" #'picture-movement-se + "C-c " #'picture-movement-left + "C-c " #'picture-movement-right + "C-c " #'picture-movement-up + "C-c " #'picture-movement-down + "C-c " #'picture-movement-nw + "C-c " #'picture-movement-ne + "C-c " #'picture-movement-sw + "C-c " #'picture-movement-se) (defcustom picture-mode-hook nil "If non-nil, its value is called on entry to Picture mode.