aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorStefan Kangas2021-02-28 01:51:31 +0100
committerStefan Kangas2021-02-28 01:51:31 +0100
commit9eff23573df263dd5e5a2d73888c16cb5853eb2f (patch)
tree84764a3010b6d4893b0f5fa110103134246cbc6b /lisp/textmodes
parent9a110cb0d956ddf887e7d5ba9f0c2a67c9a1c6f0 (diff)
downloademacs-9eff23573df263dd5e5a2d73888c16cb5853eb2f.tar.gz
emacs-9eff23573df263dd5e5a2d73888c16cb5853eb2f.zip
Convert text-mode menu to easymenu
* lisp/textmodes/text-mode.el (text-mode-map): Move menu definition from here... (text-mode-menu): ...to here, and convert to easymenu.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/text-mode.el41
1 files changed, 20 insertions, 21 deletions
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index ab9f7b9c7c0..7836bd46bc5 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -70,32 +70,31 @@
70(defvar text-mode-map 70(defvar text-mode-map
71 (let ((map (make-sparse-keymap))) 71 (let ((map (make-sparse-keymap)))
72 (define-key map "\e\t" 'ispell-complete-word) 72 (define-key map "\e\t" 'ispell-complete-word)
73 (define-key map [menu-bar text]
74 (cons "Text" (make-sparse-keymap "Text")))
75 (bindings--define-key map [menu-bar text toggle-text-mode-auto-fill]
76 '(menu-item "Auto Fill" toggle-text-mode-auto-fill
77 :button (:toggle . (memq 'turn-on-auto-fill text-mode-hook))
78 :help "Automatically fill text while typing in text modes (Auto Fill mode)"))
79 (bindings--define-key map [menu-bar text paragraph-indent-minor-mode]
80 '(menu-item "Paragraph Indent" paragraph-indent-minor-mode
81 :button (:toggle . (bound-and-true-p paragraph-indent-minor-mode))
82 :help "Toggle paragraph indent minor mode"))
83 (bindings--define-key map [menu-bar text sep] menu-bar-separator)
84 (bindings--define-key map [menu-bar text center-region]
85 '(menu-item "Center Region" center-region
86 :help "Center the marked region"
87 :enable (region-active-p)))
88 (bindings--define-key map [menu-bar text center-paragraph]
89 '(menu-item "Center Paragraph" center-paragraph
90 :help "Center the current paragraph"))
91 (bindings--define-key map [menu-bar text center-line]
92 '(menu-item "Center Line" center-line
93 :help "Center the current line"))
94 map) 73 map)
95 "Keymap for `text-mode'. 74 "Keymap for `text-mode'.
96Many other modes, such as `mail-mode', `outline-mode' and `indented-text-mode', 75Many other modes, such as `mail-mode', `outline-mode' and `indented-text-mode',
97inherit all the commands defined in this map.") 76inherit all the commands defined in this map.")
98 77
78(easy-menu-define text-mode-menu text-mode-map
79 "Menu for `text-mode'."
80 '("Text"
81 ["Center Line" center-line
82 :help "Center the current line"]
83 ["Center Paragraph" center-paragraph
84 :help "Center the current paragraph"]
85 ["Center Region" center-region
86 :help "Center the marked region"
87 :enable (region-active-p)]
88 "---"
89 ["Paragraph Indent" paragraph-indent-minor-mode
90 :help "Toggle paragraph indent minor mode"
91 :style toggle
92 :selected (bound-and-true-p paragraph-indent-minor-mode)]
93 ["Auto Fill" toggle-text-mode-auto-fill
94 :help "Automatically fill text while typing in text modes (Auto Fill mode)"
95 :style toggle
96 :selected (memq 'turn-on-auto-fill text-mode-hook)]))
97
99 98
100(define-derived-mode text-mode nil "Text" 99(define-derived-mode text-mode nil "Text"
101 "Major mode for editing text written for humans to read. 100 "Major mode for editing text written for humans to read.