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: Wed, 15 Nov 2006 09:32:51 +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 1163554429 19113 80.91.229.2 (15 Nov 2006 01:33:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Nov 2006 01:33:49 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 15 02:33:42 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 1Gk9eT-0002kf-Qm for ged-emacs-devel@m.gmane.org; Wed, 15 Nov 2006 02:33:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gk9eS-0003Jh-F6 for ged-emacs-devel@m.gmane.org; Tue, 14 Nov 2006 20:33:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gk9eB-0003CN-IZ for emacs-devel@gnu.org; Tue, 14 Nov 2006 20:33:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gk9e6-00038H-R8 for emacs-devel@gnu.org; Tue, 14 Nov 2006 20:33:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gk9e6-00037P-46 for emacs-devel@gnu.org; Tue, 14 Nov 2006 20:32:58 -0500 Original-Received: from [65.54.246.79] (helo=bay0-omc1-s7.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gk9e5-00046x-GO; Tue, 14 Nov 2006 20:32:57 -0500 Original-Received: from hotmail.com ([64.4.26.32]) by bay0-omc1-s7.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 14 Nov 2006 17:32:56 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 14 Nov 2006 17:32:56 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Wed, 15 Nov 2006 01:32:51 GMT X-Originating-IP: [202.165.107.100] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: monnier@iro.umontreal.ca, rms@gnu.org X-OriginalArrivalTime: 15 Nov 2006 01:32:56.0069 (UTC) FILETIME=[F9DE5B50:01C70855] 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:62311 Archived-At: Ok, now we get two patches: * longlines.el (longlines-mode): Set `parse-sexp-lookup-properties' so that syntax parsing uses text properties. (longlines-wrap-line): Put the `syntax-table' text property to the soft newline if in a comment context. *** longlines.el.~1.2.2.16.~ Mon Nov 13 10:58:17 2006 --- longlines.el Wed Nov 15 09:27:18 2006 *************** *** 112,117 **** --- 112,118 ---- (make-local-variable 'buffer-substring-filters) (set (make-local-variable 'isearch-search-fun-function) 'longlines-search-function) + (set (make-local-variable 'parse-sexp-lookup-properties) t) (add-to-list 'buffer-substring-filters 'longlines-encode-string) (when longlines-wrap-follows-window-size (set (make-local-variable 'fill-column) *************** *** 156,161 **** --- 157,163 ---- (add-hook 'post-command-hook 'longlines-post-command-function nil t))) ;; Turn off longlines mode + (kill-local-variable 'parse-sexp-lookup-properties) (setq buffer-file-format (delete 'longlines buffer-file-format)) (if longlines-showing (longlines-unshow-hard-newlines)) *************** (defun longlines-wrap-line () *** 243,248 **** --- 245,257 ---- (progn (insert-before-markers ?\n) (backward-char 1) (delete-char -1) + (let* ((point (point)) + (state (syntax-ppss point))) + (if (nth 4 state) + ;; We are in a comment context. + (add-text-properties point + (1+ point) + '(syntax-table (14))))) (forward-char 1) nil) (if (longlines-merge-lines-p) Regards, Guanpeng Xu _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/