]> git.eshelyaron.com Git - emacs.git/commitdiff
(fill-context-prefix): Be stricter about
authorRichard M. Stallman <rms@gnu.org>
Sun, 27 Jul 1997 19:56:21 +0000 (19:56 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 27 Jul 1997 19:56:21 +0000 (19:56 +0000)
whether first-line prefix is compatible with second-line prefix.

lisp/textmodes/fill.el

index e4ebd2a903084052e525ce2e182ba79fef9e1f7e..d73da1105f6c4c3781d998a0435b48ccdf67d227 100644 (file)
@@ -210,12 +210,14 @@ act as a paragraph-separator."
          ;; If we get a fill prefix from the second line,
          ;; make sure it or something compatible is on the first line too.
          (and second-line-prefix first-line-prefix
-              (if (or (string-match (regexp-quote second-line-prefix)
+              (if (or (string-match (concat "\\`"
+                                            (regexp-quote second-line-prefix)
+                                            "\\(\\'\\|[ \t]\\)")
                                     first-line-prefix)
-                      (and (string-match "[ \t]" second-line-prefix)
+                      (and (string-match "\\`[ \t]+\\'" second-line-prefix)
                            (>= (string-width first-line-prefix)
                                (string-width second-line-prefix))))
-                    second-line-prefix))
+                  second-line-prefix))
        ;; If we get a fill prefix from a one-line paragraph,
        ;; maybe change it to whitespace,
        ;; and check that it isn't a paragraph starter.