summaryrefslogtreecommitdiff
path: root/lisp/textmodes/refill.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-10-23 07:35:30 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-10-23 07:35:30 +0000
commit7850e1884587e678de8851845b9be933c60d66a4 (patch)
treeec3f486bdfed9baa56758032314d1f1b7860ebca /lisp/textmodes/refill.el
parente01cd227f6e579a7ae46a3dd3848f218fe61e312 (diff)
downloademacs-7850e1884587e678de8851845b9be933c60d66a4.tar.gz
Fix var names in doc.
(refill-mode): Don't bother with make-local-hook anymore.
Diffstat (limited to 'lisp/textmodes/refill.el')
-rw-r--r--lisp/textmodes/refill.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index ae9e41dae78..e130874a240 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -23,7 +23,7 @@
;;; Commentary:
;; Provides a mode where paragraphs are refilled after changes in them
-;; (using `after-change-hooks'). This gives something akin to typical
+;; (using `after-change-functions'). This gives something akin to typical
;; word processor-style filling. We restrict refilling due to
;; self-insertion to the characters which trigger auto-fill.
@@ -45,12 +45,12 @@
;; The work is done in a local post-command hook but only if
;; `refill-doit' has been set by the after-change function. Using
-;; `post-command-hooks' ensures simply that refilling only happens
+;; `post-command-hook' ensures simply that refilling only happens
;; once per command.
;; [Per Abrahamsen's maniac.el does a similar thing, but operates from
;; post-command-hook. I don't understand the statement in it that
-;; after-change-hooks don't work for this purpose; perhaps there was
+;; after-change-functions don't work for this purpose; perhaps there was
;; some Emacs bug at the time. ISTR maniac has problems with
;; whitespace at the end of paragraphs.]
@@ -74,8 +74,8 @@
(defvar refill-doit nil
"Non-nil means that `refill-post-command-function' does its processing.
-Set by `refill-after-change-function' in `after-change-hooks' and
-unset by `refill-post-command-function' in `post-command-hooks'. This
+Set by `refill-after-change-function' in `after-change-functions' and
+unset by `refill-post-command-function' in `post-command-hook'. This
ensures refilling is only done once per command that causes a change,
regardless of the number of after-change calls from commands doing
complex processing.")
@@ -140,13 +140,12 @@ refilling if they would cause auto-filling."
;; This provides the test for recursive paragraph filling.
(make-local-variable 'fill-paragraph-function)
(if refill-mode
- (progn (add-hook (make-local-hook 'after-change-functions)
- 'refill-after-change-function nil t)
- (add-hook (make-local-hook 'post-command-hook)
- 'refill-post-command-function nil t)
- (set (make-local-variable 'fill-paragraph-function)
- 'refill-fill-paragraph)
- (auto-fill-mode 0))
+ (progn
+ (add-hook 'after-change-functions 'refill-after-change-function nil t)
+ (add-hook 'post-command-hook 'refill-post-command-function nil t)
+ (set (make-local-variable 'fill-paragraph-function)
+ 'refill-fill-paragraph)
+ (auto-fill-mode 0))
(remove-hook 'after-change-functions 'refill-after-change-function t)
(remove-hook 'post-command-hook 'refill-post-command-function t)
(setq fill-paragraph-function nil)))