From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Longlines and insert Date: Wed, 16 Nov 2005 17:01:31 -0500 Message-ID: References: <874q6fa1t0.wl%david.wallin@ul.ie> <87hdaebqxb.fsf@stupidchicken.com> <200511152241.20666.pogonyshev@gmx.net> <873blxjysz.fsf-monnier+emacs@gnu.org> <8764qt9u85.fsf@stupidchicken.com> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1132178790 13002 80.91.229.2 (16 Nov 2005 22:06:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 Nov 2005 22:06:30 +0000 (UTC) Cc: ihs_4664@yahoo.com, pogonyshev@gmx.net, monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 16 23:06:16 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EcVNJ-0006pT-6t for ged-emacs-devel@m.gmane.org; Wed, 16 Nov 2005 23:03:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EcVNI-0000G8-Jx for ged-emacs-devel@m.gmane.org; Wed, 16 Nov 2005 17:03:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EcVLW-0007zN-5R for emacs-devel@gnu.org; Wed, 16 Nov 2005 17:01:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EcVLS-0007xf-VR for emacs-devel@gnu.org; Wed, 16 Nov 2005 17:01:35 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EcVLS-0007xP-Ko for emacs-devel@gnu.org; Wed, 16 Nov 2005 17:01:34 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EcVLS-0001Pf-6Q for emacs-devel@gnu.org; Wed, 16 Nov 2005 17:01:34 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EcVLP-0004Qv-Af; Wed, 16 Nov 2005 17:01:31 -0500 Original-To: Chong Yidong In-reply-to: <8764qt9u85.fsf@stupidchicken.com> (message from Chong Yidong on Tue, 15 Nov 2005 21:55:54 -0500) 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:46117 Archived-At: > Maybe longlines-mode could provide a variable > "longlines-inserted-LF-are-hard" and then use it in an > after-change-functions hook to mark all inserted LF as hard when that > variable is non-nil. > > I'd guess that the variable should be non-nil by default and only bound to > nil at a few specific spots, hopefully all of them in longlines.el. The problem with using an after-change-function is that the function is only told that the text was changed in a particular region, not what the change was. There is no way to tell whether a soft newline encountered in that region is a legit soft newline, or one produced by an (insert "foo\n") call. A before-change-function can record the old text, and the after-change-function can compare the new text with it. That way it can see whether newlines were inserted. However, if we really want a feature that makes all inserted newlines hard, it would be easier to implement that within `insert' itself. Let me be a little more specific: this would be a variable `insert-string-filters', normally bound to nil. insert_string (in insdel.c) checks the value of insert-string-filters passed to it. If non-nil, it makes use of it as follows: I think the added generality of that feature would, in this case, be a mistake. It would make things slower and harder to use. If the hard-newline variable is enough to do the job, I would rather stick to that idea. It is simpler and less risky.