Mercurial > emacs
comparison lisp/simple.el @ 15263:0d7899c372ed
(do-auto-fill): Return t if real work was done.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 21 May 1996 14:31:40 +0000 |
parents | dd31d59ec31b |
children | c23c9712ef5c |
comparison
equal
deleted
inserted
replaced
15262:b455f3f77823 | 15263:0d7899c372ed |
---|---|
2328 (make-variable-buffer-local 'fill-prefix) | 2328 (make-variable-buffer-local 'fill-prefix) |
2329 | 2329 |
2330 (defconst auto-fill-inhibit-regexp nil | 2330 (defconst auto-fill-inhibit-regexp nil |
2331 "*Regexp to match lines which should not be auto-filled.") | 2331 "*Regexp to match lines which should not be auto-filled.") |
2332 | 2332 |
2333 ;; This function is the auto-fill-function of a buffer | |
2334 ;; when Auto-Fill mode is enabled. | |
2335 ;; It returns t if it really did any work. | |
2333 (defun do-auto-fill () | 2336 (defun do-auto-fill () |
2334 (let (fc justify bol give-up | 2337 (let (fc justify bol give-up |
2335 (fill-prefix fill-prefix)) | 2338 (fill-prefix fill-prefix)) |
2336 (if (or (not (setq justify (current-justification))) | 2339 (if (or (not (setq justify (current-justification))) |
2337 (null (setq fc (current-fill-column))) | 2340 (null (setq fc (current-fill-column))) |
2417 (if (>= (current-column) prev-column) | 2420 (if (>= (current-column) prev-column) |
2418 (setq give-up t))) | 2421 (setq give-up t))) |
2419 ;; No place to break => stop trying. | 2422 ;; No place to break => stop trying. |
2420 (setq give-up t)))) | 2423 (setq give-up t)))) |
2421 ;; justify last line | 2424 ;; justify last line |
2422 (justify-current-line justify t t)))) | 2425 (justify-current-line justify t t) |
2426 t))) | |
2423 | 2427 |
2424 (defun auto-fill-mode (&optional arg) | 2428 (defun auto-fill-mode (&optional arg) |
2425 "Toggle auto-fill mode. | 2429 "Toggle auto-fill mode. |
2426 With arg, turn Auto-Fill mode on if and only if arg is positive. | 2430 With arg, turn Auto-Fill mode on if and only if arg is positive. |
2427 In Auto-Fill mode, inserting a space at a column beyond `current-fill-column' | 2431 In Auto-Fill mode, inserting a space at a column beyond `current-fill-column' |