aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2001-12-22 12:25:14 +0000
committerMiles Bader2001-12-22 12:25:14 +0000
commitf5bd4bf25b81be67911548ad7a2b197a2a32884f (patch)
treea0ee47d037949afd29f487d935ee0e07178b2099
parent4b05e68da250cc3b5214207cbd332920f5296e13 (diff)
downloademacs-f5bd4bf25b81be67911548ad7a2b197a2a32884f.tar.gz
emacs-f5bd4bf25b81be67911548ad7a2b197a2a32884f.zip
(refill-mode): Don't barf when redundantly turning refill-mode off.
-rw-r--r--lisp/textmodes/refill.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index 345c9fca5bc..a6ca53b1182 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -222,8 +222,13 @@ When Refill mode is on, the current paragraph will be formatted when
222changes are made within it. Self-inserting characters only cause 222changes are made within it. Self-inserting characters only cause
223refilling if they would cause auto-filling." 223refilling if they would cause auto-filling."
224 nil " Refill" '(("\177" . backward-delete-char-untabify)) 224 nil " Refill" '(("\177" . backward-delete-char-untabify))
225 ;; This provides the test for recursive paragraph filling. 225 ;; Remove old state if necessary
226 (make-local-variable 'fill-paragraph-function) 226 (when refill-ignorable-overlay
227 (delete-overlay refill-ignorable-overlay)
228 (kill-local-variable 'refill-ignorable-overlay))
229 (when refill-late-fill-paragraph-function
230 (setq fill-paragraph-function refill-late-fill-paragraph-function)
231 (kill-local-variable 'refill-late-fill-paragraph-function))
227 (if refill-mode 232 (if refill-mode
228 (progn 233 (progn
229 (add-hook 'after-change-functions 'refill-after-change-function nil t) 234 (add-hook 'after-change-functions 'refill-after-change-function nil t)
@@ -231,6 +236,7 @@ refilling if they would cause auto-filling."
231 (add-hook 'pre-command-hook 'refill-pre-command-function nil t) 236 (add-hook 'pre-command-hook 'refill-pre-command-function nil t)
232 (set (make-local-variable 'refill-late-fill-paragraph-function) 237 (set (make-local-variable 'refill-late-fill-paragraph-function)
233 fill-paragraph-function) 238 fill-paragraph-function)
239 ;; This provides the test for recursive paragraph filling.
234 (set (make-local-variable 'fill-paragraph-function) 240 (set (make-local-variable 'fill-paragraph-function)
235 'refill-fill-paragraph) 241 'refill-fill-paragraph)
236 ;; When using justification, doing DEL on 2 spaces should remove 242 ;; When using justification, doing DEL on 2 spaces should remove
@@ -245,8 +251,6 @@ refilling if they would cause auto-filling."
245 (auto-fill-mode 0)) 251 (auto-fill-mode 0))
246 (remove-hook 'after-change-functions 'refill-after-change-function t) 252 (remove-hook 'after-change-functions 'refill-after-change-function t)
247 (remove-hook 'post-command-hook 'refill-post-command-function t) 253 (remove-hook 'post-command-hook 'refill-post-command-function t)
248 (delete-overlay refill-ignorable-overlay)
249 (setq fill-paragraph-function refill-late-fill-paragraph-function)
250 (kill-local-variable 'backward-delete-char-untabify-method))) 254 (kill-local-variable 'backward-delete-char-untabify-method)))
251 255
252(provide 'refill) 256(provide 'refill)