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: Thu, 16 Nov 2006 14:23:45 +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 1163658461 11477 80.91.229.2 (16 Nov 2006 06:27:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Nov 2006 06:27:41 +0000 (UTC) Cc: rms@gnu.org, monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 16 07:27:39 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 1Gkain-0002sH-B0 for ged-emacs-devel@m.gmane.org; Thu, 16 Nov 2006 07:27:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gkaih-0008Fe-HD for ged-emacs-devel@m.gmane.org; Thu, 16 Nov 2006 01:27:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GkagW-0007G4-UG for emacs-devel@gnu.org; Thu, 16 Nov 2006 01:25:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GkagT-0007EJ-OC for emacs-devel@gnu.org; Thu, 16 Nov 2006 01:25:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GkagT-0007E8-18 for emacs-devel@gnu.org; Thu, 16 Nov 2006 01:25:13 -0500 Original-Received: from [199.232.41.67] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GkagR-0003BM-6B; Thu, 16 Nov 2006 01:25:11 -0500 Original-Received: from [65.54.246.113] (helo=bay0-omc1-s41.bay0.hotmail.com) by mx20.gnu.org with esmtp (Exim 4.52) id 1GkagP-0002xF-Dq; Thu, 16 Nov 2006 01:25:09 -0500 Original-Received: from hotmail.com ([64.4.26.27]) by bay0-omc1-s41.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 15 Nov 2006 22:23:46 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 15 Nov 2006 22:23:46 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Thu, 16 Nov 2006 06:23:45 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: 16 Nov 2006 06:23:46.0325 (UTC) FILETIME=[C571DC50:01C70947] 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:62370 Archived-At: Summing up: * longlines.el (longlines-mode): Set `parse-sexp-lookup-properties' so that syntax parsing uses text properties. (longlines-soft-newline): New constant. (longlines-wrap-line): Use `longlines-soft-newline' to make syntax parsing regard soft newlines the same as spaces. *** longlines.el.~1.2.2.16.~ Mon Nov 13 10:58:17 2006 --- longlines.el Thu Nov 16 13:49:15 2006 *************** *** 80,85 **** --- 80,91 ---- (defvar longlines-wrap-point nil) (defvar longlines-showing nil) + (defconst longlines-soft-newline + (propertize "\n" + 'syntax-table + '(0)) + "The soft newline character for wrapping long lines.") + (make-variable-buffer-local 'longlines-wrap-beg) (make-variable-buffer-local 'longlines-wrap-end) (make-variable-buffer-local 'longlines-wrap-point) *************** (define-minor-mode longlines-mode *** 112,117 **** --- 118,124 ---- (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) *************** (define-minor-mode longlines-mode *** 156,161 **** --- 163,169 ---- (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 () *** 240,246 **** If wrapping is performed, point remains on the line. If the line does not need to be wrapped, move point to the next line and return t." (if (longlines-set-breakpoint) ! (progn (insert-before-markers ?\n) (backward-char 1) (delete-char -1) (forward-char 1) --- 248,254 ---- If wrapping is performed, point remains on the line. If the line does not need to be wrapped, move point to the next line and return t." (if (longlines-set-breakpoint) ! (progn (insert-before-markers longlines-soft-newline) (backward-char 1) (delete-char -1) (forward-char 1) I chose Miles' approach, because it [1] is limited in `longlines.el', [2] takes the same effect both in interpretation and compilation. Regards, Guanpeng Xu _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/