To specify a fill prefix for the current buffer, move to a line that
starts with the desired prefix, put point at the end of the prefix,
and type @w{@kbd{C-x .}}@: (@code{set-fill-prefix}). (That's a period
-after the @kbd{C-x}.) To turn off the fill prefix, specify an empty
-prefix: type @w{@kbd{C-x .}}@: with point at the beginning of a line.
+after the @kbd{C-x}.) To turn off the fill prefix, either type
+@w{@kbd{C-u C-x .}}@: or specify an empty prefix: type @w{@kbd{C-x .}}@:
+with point at the beginning of a line.
When a fill prefix is in effect, the fill commands remove the fill
prefix from each line of the paragraph before filling, and insert it
See the documentation of `kinsoku' for more information."
:type 'boolean)
-(defun set-fill-prefix ()
+(defun set-fill-prefix (&optional arg)
"Set the fill prefix to the current line up to point.
Filling expects lines to start with the fill prefix and
-reinserts the fill prefix in each resulting line."
- (interactive)
- (let ((left-margin-pos (save-excursion (move-to-left-margin) (point))))
- (if (> (point) left-margin-pos)
- (progn
- (setq fill-prefix (buffer-substring left-margin-pos (point)))
- (if (equal fill-prefix "")
+reinserts the fill prefix in each resulting line.
+With a prefix argument, cancel the fill prefix."
+ (interactive "P")
+ (if arg
+ (setq fill-prefix nil)
+ (let ((left-margin-pos (save-excursion (move-to-left-margin) (point))))
+ (if (> (point) left-margin-pos)
+ (progn
+ (setq fill-prefix (buffer-substring left-margin-pos (point)))
+ (when (equal fill-prefix "")
(setq fill-prefix nil)))
- (setq fill-prefix nil)))
+ (setq fill-prefix nil))))
(if fill-prefix
(message "fill-prefix: \"%s\"" fill-prefix)
- (message "fill-prefix canceled")))
+ (message "fill-prefix cancelled")))
(defcustom adaptive-fill-mode t
"Non-nil means determine a paragraph's fill prefix from its text."