[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 73c03d64ce: Prefer defvar-keymap in sql.el
From: |
Stefan Kangas |
Subject: |
master 73c03d64ce: Prefer defvar-keymap in sql.el |
Date: |
Sun, 13 Nov 2022 09:21:40 -0500 (EST) |
branch: master
commit 73c03d64cec9869951ff0d52571671429032c7ca
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
Prefer defvar-keymap in sql.el
* lisp/progmodes/sql.el (sql-interactive-mode-map, sql-mode-map):
Prefer defvar-keymap.
---
lisp/progmodes/sql.el | 52 ++++++++++++++++++++++++---------------------------
1 file changed, 24 insertions(+), 28 deletions(-)
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 4121e4dc3c..a1c0aa76de 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -1358,37 +1358,33 @@ specified, it's `sql-product' or `sql-connection' must
match."
;; Keymap for sql-interactive-mode.
-(defvar sql-interactive-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map comint-mode-map)
- (define-key map (kbd "C-j") 'sql-accumulate-and-indent)
- (define-key map (kbd "C-c C-w") 'sql-copy-column)
- (define-key map (kbd "O") 'sql-magic-go)
- (define-key map (kbd "o") 'sql-magic-go)
- (define-key map (kbd ";") 'sql-magic-semicolon)
- (define-key map (kbd "C-c C-l a") 'sql-list-all)
- (define-key map (kbd "C-c C-l t") 'sql-list-table)
- map)
- "Mode map used for `sql-interactive-mode'.
-Based on `comint-mode-map'.")
+(defvar-keymap sql-interactive-mode-map
+ :doc "Mode map used for `sql-interactive-mode'.
+Based on `comint-mode-map'."
+ :parent comint-mode-map
+ "C-j" #'sql-accumulate-and-indent
+ "C-c C-w" #'sql-copy-column
+ "O" #'sql-magic-go
+ "o" #'sql-magic-go
+ ";" #'sql-magic-semicolon
+ "C-c C-l a" #'sql-list-all
+ "C-c C-l t" #'sql-list-table)
;; Keymap for sql-mode.
-(defvar sql-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-c") 'sql-send-paragraph)
- (define-key map (kbd "C-c C-r") 'sql-send-region)
- (define-key map (kbd "C-c C-s") 'sql-send-string)
- (define-key map (kbd "C-c C-b") 'sql-send-buffer)
- (define-key map (kbd "C-c C-n") 'sql-send-line-and-next)
- (define-key map (kbd "C-c C-i") 'sql-product-interactive)
- (define-key map (kbd "C-c C-z") 'sql-show-sqli-buffer)
- (define-key map (kbd "C-c C-l a") 'sql-list-all)
- (define-key map (kbd "C-c C-l t") 'sql-list-table)
- (define-key map [remap beginning-of-defun] 'sql-beginning-of-statement)
- (define-key map [remap end-of-defun] 'sql-end-of-statement)
- map)
- "Mode map used for `sql-mode'.")
+(defvar-keymap sql-mode-map
+ :doc "Mode map used for `sql-mode'."
+ "C-c C-c" #'sql-send-paragraph
+ "C-c C-r" #'sql-send-region
+ "C-c C-s" #'sql-send-string
+ "C-c C-b" #'sql-send-buffer
+ "C-c C-n" #'sql-send-line-and-next
+ "C-c C-i" #'sql-product-interactive
+ "C-c C-z" #'sql-show-sqli-buffer
+ "C-c C-l a" #'sql-list-all
+ "C-c C-l t" #'sql-list-table
+ "<remap> <beginning-of-defun>" #'sql-beginning-of-statement
+ "<remap> <end-of-defun>" #'sql-end-of-statement)
;; easy menu for sql-mode.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 73c03d64ce: Prefer defvar-keymap in sql.el,
Stefan Kangas <=