From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: Longlines and insert Date: Tue, 15 Nov 2005 22:41:20 +0200 Message-ID: <200511152241.20666.pogonyshev@gmx.net> References: <874q6fa1t0.wl%david.wallin@ul.ie> <87hdaebqxb.fsf@stupidchicken.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1132087583 24064 80.91.229.2 (15 Nov 2005 20:46:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2005 20:46:23 +0000 (UTC) Cc: Kevin Rodgers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 15 21:46:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ec7ef-0002RT-4a for ged-emacs-devel@m.gmane.org; Tue, 15 Nov 2005 21:43:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ec7ee-0004Wg-0W for ged-emacs-devel@m.gmane.org; Tue, 15 Nov 2005 15:43:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ec7eA-0004Nt-9x for emacs-devel@gnu.org; Tue, 15 Nov 2005 15:43:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ec7e8-0004M6-2p for emacs-devel@gnu.org; Tue, 15 Nov 2005 15:43:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ec7e7-0004Lk-EQ for emacs-devel@gnu.org; Tue, 15 Nov 2005 15:43:15 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Ec7e7-0007qL-Ct for emacs-devel@gnu.org; Tue, 15 Nov 2005 15:43:15 -0500 Original-Received: (qmail invoked by alias); 15 Nov 2005 20:38:27 -0000 Original-Received: from unknown (EHLO [194.158.218.65]) [194.158.218.65] by mail.gmx.net (mp026) with SMTP; 15 Nov 2005 21:38:27 +0100 X-Authenticated: #16844820 Original-To: emacs-devel@gnu.org User-Agent: KMail/1.7.2 In-Reply-To: Content-Disposition: inline X-Y-GMX-Trusted: 0 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:46044 Archived-At: Kevin Rodgers wrote: > Chong Yidong wrote: > > The problem is that mail-setup inserts the header fields by calling > > > > (insert "blahblah\n") > > > > The inserted newlines are not marked as hard, so longlines gets > > confused. > > > > I could fix this by going through sendmail.el and adding (newline) to > > all these places. But maybe a more wide-reaching solution is called > > for. > > How about a less invasive change? The headers are actually inserted > like this: > > (insert header "\n") > > Which I think could be fixed like this: > > (let ((hard-newline "\n")) > ;; see set-hard-newline-properties: > (put-text-property 0 1 'hard t hard-newline) > (put-text-property 0 1 'rear-nonsticky '(hard) hard-newline) > ... > (insert header hard-newline)) I think (and as far as I understood, Chong Yidong does too) that this is a welcoming message for future problems. You patch up a piece of code, while there are hundreds other lisp files, many of which insert newlines, some of which need to be hard. We probably need something generic. At the very least we need a convenience function to create a newline-string with the necessary properties already set, so we don't have to go over the lines above each time. Paul