;; Todo: encoding, implement basic `fill-region' (Emacs and XEmacs
;; implementations differ..)
-;; History:
+;;; History:
;; 2000-02-17 posted on ding mailing list
;; 2000-02-19 use `point-at-{b,e}ol' in XEmacs
(eval-and-compile
(defalias 'fill-flowed-point-at-bol
- (if (fboundp 'point-at-bol)
- 'point-at-bol
- 'line-beginning-position))
+ (if (fboundp 'point-at-bol)
+ 'point-at-bol
+ 'line-beginning-position))
- (defalias 'fill-flowed-point-at-eol
- (if (fboundp 'point-at-eol)
- 'point-at-eol
- 'line-end-position)))
+ (defalias 'fill-flowed-point-at-eol
+ (if (fboundp 'point-at-eol)
+ 'point-at-eol
+ 'line-end-position)))
(defun fill-flowed (&optional buffer)
(save-excursion
(save-excursion
(unless (eobp)
(forward-char 1)
- (looking-at (format "^\\(%s\\)\\([^>]\\)" (or quote " ?"))))))
+ (looking-at (format "^\\(%s\\)\\([^>]\\)"
+ (or quote " ?"))))))
(save-excursion
(replace-match (if (string= (match-string 2) " ")
"" "\\2")))
(unless sig
(let ((fill-prefix (when quote (concat quote " "))))
(fill-region (fill-flowed-point-at-bol)
- (fill-flowed-point-at-eol)
+ (min (1+ (fill-flowed-point-at-eol)) (point-max))
'left 'nosqueeze))))))))
(provide 'flow-fill)