X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/35fb32880c99aa7cd41b835dc17b8639b544dc69..ea0857a126fbd38e96fd499c7173341a3e8614b6:/lisp/textmodes/refill.el diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el index 736fba2932..d6b355bdd0 100644 --- a/lisp/textmodes/refill.el +++ b/lisp/textmodes/refill.el @@ -1,7 +1,6 @@ ;;; refill.el --- `auto-fill' by refilling paragraphs on changes -;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, -;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2000-2012 Free Software Foundation, Inc. ;; Author: Dave Love ;; Maintainer: Miles Bader @@ -84,8 +83,6 @@ ;;; Code: -(eval-when-compile (require 'cl)) - (defgroup refill nil "Refilling paragraphs on changes." :group 'fill) @@ -170,8 +167,8 @@ complex processing.") "Post-command function to do refilling (conditionally)." (when refill-doit ; there was a change ;; There's probably scope for more special cases here... - (case this-command - (self-insert-command + (pcase this-command + (`self-insert-command ;; Treat self-insertion commands specially, since they don't ;; always reset `refill-doit' -- for self-insertion commands that ;; *don't* cause a refill, we want to leave it turned on so that @@ -181,9 +178,9 @@ complex processing.") ;; newline, covered below). (refill-fill-paragraph-at refill-doit) (setq refill-doit nil))) - ((quoted-insert fill-paragraph fill-region) nil) - ((newline newline-and-indent open-line indent-new-comment-line - reindent-then-newline-and-indent) + ((or `quoted-insert `fill-paragraph `fill-region) nil) + ((or `newline `newline-and-indent `open-line `indent-new-comment-line + `reindent-then-newline-and-indent) ;; Don't zap what was just inserted. (save-excursion (beginning-of-line) ; for newline-and-indent @@ -197,7 +194,7 @@ complex processing.") (save-restriction (narrow-to-region (line-beginning-position) (point-max)) (refill-fill-paragraph-at refill-doit)))) - (t + (_ (refill-fill-paragraph-at refill-doit))) (setq refill-doit nil))) @@ -214,12 +211,17 @@ complex processing.") ;;;###autoload (define-minor-mode refill-mode - "Toggle Refill minor mode. -With prefix arg, turn Refill mode on if arg is positive, otherwise turn it off. + "Toggle automatic refilling (Refill mode). +With a prefix argument ARG, enable Refill mode if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil. + +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. -When Refill mode is on, the current paragraph will be formatted when -changes are made within it. Self-inserting characters only cause -refilling if they would cause auto-filling." +For true \"word wrap\" behavior, use `visual-line-mode' instead." :group 'refill :lighter " Refill" :keymap '(("\177" . backward-delete-char-untabify)) @@ -258,5 +260,4 @@ refilling if they would cause auto-filling." (provide 'refill) -;; arch-tag: 2c4ce9e8-1daa-4a3b-b6f8-fd6ac5bf6138 ;;; refill.el ends here