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: Tue, 14 Nov 2006 16:36:56 +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 1163493454 28057 80.91.229.2 (14 Nov 2006 08:37:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Nov 2006 08:37:34 +0000 (UTC) Cc: rms@gnu.org, monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 14 09:37:28 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 1GjtnD-0006Al-Uw for ged-emacs-devel@m.gmane.org; Tue, 14 Nov 2006 09:37:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjtnD-0003Qy-59 for ged-emacs-devel@m.gmane.org; Tue, 14 Nov 2006 03:37:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gjtn0-0003Qk-5c for emacs-devel@gnu.org; Tue, 14 Nov 2006 03:37:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gjtmy-0003Pw-0c for emacs-devel@gnu.org; Tue, 14 Nov 2006 03:37:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gjtmx-0003Pk-LM for emacs-devel@gnu.org; Tue, 14 Nov 2006 03:37:03 -0500 Original-Received: from [65.54.246.201] (helo=bay0-omc3-s1.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gjtmv-0007wb-45; Tue, 14 Nov 2006 03:37:01 -0500 Original-Received: from hotmail.com ([64.4.38.29]) by bay0-omc3-s1.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 14 Nov 2006 00:37:00 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 14 Nov 2006 00:36:59 -0800 Original-Received: from 64.4.38.200 by by116fd.bay116.hotmail.msn.com with HTTP; Tue, 14 Nov 2006 08:36:56 GMT X-Originating-IP: [202.165.107.100] 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: 14 Nov 2006 08:36:59.0426 (UTC) FILETIME=[0CE0C820:01C707C8] 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:62291 Archived-At: Please wait a moment, let me find if there are other sulotions, just as Stefan said. Regards, Guanpeng Xu >From: "Herbert Euler" >To: emacs-devel@gnu.org >Subject: Patch: Syntax and Hard Newlines >Date: Mon, 13 Nov 2006 13:24:59 +0800 > >Emacs provides a hard newline mode. If you type M-x use-hard-newlines >RET, you turn on the hard newline mode. In this mode, all newlines in >a buffer are re-scanned and marked as either a ``hard'' one or a >``soft'' one. The behavior of commands inserting a newline character >is also altered: `newline' and `open-line' will add the text property >`hard' (value set to t) to newlines that they insert. > >As documented in the doc string of the command `use-hard-newlines', >newlines not marked hard are internal to paragraphs. However, >currently the syntax feature does not work well with this. For >example, if you turn on long-lines mode with M-x longlines-mode RET in >the *scratch* buffer, you will see the word `evaluation' in the first >line is wrapped into the second line, but not recognized as a part of >the comment. > >To fix this, we can let the function `forw_comment' in syntax.c skip >the soft newlines when possible. Below is the patch. > >Regards, >Guanpeng Xu > >Index: syntax.c >=================================================================== >RCS file: /sources/emacs/emacs/src/syntax.c,v >retrieving revision 1.166.4.20 >diff -r1.166.4.20 syntax.c >2126a2127 >> register int skip_soft_newlines; >2129a2131,2137 >> /* 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"))); >> >2145a2154,2163 >> 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; >> } > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! Download today it's FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > >_______________________________________________ >Emacs-devel mailing list >Emacs-devel@gnu.org >http://lists.gnu.org/mailman/listinfo/emacs-devel _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/