From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86696 Path: news.gmane.org!not-for-mail From: Magnus Henoch Newsgroups: gmane.emacs.gnus.general Subject: Re: text/plain with 80 char wrap vs the flowed mime-type (whatever it is) Date: Thu, 04 Feb 2016 22:41:46 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1454625794 16010 80.91.229.3 (4 Feb 2016 22:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Feb 2016 22:43:14 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34922@lists.math.uh.edu Thu Feb 04 23:43:03 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aRScA-0007uU-Du for ding-account@gmane.org; Thu, 04 Feb 2016 23:43:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1aRSbN-0006KE-Lb; Thu, 04 Feb 2016 16:42:13 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1aRSbJ-0006JY-Qj for ding@lists.math.uh.edu; Thu, 04 Feb 2016 16:42:09 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1aRSbI-0001BB-Js for ding@lists.math.uh.edu; Thu, 04 Feb 2016 16:42:09 -0600 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]) by quimby.gnus.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from ) id 1aRSb3-000692-VC for ding@gnus.org; Thu, 04 Feb 2016 23:41:59 +0100 Original-Received: by mail-wm0-f45.google.com with SMTP id r129so3416336wmr.0 for ; Thu, 04 Feb 2016 14:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; bh=Qc0Clgor8Iw8ZubIUQju740E4CCCxnp4qorjTsz6oAg=; b=bPJXORDYdFvFYG2VxYavAFDB+XfTU+y5MKKJPzHUqD+k20s6LyGkZHlHAMD/Uzn35n ruUeRo3Zn5i7c7Cml1KiB1c3tNM+7VV3R2RpHp+fxJvLPqaLodHhNz84vA7NzqPdXX4O 5fra85GSCOTRIJuf0xux8DRYXgz4Wpu+R8HE2PaGMZRB9ZFazhIJ4P+A94DJwzacimE7 G5/uQrCGb3KdE59DwUZ5aRVHHiicktQZT6h4UigVdbwTDIjS0nh+ADS/NFjfDaMm29w+ pWUpcZZBxR0Y7GbuKmApfJZ5leAr1STyhklwAQnWfQmpKQfByxJC8zSCEceudW1aoIGm Qndw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; bh=Qc0Clgor8Iw8ZubIUQju740E4CCCxnp4qorjTsz6oAg=; b=jqYOsMXPIsww31+J58+Ys+B+wv1dTLkhhu5n+MTJzhnWlUIvBOKBi/HazxopQID0Xr +3AXmZzqavIZP/Cuta9TvS4ZD9o+77H0vgVLyjXUDBN0FqkApEUiQ6S+DnRMnQs6Xr34 xQ/mXc/ZAstrdc/DNDskuwA9RbK5az4nmI+qew9l+Yzh2OKFTuJzE2KOuTA0YZLAufk4 CFiJocFDYhY7O5OW6ItDVNJ1JbVqV8zAEW8o2a+AIyUXWDhePKKY4AmaHa1IMb2KjvlZ 2M5vflMES8z7K9sgaBfkr1xVHQT43eZptgqTJ4Jjf8QXt4sNamXhODfYrAu1jdLRceSE +rAQ== X-Gm-Message-State: AG10YOQXYp2e0gJ8Qs19ZxvcOsRQ/7ZfMJ3i15bHUIbpUgHsi7o/MLfl+CdyYb/yRqQltA== X-Received: by 10.194.206.71 with SMTP id lm7mr10695006wjc.118.1454625708248; Thu, 04 Feb 2016 14:41:48 -0800 (PST) Original-Received: from poki-sona-sin.local ([217.155.37.242]) by smtp.gmail.com with ESMTPSA id u130sm28086034wmg.15.2016.02.04.14.41.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 14:41:47 -0800 (PST) In-Reply-To: Nikolaus Rath's message of "Thu\, 04 Feb 2016 08\:17\:37 -0800 \(6 hours\, 20 minutes ago\)" X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86696 Archived-At: Nikolaus Rath writes: > On Jan 27 2016, jorge.alfaro-murillo@yale.edu (Jorge > A. Alfaro-Murillo) wrote: >> I have: >> >> #+BEGIN_SRC emacs-lisp (add-hook 'message-mode-hook >> 'use-hard-newlines) #+END_SRC >> >> That allows the message to be sent with format=flowed. > > For me that breaks e.g. text pasted from a terminal or from a C > mode window (the pasted stuff is refilled when the message is > displayed by the recipient). > > Is that a general problem or something specific to my setup? I eventually came up with this: (defun my-mark-hard-newlines (beg end &rest _ignore) (interactive (list (point-min) (point-max))) (save-excursion (goto-char beg) (while (search-forward "\n" end t) (let ((pos (1- (point)))) (if (get-text-property pos 'hard) ;; Use `copy-sequence', because display property values must not be `eq'! (add-text-properties pos (1+ pos) (list 'display (copy-sequence "⏎\n"))) (remove-text-properties pos (1+ pos) '(display nil))))))) (defun my-use-and-mark-hard-newlines () (interactive) (use-hard-newlines) (add-hook 'after-change-functions 'my-mark-hard-newlines nil t)) (with-eval-after-load "message" (add-hook 'message-mode-hook 'my-use-and-mark-hard-newlines)) It doesn't fix things automatically, but it lets me see which newlines are hard, so I get the hint to fix code snippets manually before sending. Regards, Magnus