From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: RE: Patch: Syntax and Hard Newlines Date: Mon, 13 Nov 2006 18:12:12 +0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1163412770 20793 80.91.229.2 (13 Nov 2006 10:12:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Nov 2006 10:12:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 13 11:12:43 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GjYnt-0002sr-KQ for ged-emacs-devel@m.gmane.org; Mon, 13 Nov 2006 11:12:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjYns-0005Xq-HM for ged-emacs-devel@m.gmane.org; Mon, 13 Nov 2006 05:12:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GjYnZ-0005X6-RH for emacs-devel@gnu.org; Mon, 13 Nov 2006 05:12:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GjYnW-0005UV-3Y for emacs-devel@gnu.org; Mon, 13 Nov 2006 05:12:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjYnV-0005UF-Sk for emacs-devel@gnu.org; Mon, 13 Nov 2006 05:12:13 -0500 Original-Received: from [65.54.246.174] (helo=bay0-omc2-s38.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GjYnV-0006f9-Lx for emacs-devel@gnu.org; Mon, 13 Nov 2006 05:12:13 -0500 Original-Received: from hotmail.com ([64.4.26.31]) by bay0-omc2-s38.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 13 Nov 2006 02:12:13 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 13 Nov 2006 02:12:12 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Mon, 13 Nov 2006 10:12:12 GMT X-Originating-IP: [216.145.54.158] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: herberteuler@hotmail.com, emacs-devel@gnu.org X-OriginalArrivalTime: 13 Nov 2006 10:12:12.0813 (UTC) FILETIME=[2FE8B3D0:01C7070C] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:62190 Archived-At: 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/