From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: longlines.el fix? Date: Wed, 23 Nov 2005 17:16:49 +0100 Message-ID: <8564qjwd8u.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1132765550 16879 80.91.229.2 (23 Nov 2005 17:05:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2005 17:05:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 23 18:05:48 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eey0S-0008Of-CW for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2005 18:02:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eey0R-00034I-KM for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2005 12:02:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EexIk-0006TR-I3 for emacs-devel@gnu.org; Wed, 23 Nov 2005 11:16:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EexIj-0006Su-Ra for emacs-devel@gnu.org; Wed, 23 Nov 2005 11:16:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EexIj-0006Sd-9p for emacs-devel@gnu.org; Wed, 23 Nov 2005 11:16:53 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EexIj-0004Nd-8G for emacs-devel@gnu.org; Wed, 23 Nov 2005 11:16:53 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1EexIf-0003jQ-8N; Wed, 23 Nov 2005 11:16:51 -0500 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 7445F1C12C94; Wed, 23 Nov 2005 17:16:50 +0100 (CET) Original-To: Chong Yidong , emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:46485 Archived-At: --=-=-= I just noticed that a suggestion of mine for preserving markers when inserting has made it into longlines.el. In my private copy, I also have the following fix in. Since I rarely use longlines.el, it has seen only cursory testing. Does anybody see a particular problem with it? If not, maybe we should check it in so that it gets some testing. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Index: longlines.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/longlines.el,v retrieving revision 1.20 diff -u -r1.20 longlines.el --- longlines.el 20 Nov 2005 05:17:27 -0000 1.20 +++ longlines.el 23 Nov 2005 16:08:37 -0000 @@ -245,19 +245,24 @@ (forward-char 1) nil) (if (longlines-merge-lines-p) - (progn (end-of-line) - (delete-char 1) - ;; After certain commands (e.g. kill-line), there may be two - ;; successive soft newlines in the buffer. In this case, we - ;; replace these two newlines by a single space. Unfortunately, - ;; this breaks the conservation of (spaces + newlines), so we - ;; have to fiddle with longlines-wrap-point. - (if (or (bolp) (eolp)) - (if (> longlines-wrap-point (point)) - (setq longlines-wrap-point - (1- longlines-wrap-point))) - (insert-char ? 1)) - nil) + (let ((bolp (progn (end-of-line) (bolp)))) + (forward-char 1) + ;; After certain commands (e.g. kill-line), there may be two + ;; successive soft newlines in the buffer. In this case, we + ;; replace these two newlines by a single space. Unfortunately, + ;; this breaks the conservation of (spaces + newlines), so we + ;; have to fiddle with longlines-wrap-point. + (if (or bolp (eolp)) + (progn + (delete-char -1) + (if (> longlines-wrap-point (point)) + (setq longlines-wrap-point + (1- longlines-wrap-point)))) + (insert-before-markers-and-inherit " ") + (backward-char 1) + (delete-char -1) + (forward-char 1)) + nil) (forward-line 1) t))) --=-=-= -- David Kastrup, Kriemhildstr. 15, 44793 Bochum --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--