aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorPo Lu2022-05-27 16:34:28 +0800
committerPo Lu2022-05-27 16:34:28 +0800
commit01e3345b7bac8f8e79433360e3f2a6fa089c8ff7 (patch)
tree6f7ac97534b3bf216711b35c6a707a67546b217a /lisp/progmodes
parent27de58af8b3a7617868408886f94bb12f7785800 (diff)
parent758fed537b7780807bf00705f6441d1550e7a945 (diff)
downloademacs-x-window-xwidget.tar.gz
emacs-x-window-xwidget.zip
Merge remote-tracking branch 'origin/master' into x-window-xwidgetx-window-xwidget
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/asm-mode.el30
-rw-r--r--lisp/progmodes/bug-reference.el10
-rw-r--r--lisp/progmodes/erts-mode.el10
-rw-r--r--lisp/progmodes/flymake.el13
-rw-r--r--lisp/progmodes/icon.el21
-rw-r--r--lisp/progmodes/js.el10
-rw-r--r--lisp/progmodes/m4-mode.el12
-rw-r--r--lisp/progmodes/mixal-mode.el17
-rw-r--r--lisp/progmodes/scheme.el13
9 files changed, 58 insertions, 78 deletions
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index 370fb1b80b4..aaf063b5174 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -24,16 +24,16 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;; This mode was written by Eric S. Raymond <esr@snark.thyrsus.com>, 26;; This mode was written by Eric S. Raymond <esr@snark.thyrsus.com>,
27;; inspired by an earlier asm-mode by Martin Neitzel. 27;; inspired by an earlier `asm-mode' by Martin Neitzel.
28 28
29;; This major mode is based on prog mode. It defines a private abbrev table 29;; This major mode is based on `prog-mode'. It defines a private
30;; that can be used to save abbrevs for assembler mnemonics. It binds just 30;; abbrev table that can be used to save abbrevs for assembler
31;; five keys: 31;; mnemonics. It binds just five keys:
32;; 32;;
33;; TAB tab to next tab stop 33;; TAB tab to next tab stop
34;; : outdent preceding label, tab to tab stop 34;; : outdent preceding label, tab to tab stop
35;; comment char place or move comment 35;; comment char place or move comment
36;; asm-comment-char specifies which character this is; 36;; `asm-comment-char' specifies which character this is;
37;; you can use a different character in different 37;; you can use a different character in different
38;; Asm mode buffers. 38;; Asm mode buffers.
39;; C-j, C-m newline and tab to tab stop 39;; C-j, C-m newline and tab to tab stop
@@ -41,9 +41,9 @@
41;; Code is indented to the first tab stop level. 41;; Code is indented to the first tab stop level.
42 42
43;; This mode runs two hooks: 43;; This mode runs two hooks:
44;; 1) An asm-mode-set-comment-hook before the part of the initialization 44;; 1) `asm-mode-set-comment-hook' before the part of the initialization
45;; depending on asm-comment-char, and 45;; depending on `asm-comment-char', and
46;; 2) an asm-mode-hook at the end of initialization. 46;; 2) `asm-mode-hook' at the end of initialization.
47 47
48;;; Code: 48;;; Code:
49 49
@@ -68,13 +68,11 @@
68 "Abbrev table used while in Asm mode.") 68 "Abbrev table used while in Asm mode.")
69(define-abbrev-table 'asm-mode-abbrev-table ()) 69(define-abbrev-table 'asm-mode-abbrev-table ())
70 70
71(defvar asm-mode-map 71(defvar-keymap asm-mode-map
72 (let ((map (make-sparse-keymap))) 72 :doc "Keymap for Asm mode."
73 ;; Note that the comment character isn't set up until asm-mode is called. 73 ;; Note that the comment character isn't set up until asm-mode is called.
74 (define-key map ":" 'asm-colon) 74 ":" #'asm-colon
75 (define-key map "\C-c;" 'comment-region) 75 "C-c ;" #'comment-region)
76 map)
77 "Keymap for Asm mode.")
78 76
79(easy-menu-define asm-mode-menu asm-mode-map 77(easy-menu-define asm-mode-menu asm-mode-map
80 "Menu for Asm mode." 78 "Menu for Asm mode."
@@ -130,7 +128,7 @@ Special commands:
130 (setq-local tab-always-indent nil) 128 (setq-local tab-always-indent nil)
131 129
132 (run-hooks 'asm-mode-set-comment-hook) 130 (run-hooks 'asm-mode-set-comment-hook)
133 ;; Make our own local child of asm-mode-map 131 ;; Make our own local child of `asm-mode-map'
134 ;; so we can define our own comment character. 132 ;; so we can define our own comment character.
135 (use-local-map (nconc (make-sparse-keymap) asm-mode-map)) 133 (use-local-map (nconc (make-sparse-keymap) asm-mode-map))
136 (local-set-key (vector asm-comment-char) #'asm-comment) 134 (local-set-key (vector asm-comment-char) #'asm-comment)
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 06242a4cba8..d3626dbaf01 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -40,12 +40,10 @@
40 ;; Somewhat arbitrary, by analogy with eg goto-address. 40 ;; Somewhat arbitrary, by analogy with eg goto-address.
41 :group 'comm) 41 :group 'comm)
42 42
43(defvar bug-reference-map 43(defvar-keymap bug-reference-map
44 (let ((map (make-sparse-keymap))) 44 :doc "Keymap used by bug reference buttons."
45 (define-key map [mouse-2] 'bug-reference-push-button) 45 "<mouse-2>" #'bug-reference-push-button
46 (define-key map (kbd "C-c RET") 'bug-reference-push-button) 46 "C-c RET" #'bug-reference-push-button)
47 map)
48 "Keymap used by bug reference buttons.")
49 47
50;; E.g., "https://gcc.gnu.org/PR%s" 48;; E.g., "https://gcc.gnu.org/PR%s"
51(defvar bug-reference-url-format nil 49(defvar bug-reference-url-format nil
diff --git a/lisp/progmodes/erts-mode.el b/lisp/progmodes/erts-mode.el
index 1b88540ff38..13da1d478d6 100644
--- a/lisp/progmodes/erts-mode.el
+++ b/lisp/progmodes/erts-mode.el
@@ -64,12 +64,10 @@
64 "Face used for displaying specification test start markers." 64 "Face used for displaying specification test start markers."
65 :group 'erts-mode) 65 :group 'erts-mode)
66 66
67(defvar erts-mode-map 67(defvar-keymap erts-mode-map
68 (let ((map (make-keymap))) 68 :parent prog-mode-map
69 (set-keymap-parent map prog-mode-map) 69 "C-c C-r" #'erts-tag-region
70 (define-key map "\C-c\C-r" 'erts-tag-region) 70 "C-c C-c" #'erts-run-test)
71 (define-key map "\C-c\C-c" 'erts-run-test)
72 map))
73 71
74(defvar erts-mode-font-lock-keywords 72(defvar erts-mode-font-lock-keywords
75 ;; Specifications. 73 ;; Specifications.
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 0b7958e52fb..9e3255874da 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1080,9 +1080,8 @@ Interactively, with a prefix arg, FORCE is t."
1080 (flymake--run-backend backend backend-args))) 1080 (flymake--run-backend backend backend-args)))
1081 nil)))))))) 1081 nil))))))))
1082 1082
1083(defvar flymake-mode-map 1083(defvar-keymap flymake-mode-map
1084 (let ((map (make-sparse-keymap))) map) 1084 :doc "Keymap for `flymake-mode'.")
1085 "Keymap for `flymake-mode'.")
1086 1085
1087;;;###autoload 1086;;;###autoload
1088(define-minor-mode flymake-mode 1087(define-minor-mode flymake-mode
@@ -1493,11 +1492,9 @@ TYPE is usually keyword `:error', `:warning' or `:note'."
1493 1492
1494(defvar-local flymake--diagnostics-buffer-source nil) 1493(defvar-local flymake--diagnostics-buffer-source nil)
1495 1494
1496(defvar flymake-diagnostics-buffer-mode-map 1495(defvar-keymap flymake-diagnostics-buffer-mode-map
1497 (let ((map (make-sparse-keymap))) 1496 "RET" #'flymake-goto-diagnostic
1498 (define-key map (kbd "RET") 'flymake-goto-diagnostic) 1497 "SPC" #'flymake-show-diagnostic)
1499 (define-key map (kbd "SPC") 'flymake-show-diagnostic)
1500 map))
1501 1498
1502(defun flymake-show-diagnostic (pos &optional other-window) 1499(defun flymake-show-diagnostic (pos &optional other-window)
1503 "Show location of diagnostic at POS." 1500 "Show location of diagnostic at POS."
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index e1ee9efc54b..ec281f3a496 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -31,17 +31,16 @@
31 "Abbrev table in use in Icon-mode buffers.") 31 "Abbrev table in use in Icon-mode buffers.")
32(define-abbrev-table 'icon-mode-abbrev-table ()) 32(define-abbrev-table 'icon-mode-abbrev-table ())
33 33
34(defvar icon-mode-map 34(defvar-keymap icon-mode-map
35 (let ((map (make-sparse-keymap "Icon"))) 35 :doc "Keymap used in Icon mode."
36 (define-key map "{" 'electric-icon-brace) 36 :name "Icon"
37 (define-key map "}" 'electric-icon-brace) 37 "{" #'electric-icon-brace
38 (define-key map "\e\C-h" 'mark-icon-function) 38 "}" #'electric-icon-brace
39 (define-key map "\e\C-a" 'beginning-of-icon-defun) 39 "C-M-h" #'mark-icon-function
40 (define-key map "\e\C-e" 'end-of-icon-defun) 40 "C-M-a" #'beginning-of-icon-defun
41 (define-key map "\e\C-q" 'indent-icon-exp) 41 "C-M-e" #'end-of-icon-defun
42 (define-key map "\177" 'backward-delete-char-untabify) 42 "C-M-q" #'indent-icon-exp
43 map) 43 "DEL" #'backward-delete-char-untabify)
44 "Keymap used in Icon mode.")
45 44
46(easy-menu-define icon-mode-menu icon-mode-map 45(easy-menu-define icon-mode-menu icon-mode-map
47 "Menu for Icon mode." 46 "Menu for Icon mode."
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 9c1358e466d..eb2a1e4fccc 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -660,13 +660,11 @@ This variable is like `sgml-attribute-offset'."
660 :type 'integer 660 :type 'integer
661 :safe 'integerp) 661 :safe 'integerp)
662 662
663;;; KeyMap 663;;; Keymap
664 664
665(defvar js-mode-map 665(defvar-keymap js-mode-map
666 (let ((keymap (make-sparse-keymap))) 666 :doc "Keymap for `js-mode'."
667 (define-key keymap [(meta ?.)] #'js-find-symbol) 667 "M-." #'js-find-symbol)
668 keymap)
669 "Keymap for `js-mode'.")
670 668
671;;; Syntax table and parsing 669;;; Syntax table and parsing
672 670
diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el
index b9fcd033bbb..a18c8bcce44 100644
--- a/lisp/progmodes/m4-mode.el
+++ b/lisp/progmodes/m4-mode.el
@@ -121,13 +121,11 @@ If m4 is not in your PATH, set this to an absolute file name."
121 ("#" (0 (when (m4--quoted-p (match-beginning 0)) 121 ("#" (0 (when (m4--quoted-p (match-beginning 0))
122 (string-to-syntax ".")))))) 122 (string-to-syntax "."))))))
123 123
124(defvar m4-mode-map 124(defvar-keymap m4-mode-map
125 (let ((map (make-sparse-keymap))) 125 :doc "Keymap for M4 Mode."
126 (define-key map "\C-c\C-b" 'm4-m4-buffer) 126 "C-c C-b" #'m4-m4-buffer
127 (define-key map "\C-c\C-r" 'm4-m4-region) 127 "C-c C-r" #'m4-m4-region
128 (define-key map "\C-c\C-c" 'comment-region) 128 "C-c C-c" #'comment-region)
129 map)
130 "Keymap for M4 Mode.")
131 129
132(easy-menu-define m4-mode-menu m4-mode-map 130(easy-menu-define m4-mode-menu m4-mode-map
133 "Menu for M4 Mode." 131 "Menu for M4 Mode."
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index 97a218fcfa3..9d1ceaa55a8 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -78,16 +78,13 @@
78;;; Code: 78;;; Code:
79(defvar compile-command) 79(defvar compile-command)
80 80
81;;; Key map 81;;; Keymap
82(defvar mixal-mode-map 82(defvar-keymap mixal-mode-map
83 (let ((map (make-sparse-keymap))) 83 :doc "Keymap for `mixal-mode'."
84 (define-key map "\C-c\C-c" 'compile) 84 "C-c C-c" #'compile
85 (define-key map "\C-c\C-r" 'mixal-run) 85 "C-c C-r" #'mixal-run
86 (define-key map "\C-c\C-d" 'mixal-debug) 86 "C-c C-d" #'mixal-debug
87 (define-key map "\C-h\C-o" 'mixal-describe-operation-code) 87 "C-h C-o" #'mixal-describe-operation-code)
88 map)
89 "Keymap for `mixal-mode'.")
90;; (makunbound 'mixal-mode-map)
91 88
92;;; Syntax table 89;;; Syntax table
93(defvar mixal-mode-syntax-table 90(defvar mixal-mode-syntax-table
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index cd397733d2d..cf1d3949835 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -1,7 +1,6 @@
1;;; scheme.el --- Scheme (and DSSSL) editing mode -*- lexical-binding: t; -*- 1;;; scheme.el --- Scheme (and DSSSL) editing mode -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 1986-1988, 1997-1998, 2001-2022 Free Software 3;; Copyright (C) 1986-2022 Free Software Foundation, Inc.
4;; Foundation, Inc.
5 4
6;; Author: Bill Rozas <jinx@martigny.ai.mit.edu> 5;; Author: Bill Rozas <jinx@martigny.ai.mit.edu>
7;; Adapted-by: Dave Love <d.love@dl.ac.uk> 6;; Adapted-by: Dave Love <d.love@dl.ac.uk>
@@ -201,12 +200,10 @@
201 200
202(defvar scheme-mode-line-process "") 201(defvar scheme-mode-line-process "")
203 202
204(defvar scheme-mode-map 203(defvar-keymap scheme-mode-map
205 (let ((map (make-sparse-keymap))) 204 :doc "Keymap for Scheme mode.
206 (set-keymap-parent map lisp-mode-shared-map) 205All commands in `lisp-mode-shared-map' are inherited by this map."
207 map) 206 :parent lisp-mode-shared-map)
208 "Keymap for Scheme mode.
209All commands in `lisp-mode-shared-map' are inherited by this map.")
210 207
211(easy-menu-define scheme-mode-menu scheme-mode-map 208(easy-menu-define scheme-mode-menu scheme-mode-map
212 "Menu for Scheme mode." 209 "Menu for Scheme mode."