summaryrefslogtreecommitdiff
path: root/lisp/textmodes/fill.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-07-23 14:57:44 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-07-23 14:57:44 +0200
commit99018681c40f5854dd8fad8e226b6dc1609cafe2 (patch)
tree39f7ad20af198a560c044d953364cf9b134533a9 /lisp/textmodes/fill.el
parent4357d595ee69343856917041c48e8c004da922d1 (diff)
downloademacs-99018681c40f5854dd8fad8e226b6dc1609cafe2.tar.gz
emacs-99018681c40f5854dd8fad8e226b6dc1609cafe2.tar.bz2
emacs-99018681c40f5854dd8fad8e226b6dc1609cafe2.zip
Make nil value of fill-column obsolete
* lisp/textmodes/fill.el (current-fill-column): Make nil value of 'fill-column' obsolete. (Bug#22847) (current-fill-column--has-warned): New variable to track warning. * lisp/simple.el (do-auto-fill): Remove handling of nil return value from 'current-fill-column'. * etc/NEWS: Announce obsoletion of this usage.
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r--lisp/textmodes/fill.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 3914bdeb83e..f394171fb6c 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -133,6 +133,8 @@ A nil return value means the function has not determined the fill prefix."
(defvar fill-indent-according-to-mode nil ;Screws up CC-mode's filling tricks.
"Whether or not filling should try to use the major mode's indentation.")
+(defvar current-fill-column--has-warned nil)
+
(defun current-fill-column ()
"Return the fill-column to use for this line.
The fill-column to use for a buffer is stored in the variable `fill-column',
@@ -158,7 +160,14 @@ number equals or exceeds the local fill-column - right-margin difference."
(< col fill-col)))
(setq here change
here-col col))
- (max here-col fill-col)))))
+ (max here-col fill-col))
+ ;; This warning was added in 28.1. It should be removed later,
+ ;; and this function changed to never return nil.
+ (unless current-fill-column--has-warned
+ (lwarn '(fill-column) :warning
+ "Setting this variable to nil is obsolete; use `(auto-fill-mode -1)' instead")
+ (setq current-fill-column--has-warned t))
+ most-positive-fixnum)))
(defun canonically-space-region (beg end)
"Remove extra spaces between words in region.