emacs-devel
[Top][All Lists]
Advanced

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

Longlines and insert


From: Chong Yidong
Subject: Longlines and insert
Date: Mon, 14 Nov 2005 21:12:00 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

I got a bug report from a user who had longlines-mode turned on for
text-mode and all its derivatives, and found that it didn't play well
with `M-x mail'.

(The fact that longlines was originally written as a hack is sadly
apparent when situations like this arise...)

> (add-hook 'text-mode-hook 'longlines-mode)
>
> I have to disable longlines in mail-mode-hook to reenable it in
> wl-mail-setup-hook. This seems to be because of some filling
> operations when mail-mode is initialized. Don't know, is this a
> problem with longlines or mail-mode?
>
> The second problem is bothering me more. It has to do with attaching
> a binary file when editing an email. It looks like a space is turned
> into a hard newline

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.

One possibility is to define a new variable `insert-filters', to store
a list of filter functions to run on strings before they are inserted
(analogous to `buffer-substring-filters').

I don't know if this is too invasive a change, especially before a
release, and just for the sake of longlines mode.

What do people think?




reply via email to

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