[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a3e894810a 4/5: Fix defvar-keymap example in elisp manual
From: |
Stefan Kangas |
Subject: |
master a3e894810a 4/5: Fix defvar-keymap example in elisp manual |
Date: |
Sat, 6 Aug 2022 11:29:32 -0400 (EDT) |
branch: master
commit a3e894810a484aeac56d97f13d1c507e3d4eb0d5
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Fix defvar-keymap example in elisp manual
* lisp/textmodes/text-mode.el (text-mode-map): Convert to
defvar-keymap.
* doc/lispref/modes.texi (Example Major Modes): Fix example to
match code.
---
doc/lispref/modes.texi | 9 ++++-----
lisp/textmodes/text-mode.el | 10 ++++------
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index e94093318f..75eb21522f 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1356,11 +1356,10 @@ the conventions listed above:
;; @r{Create the keymap for this mode.}
@group
(defvar-keymap text-mode-map
- "C-M-i" #'ispell-complete-word
- @dots{})
- "Keymap for `text-mode'.
-Many other modes, such as `mail-mode', `outline-mode' and
-`indented-text-mode', inherit all the commands defined in this map.")
+ :doc "Keymap for `text-mode'.
+Many other modes, such as `mail-mode' and `outline-mode', inherit all
+the commands defined in this map."
+ "C-M-i" #'ispell-complete-word)
@end group
@end smallexample
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 2275ab2a3c..9e8f3747c5 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -67,13 +67,11 @@
st)
"Syntax table used while in `text-mode'.")
-(defvar text-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\e\t" #'ispell-complete-word)
- map)
- "Keymap for `text-mode'.
+(defvar-keymap text-mode-map
+ :doc "Keymap for `text-mode'.
Many other modes, such as `mail-mode' and `outline-mode', inherit
-all the commands defined in this map.")
+all the commands defined in this map."
+ "C-M-i" #'ispell-complete-word)
(easy-menu-define text-mode-menu text-mode-map
"Menu for `text-mode'."
- master updated (6223e251a5 -> 7c8332e096), Stefan Kangas, 2022/08/06
- master 7c8332e096 5/5: Fix namespacing problem in allout.el, Stefan Kangas, 2022/08/06
- master 2bbc5c5974 2/5: Make {close, replace}-rectangle compat aliases obsolete, Stefan Kangas, 2022/08/06
- master fad87d84df 1/5: Don't mention test failures on Ubuntu 16.04 in PROBLEMS, Stefan Kangas, 2022/08/06
- master 56783e605c 3/5: Make indented-text-mode alias obsolete, Stefan Kangas, 2022/08/06
- master a3e894810a 4/5: Fix defvar-keymap example in elisp manual,
Stefan Kangas <=