aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2025-03-14 19:50:22 +0100
committerStefan Kangas2025-03-14 19:50:22 +0100
commitbad2cd198abbd150cc205aee7879ad718e724dad (patch)
tree561c12db40c05b16f0ca1dbde1d6e67674e84707
parent24ffcbb3da9a010cf564bb496af3f5ce0b805f17 (diff)
downloademacs-bad2cd198abbd150cc205aee7879ad718e724dad.tar.gz
emacs-bad2cd198abbd150cc205aee7879ad718e724dad.zip
Make turn-on-flyspell/turn-off-flyspell obsolete
* lisp/textmodes/flyspell.el (turn-on-flyspell): Make into obsolete function alias for 'flyspell-mode'. (turn-off-flyspell): Declare obsolete. (text-mode-hook): Don't redundantly set :options here. * lisp/textmodes/text-mode.el (text-mode-hook): Prefer 'flyspell-mode' to 'turn-on-flyspell' in :options. (Bug#76535)
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/textmodes/flyspell.el21
-rw-r--r--lisp/textmodes/text-mode.el3
3 files changed, 17 insertions, 13 deletions
diff --git a/etc/NEWS b/etc/NEWS
index e634de18c69..b33f7cec73f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1065,6 +1065,12 @@ allows idle timers and other code to run during this delay period. We
1065consider making this behavior the default in a future Emacs version, so 1065consider making this behavior the default in a future Emacs version, so
1066we invite Flyspell users to enable this new option and report issues. 1066we invite Flyspell users to enable this new option and report issues.
1067 1067
1068---
1069*** 'turn-on-flyspell' and 'turn-off-flyspell' are obsolete.
1070To unconditionally enable 'flyspell-mode' from a hook, use this instead:
1071
1072 (add-hook 'text-mode-hook #'flyspell-mode)
1073
1068** Tramp 1074** Tramp
1069 1075
1070+++ 1076+++
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index b25f39c440b..d62c3fd135d 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -530,18 +530,6 @@ in your init file.
530 (flyspell-mode -1))) 530 (flyspell-mode -1)))
531 (flyspell--mode-off))) 531 (flyspell--mode-off)))
532 532
533;;;###autoload
534(defun turn-on-flyspell ()
535 "Unconditionally turn on Flyspell mode."
536 (flyspell-mode 1))
537
538;;;###autoload
539(defun turn-off-flyspell ()
540 "Unconditionally turn off Flyspell mode."
541 (flyspell-mode -1))
542
543(custom-add-option 'text-mode-hook 'turn-on-flyspell)
544
545(defvar flyspell-buffers nil 533(defvar flyspell-buffers nil
546 "For remembering buffers running flyspell.") 534 "For remembering buffers running flyspell.")
547(make-obsolete-variable 'flyspell-buffers "not used." "28.1") 535(make-obsolete-variable 'flyspell-buffers "not used." "28.1")
@@ -2408,6 +2396,15 @@ This function is meant to be added to `flyspell-incorrect-hook'."
2408(define-obsolete-function-alias 'flyspell-mode-on 'flyspell--mode-on "30.1") 2396(define-obsolete-function-alias 'flyspell-mode-on 'flyspell--mode-on "30.1")
2409(define-obsolete-function-alias 'flyspell-mode-off 'flyspell--mode-off "30.1") 2397(define-obsolete-function-alias 'flyspell-mode-off 'flyspell--mode-off "30.1")
2410 2398
2399;;;###autoload
2400(define-obsolete-function-alias 'turn-on-flyspell #'flyspell-mode "31.1")
2401
2402;;;###autoload
2403(defun turn-off-flyspell ()
2404 "Unconditionally turn off Flyspell mode."
2405 (declare (obsolete flyspell-mode "31.1"))
2406 (flyspell-mode -1))
2407
2411(provide 'flyspell) 2408(provide 'flyspell)
2412 2409
2413;;; flyspell.el ends here 2410;;; flyspell.el ends here
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index cfacb144e40..3b27efbcf87 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -34,7 +34,8 @@
34(defcustom text-mode-hook '(text-mode-hook-identify) 34(defcustom text-mode-hook '(text-mode-hook-identify)
35 "Normal hook run when entering Text mode and many related modes." 35 "Normal hook run when entering Text mode and many related modes."
36 :type 'hook 36 :type 'hook
37 :options '(turn-on-auto-fill turn-on-flyspell) 37 :options '(turn-on-auto-fill flyspell-mode)
38 :version "31.1"
38 :group 'text) 39 :group 'text)
39 40
40(defvar text-mode-variant nil 41(defvar text-mode-variant nil