aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/text-mode.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 7d3b47a9c03..87f6668cecb 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -75,8 +75,15 @@
75Many other modes, such as `mail-mode' and `outline-mode', inherit 75Many other modes, such as `mail-mode' and `outline-mode', inherit
76all the commands defined in this map.") 76all the commands defined in this map.")
77 77
78(defcustom text-mode-meta-tab-ispell-complete-word nil 78(defcustom text-mode-ispell-word-completion 'completion-at-point
79 "Whether M-TAB invokes `ispell-complete-word' in Text mode. 79 "How Text mode provides Ispell word completion.
80
81By default, this option is set to `completion-at-point', which
82means that Text mode adds an Ispell word completion function to
83`completion-at-point-functions'. Any other non-nil value says to
84bind M-TAB directly to `ispell-complete-word' instead. If this
85is nil, Text mode neither binds M-TAB to `ispell-complete-word'
86nor does it extend `completion-at-point-functions'.
80 87
81This user option only takes effect when you customize it in 88This user option only takes effect when you customize it in
82Custom or with `setopt', not with `setq'." 89Custom or with `setopt', not with `setq'."
@@ -84,8 +91,9 @@ Custom or with `setopt', not with `setq'."
84 :type 'boolean 91 :type 'boolean
85 :version "30.1" 92 :version "30.1"
86 :set (lambda (sym val) 93 :set (lambda (sym val)
87 (if (set sym val) 94 (if (and (set sym val)
88 (keymap-set text-mode-map "C-M-i" #'ispell-complete-word) 95 (not (eq val 'completion-at-point)))
96 (keymap-set text-mode-map "C-M-i" #'ispell-complete-word)
89 (keymap-unset text-mode-map "C-M-i" t)))) 97 (keymap-unset text-mode-map "C-M-i" t))))
90 98
91(easy-menu-define text-mode-menu text-mode-map 99(easy-menu-define text-mode-menu text-mode-map
@@ -144,7 +152,8 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
144 ;; Enable text conversion in this buffer. 152 ;; Enable text conversion in this buffer.
145 (setq-local text-conversion-style t) 153 (setq-local text-conversion-style t)
146 (add-hook 'context-menu-functions 'text-mode-context-menu 10 t) 154 (add-hook 'context-menu-functions 'text-mode-context-menu 10 t)
147 (add-hook 'completion-at-point-functions #'ispell-completion-at-point 10 t)) 155 (when (eq text-mode-ispell-word-completion 'completion-at-point)
156 (add-hook 'completion-at-point-functions #'ispell-completion-at-point 10 t)))
148 157
149(define-derived-mode paragraph-indent-text-mode text-mode "Parindent" 158(define-derived-mode paragraph-indent-text-mode text-mode "Parindent"
150 "Major mode for editing text, with leading spaces starting a paragraph. 159 "Major mode for editing text, with leading spaces starting a paragraph.