
(defun set-fill-prefix nil "\
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) (byte-code " `)`\"\" $ \"' !" [fill-prefix nil buffer-substring beginning-of-line equal "" message "fill-prefix: \"%s\"" "fill-prefix cancelled"] 6))

(defun fill-region-as-paragraph (from to &optional justify-flag) "\
Fill region as one paragraph: break lines to fit fill-column.
Prefix arg means justify too.
From program, pass args FROM, TO and JUSTIFY-FLAG." (interactive "r
P") (byte-code "ň	\"eb!`d\"`' \"?' !
i GY6 !eb!m?W 
!O `!\"!> eb
!e G!`)b#| cn d$b!# !!h>) エ \\!\" db cebm?.T!m ł !! n iY ! !!c m?\"?ci*m?*! ! ))" [from to fpre fill-prefix fill-column nil t prefixcol justify-flag narrow-to-region skip-chars-forward "
" equal "" regexp-quote error "fill-prefix too long for specified width" forward-line 1 looking-at delete-region match-end 0 forward-char re-search-forward "[.?!][])\"']*$" 32 subst-char-in-region 10 " 	" "   *" match-beginning skip-chars-backward " ])\"'" (46 63 33) 2 delete-horizontal-space "  " move-to-column "^ 
" zerop -1 " " justify-current-line] 35))

(defun fill-paragraph (arg) "\
Fill paragraph at or after point.
Prefix arg means justify as well." (interactive "P") (byte-code " n !` `	#))" [end arg nil forward-paragraph newline 1 backward-paragraph fill-region-as-paragraph] 7))

(defun fill-region (from to &optional justify-flag) "\
Fill each of the paragraphs in the region.
Prefix arg (non-nil third arg, if called from program)
means justify as well." (interactive "r
P") (byte-code "ň	\"ebm?1 `!`!`
Y* `#, b* )" [from to initial end justify-flag nil narrow-to-region forward-paragraph 1 -1 fill-region-as-paragraph] 8))

(defun justify-current-line nil "\
Add spaces to line point is in, so it ends at fill-column." (interactive) (byte-code "ƈ G!!i` 
`\"
b#S !!h>)I ؂J \\!\"- 
b#i !cW dbi#ԉ# !	Tz 	Vdb# 	\"\"! 	\"	\"V  \"	\"		HV 	IS) db	#	HV c	T	! )-))" [ncols nwhites beg indent flags fill-prefix nil t fill-column where beginning-of-line forward-char skip-chars-forward " 	" end-of-line narrow-to-region re-search-forward "   *" delete-region match-beginning 0 skip-chars-backward " ])\"'" (46 63 33) 2 1 match-end "[.?!][])\"']*
" -1 32 - search-backward " " insert-char / % make-string logand 262143 random] 28))

(defun fill-individual-paragraphs (min max &optional justifyp mailp) "\
Fill each paragraph in region according to its individual fill prefix.
Calling from a program, pass range to fill as first two arguments.
Optional third and fourth arguments JUSTIFY-FLAG and MAIL-FLAG:
JUSTIFY-FLAG to justify paragraphs (prefix arg),
MAIL-FLAG for a mail message, i. e. don't fill header lines." (interactive "r
P") (byte-code "Ɉb 	 ! ! `
\"!m?  `: !?N `!`)\"!!m?r !?r !p G!!?)z Ɉ3 n`# !)+! ))" [min mailp max start fill-prefix fill-prefix-regexp paragraph-separate had-newline justifyp nil beginning-of-line looking-at "[^ 	
]*:" forward-line 1 narrow-to-region skip-chars-forward " 	
" buffer-substring " 	" regexp-quote forward-char fill-region-as-paragraph delete-char -1] 20))
