From f502672a0fac987b5d287d35d1d083667ca65f15 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 15 Oct 1999 12:05:22 +0000 Subject: [PATCH] (fill-cited-region): Increase `fill-column' if `fill-prefix' is too long to fill. (detect-paragraph-cited-prefix): Abolish a product of comparing each line if they are identical; don't include newlines in result. --- ChangeLog | 7 +++++++ mu-cite.el | 31 ++++++++++++++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e751b6..7c2f2fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-10-15 Katsumi Yamaoka + + * mu-cite.el (fill-cited-region): Increase `fill-column' if + `fill-prefix' is too long to fill. + (detect-paragraph-cited-prefix): Abolish a product of comparing + each line if they are identical; don't include newlines in result. + 1999-08-23 Katsumi Yamaoka * mu-cite.el (TopLevel): Don't require `widget'. diff --git a/mu-cite.el b/mu-cite.el index c4f449b..1bb8a08 100644 --- a/mu-cite.el +++ b/mu-cite.el @@ -435,18 +435,20 @@ TABLE defaults to the current buffer's category table." (let ((i 0) (prefix (buffer-substring (line-beginning-position) - (line-end-position))) - str ret) - (while (and (= (forward-line) 0) - (setq str (buffer-substring - (progn (beginning-of-line)(point)) - (progn (end-of-line)(point)))) - (setq ret (string-compare-from-top prefix str))) - (setq prefix - (if (stringp ret) - ret - (car (cdr ret)))) - (setq i (1+ i))) + (line-end-position)))) + (let ((init prefix) + str ret) + (while (and (= (forward-line) 0) + (setq str (buffer-substring + (progn (beginning-of-line)(point)) + (progn (end-of-line)(point)))) + (setq ret (string-compare-from-top prefix str))) + (setq prefix + (if (stringp ret) + ret + (car (cdr ret)))) + (or (string-equal init prefix) + (setq i (1+ i))))) (cond ((> i 1) prefix) ((> i 0) (goto-char (point-min)) @@ -471,7 +473,7 @@ TABLE defaults to the current buffer's category table." (goto-char (match-end 0)) (if (looking-at "[ \t]+") (goto-char (match-end 0))) - (buffer-substring (point-min)(point))) + (buffer-substring (line-beginning-position)(point))) (t ""))))) ;;;###autoload @@ -485,6 +487,9 @@ TABLE defaults to the current buffer's category table." (setq end (match-end 0))) (narrow-to-region beg end) (let* ((fill-prefix (detect-paragraph-cited-prefix)) + (fill-column (max (+ 1 (current-left-margin) + (string-width fill-prefix)) + (current-fill-column))) (pat (concat fill-prefix "\n"))) (goto-char (point-min)) (while (search-forward pat nil t) -- 1.7.10.4