emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/fill.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/fill.el,v
Date: Sun, 07 Jan 2007 20:11:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/01/07 20:11:47

Index: fill.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/fill.el,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -b -r1.195 -r1.196
--- fill.el     29 Dec 2006 21:39:08 -0000      1.195
+++ fill.el     7 Jan 2007 20:11:47 -0000       1.196
@@ -838,15 +838,19 @@
             (commark
              (comment-string-strip (buffer-substring comstart comin) nil t))
             (comment-re
-             ;; `commark' is surrounded with arbitrary text (`\0' and `a')
-             ;;  to make sure it can be used as an optimization of
-             ;; `comment-start-skip' in the middle of a line.  For example,
-             ;; `commark' can't be used with the "@c" in TeXinfo (hence
-             ;; the `a') or with the "C" at BOL in Fortran (hence the `\0').
+              ;; A regexp more specialized than comment-start-skip, that only
+              ;; matches the current commark rather than any valid commark.
+              ;; 
+              ;; The specialized regexp only works for "normal" comment
+              ;; syntax, not for Texinfo's "@c" (which can't be immediately
+              ;; followed by word-chars) or Fortran's "C" (which needs to be
+              ;; at bol), so check that comment-start-skip indeed allows the
+              ;; commark to appear in the middle of the line and followed by
+              ;; word chars.  The choice of "\0" and "a" is mostly arbitrary.
              (if (string-match comment-start-skip (concat "\0" commark "a"))
                  (concat "[ \t]*" (regexp-quote commark)
-                         ;; Make sure we only match comments that use
-                         ;; the exact same comment marker.
+                          ;; Make sure we only match comments that
+                          ;; use the exact same comment marker.
                          "[^" (substring commark -1) "]")
                (concat "[ \t]*\\(?:" comment-start-skip "\\)")))
             (comment-fill-prefix       ; Compute a fill prefix.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]