From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: `hard-newline' changes trigger format=flowed in Gnus Date: Thu, 01 Dec 2005 18:44:57 +0100 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: References: <87k6er6m9l.fsf@stupidchicken.com> <7wlkz5ho7g.fsf@ece.lsu.edu> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133468559 21276 80.91.229.2 (1 Dec 2005 20:22:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Dec 2005 20:22:39 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 01 21:22:37 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ehutw-00075g-60 for ged-emacs-devel@m.gmane.org; Thu, 01 Dec 2005 21:19:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ehutu-0007iC-UJ for ged-emacs-devel@m.gmane.org; Thu, 01 Dec 2005 15:19:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ehuta-0007hB-O8 for emacs-devel@gnu.org; Thu, 01 Dec 2005 15:19:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EhutZ-0007ga-4R for emacs-devel@gnu.org; Thu, 01 Dec 2005 15:19:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhutY-0007gX-Vr for emacs-devel@gnu.org; Thu, 01 Dec 2005 15:19:09 -0500 Original-Received: from [134.60.1.1] (helo=mail.uni-ulm.de) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EhutY-0007uY-1i for emacs-devel@gnu.org; Thu, 01 Dec 2005 15:19:08 -0500 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.4/8.13.4) with ESMTP id jB1KIc8n026724; Thu, 1 Dec 2005 21:18:39 +0100 (MET) Original-Received: from me (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with SMTP id 0CD0A10D0E; Thu, 1 Dec 2005 21:18:36 +0100 (CET) Original-Received: (nullmailer pid 8317 invoked by uid 170); Thu, 01 Dec 2005 17:44:57 -0000 Original-To: emacs-devel@gnu.org, ding@gnus.org User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Mail-Followup-To: emacs-devel@gnu.org, ding@gnus.org X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l; 3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2; n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 (David Koppelman's message of "Wed, 30 Nov 2005 14:31:47 -0600") X-DCC-EATSERVER-Metrics: gemini 1166; Body=2 Fuz1=2 Fuz2=2 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:46855 gmane.emacs.gnus.general:61451 Archived-At: On Wed, Nov 30 2005, David Koppelman wrote: > Reiner Steib writes: > >> There is some information in emacs-mime.texi: >> >> ,----[ (info "(emacs-mime)Flowed text") ] >> | The Emacs MIME library will respect the `use-hard-newlines' variable >> | (*note Hard and Soft Newlines: (emacs)Hard and Soft Newlines.) when >> | encoding a message, and the "format=flowed" Content-Type parameter when >> | decoding a message. [...] >> IMHO, it won't hurt to add a short note and reference to this >> explanation in gnus.texi and message.texi. The only occurrence is in >> the "New Features" section (info "(gnus)Oort Gnus"). Suggestions? > > If I understand things correctly if soft and hard newline characters > are found The code (see `mml-generate-mime-1') checks for hard newlines: (text-property-any (point-min) (point-max) 'hard 't) The soft newlines are the normal '\n'-s without any special text property. (At least that is my understanding, CMIIW.) > then it will be assumed that a soft newline is what was intended and > so text will be flowed, no questions asked. But there are many cases > in which the soft newline character is there by "accident". Maybe you meant "hard newline" in this paragraph? > The sender won't know until the recipient gets back to the sender > and then the sender will have to delve deeply into lisp or the > documentation to diagnose the problem and develop a workaround. ACK. I only noticed this bug because I was sending mail to some other account of mine while testing /etc/postfix/virtual (therefore copying the headers of the message into the body). > Therefore one must be much more careful before flowing. Perhaps some > combination of the following: > > Some indication that text will be assumed flowable, perhaps in the > modeline or perhaps by highlighting around the soft newlines. Probably highlighting hard newlines is possible. I guess people on emacs-devel can tell you how. Performing a "flowable" test while writing a message doesn't make much sense IMHO. > If flowability has been assumed then ask the user if that's correct and > take yes, yes always, no, and no never responses. Maybe something like this? --8<---------------cut here---------------start------------->8--- --- mml.el 01 Nov 2005 14:18:40 +0100 7.38 +++ mml.el 01 Dec 2005 18:27:37 +0100 @@ -413,6 +413,8 @@ cont))) (buffer-string))))) +(defvar mml-confirm-flow-fill t) + (defun mml-generate-mime-1 (cont) (let ((mm-use-ultra-safe-encoding (or mm-use-ultra-safe-encoding (assq 'sign cont)))) @@ -481,16 +483,21 @@ ;; parts where there either isn't a format parameter ;; in the mml tag or it says "flowed" and there ;; actually are hard newlines in the text. - (let (use-hard-newlines) + (let (found-hard-newlines) (when (and (string= type "text/plain") (not (string= (cdr (assq 'sign cont)) "pgp")) (or (null (assq 'format cont)) (string= (cdr (assq 'format cont)) "flowed")) - (setq use-hard-newlines + (setq found-hard-newlines (text-property-any (point-min) (point-max) 'hard 't))) - (fill-flowed-encode) + (when (and found-hard-newlines + (or mml-confirm-flow-fill + (y-or-n-p + "Hard newlines found. Send as \"format=flowed\"? "))) + (let ((use-hard-newlines found-hard-newlines)) + (fill-flowed-encode))) ;; Indicate that `mml-insert-mime-headers' should ;; insert a "; format=flowed" string unless the ;; user has already specified it. --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/