diff options
author | Richard M. Stallman <[email protected]> | 1996-08-07 19:45:46 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1996-08-07 19:45:46 +0000 |
commit | 24ebf92e58f4140864581e152f96697e83463eca (patch) | |
tree | 3f3df7bbf6ba73c8c73eaa2e845f959faf2162e5 /lisp/simple.el | |
parent | 18fef1118abe792aa6b81aebba31e7ef33363a19 (diff) |
(normal-auto-fill-function): New variable.
(auto-fill-mode): Use that instead of constant 'do-auto-fill.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 5af4bf3337..8199892f3e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2432,21 +2432,28 @@ Setting this variable automatically makes it local to the current buffer.") (setq give-up t))) ;; No place to break => stop trying. (setq give-up t)))) - ;; justify last line + ;; Justify last line. (justify-current-line justify t t) t))) +(defvar normal-auto-fill-function 'do-auto-fill + "The function to use for `auto-fill-function' if Auto Fill mode is turned on. +Some major modes set this.") + (defun auto-fill-mode (&optional arg) - "Toggle auto-fill mode. -With arg, turn Auto-Fill mode on if and only if arg is positive. -In Auto-Fill mode, inserting a space at a column beyond `current-fill-column' -automatically breaks the line at a previous space." + "Toggle Auto Fill mode. +With arg, turn Auto Fill mode on if and only if arg is positive. +In Auto Fill mode, inserting a space at a column beyond `current-fill-column' +automatically breaks the line at a previous space. + +The value of `normal-auto-fill-function' specifies the function to use +for `auto-fill-function' when turning Auto Fill mode on." (interactive "P") (prog1 (setq auto-fill-function (if (if (null arg) (not auto-fill-function) (> (prefix-numeric-value arg) 0)) - 'do-auto-fill + normal-auto-fill-function nil)) (force-mode-line-update))) |