emacs-devel
[Top][All Lists]
Advanced

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

RE: Patch: Syntax and Hard Newlines


From: Herbert Euler
Subject: RE: Patch: Syntax and Hard Newlines
Date: Mon, 13 Nov 2006 18:12:12 +0800

I'm so sorry, but I re-generated it in the format
described in the "Sending Patches" secion in Emacs
manual.

I will follow what are said there in the future.

Index: syntax.c
===================================================================
RCS file: /sources/emacs/emacs/src/syntax.c,v
retrieving revision 1.166.4.20
diff -c -r1.166.4.20 syntax.c
*** syntax.c    20 Sep 2006 06:04:11 -0000      1.166.4.20
--- syntax.c    13 Nov 2006 10:02:58 -0000
***************
*** 2124,2132 ****
--- 2124,2140 ----
   register int c, c1;
   register enum syntaxcode code;
   register int syntax;
+   register int skip_soft_newlines;

   if (nesting <= 0) nesting = -1;

+   /* If `use-hard-newlines' is t, only newlines with the `hard'
+      property set to t are real newlines.  Other newlines are soft and
+      should be skipped. */
+   skip_soft_newlines = !NILP (Fsymbol_value
+                               (intern
+                                ("use-hard-newlines")));
+
   /* Enter the loop in the middle so that we find
      a 2-char comment ender if we start in the middle of it.  */
   syntax = prev_syntax;
***************
*** 2143,2148 ****
--- 2151,2166 ----
       }
       c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
       syntax = SYNTAX_WITH_FLAGS (c);
+       if (skip_soft_newlines
+           && c == '\n'
+           && NILP (Fget_text_property (make_number (from_byte),
+                                        intern ("hard"),
+                                        Qnil)))
+         {
+           INC_BOTH (from, from_byte);
+           UPDATE_SYNTAX_TABLE_FORWARD (from);
+           continue;
+         }
       code = syntax & 0xff;
       if (code == Sendcomment
         && SYNTAX_FLAGS_COMMENT_STYLE (syntax) == style

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/





reply via email to

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