emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Longlines and insert


From: Paul Pogonyshev
Subject: Re: Longlines and insert
Date: Tue, 15 Nov 2005 22:41:20 +0200
User-agent: KMail/1.7.2

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]