Variable: refill-mode-hook
refill-mode-hook is a customizable variable defined in refill.el.gz.
Value
nil
Documentation
Hook run after entering or leaving refill-mode(var)/refill-mode(fun).
No problems result if this variable is not bound.
add-hook automatically binds it. (This is true for all hook variables.)
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/refill.el.gz
;;;###autoload
(define-minor-mode refill-mode
"Toggle automatic refilling (Refill mode).
Refill mode is a buffer-local minor mode. When enabled, the
current paragraph is refilled as you edit. Self-inserting
characters only cause refilling if they would cause
auto-filling.
For true \"word wrap\" behavior, use `visual-line-mode' instead."
;; Not global, so no effect.
;;; :group 'refill
:lighter " Refill"
:keymap '(("\177" . backward-delete-char-untabify))
;; Remove old state if necessary
(when refill-ignorable-overlay
(delete-overlay refill-ignorable-overlay)
(kill-local-variable 'refill-ignorable-overlay))
(when (local-variable-p 'refill-saved-state)
(dolist (x refill-saved-state)
(set (make-local-variable (car x)) (cdr x)))
(kill-local-variable 'refill-saved-state))
(if refill-mode
(progn
(add-hook 'after-change-functions #'refill-after-change-function nil t)
(add-hook 'post-command-hook #'refill-post-command-function nil t)
(add-hook 'pre-command-hook #'refill-pre-command-function nil t)
(setq-local refill-saved-state
(mapcar (lambda (s) (cons s (symbol-value s)))
'(fill-paragraph-function auto-fill-function)))
;; This provides the test for recursive paragraph filling.
(setq-local fill-paragraph-function #'refill-fill-paragraph)
;; When using justification, doing DEL on 2 spaces should remove
;; both, otherwise, the subsequent refill will undo the DEL.
(setq-local backward-delete-char-untabify-method 'hungry)
(setq refill-ignorable-overlay (make-overlay 1 1 nil nil t))
(overlay-put refill-ignorable-overlay 'modification-hooks
'(refill-adjust-ignorable-overlay))
(overlay-put refill-ignorable-overlay 'insert-behind-hooks
'(refill-adjust-ignorable-overlay))
(auto-fill-mode 0))
(remove-hook 'after-change-functions #'refill-after-change-function t)
(remove-hook 'post-command-hook #'refill-post-command-function t)
(kill-local-variable 'backward-delete-char-untabify-method)))