From: Stefan Monnier Date: Fri, 12 Apr 2002 00:01:53 +0000 (+0000) Subject: (fill-context-prefix): Fix up last change. X-Git-Tag: ttn-vms-21-2-B4~15685 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4599773d96f8d587d2026ebb96865105e16743fc;p=emacs.git (fill-context-prefix): Fix up last change. --- diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 8f840d7624c..5a39ba4d8b1 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -244,14 +244,16 @@ act as a paragraph-separator." ;; just use it (this subsumes the 2 checks used previously). ;; Used when first line is `/* ...' and second-line is ;; ` * ...'. - (string-match - (concat "\\`" - (mapconcat - (lambda (c) (regexp-quote (string c))) - (replace-regexp-in-string "[ \t]+" "" first-line-prefix) - "?") - "?\\'") - (replace-regexp-in-string "[ \t]+" "" second-line-prefix)) + (let ((flp (replace-regexp-in-string + "[ \t]+" "" first-line-prefix))) + (if (equal flp "") + (string-match "\\`[ \t]*\\'" second-line-prefix) + (string-match + (concat "\\`" + (mapconcat + (lambda (c) (regexp-quote (string c))) flp "?") + "?\\'") + (replace-regexp-in-string "[ \t]+" "" second-line-prefix)))) second-line-prefix ;; Use the longest common substring of both prefixes,