From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86697 Path: news.gmane.org!not-for-mail From: Nikolaus Rath 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 16:14:17 -0800 Message-ID: <8737t8c8ti.fsf@thinkpad.rath.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1454631328 5044 80.91.229.3 (5 Feb 2016 00:15:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Feb 2016 00:15:28 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34923@lists.math.uh.edu Fri Feb 05 01:15:16 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 1aRU3P-0008T9-8v for ding-account@gmane.org; Fri, 05 Feb 2016 01:15:15 +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 1aRU2q-0006xK-Gn; Thu, 04 Feb 2016 18:14:40 -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 1aRU2m-0006wl-Up for ding@lists.math.uh.edu; Thu, 04 Feb 2016 18:14:37 -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 1aRU2l-0002G7-O0 for ding@lists.math.uh.edu; Thu, 04 Feb 2016 18:14:36 -0600 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by quimby.gnus.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1aRU2Y-0000IN-9z for ding@gnus.org; Fri, 05 Feb 2016 01:14:25 +0100 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 06AA9205EE for ; Thu, 4 Feb 2016 19:14:19 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 04 Feb 2016 19:14:20 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=0/PN5GaHuEBIvOD elDKM/k7suMY=; b=TJTjqf/27fUbEdlBAJf8JrG+dMLuNma+05Vq1V76yismRyz 4fylR3uNUX2fcwbMMSl+bIIYM9GkvQCu7Ov7yE7tBzlAZa3RUj+z1/wVmdIqGnXx dopI28r9dNwykOhKs1MhyofVSYsl7sPj61h0tGK+1jkPmWj7UzYPcCtpuVak= X-Sasl-enc: rz8kODZpKsuHFQigxwO/bruItYuqBz0OkTuALvMLkpBh 1454631259 Original-Received: from ebox.rath.org (ebox.rath.org [45.79.69.51]) by mail.messagingengine.com (Postfix) with ESMTPA id A929C680137 for ; Thu, 4 Feb 2016 19:14:19 -0500 (EST) Original-Received: from thinkpad.rath.org (thinkpad [192.168.12.2]) by ebox.rath.org (Postfix) with ESMTPS id DE61A1C3826 for ; Fri, 5 Feb 2016 00:14:18 +0000 (UTC) Original-Received: by thinkpad.rath.org (Postfix, from userid 1000) id A2622C0D55; Thu, 4 Feb 2016 16:14:17 -0800 (PST) Mail-Copies-To: never Mail-Followup-To: ding@gnus.org In-Reply-To: (Magnus Henoch's message of "Thu, 04 Feb 2016 22:41:46 +0000") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.4 (gnu/linux) X-Spam-Score: -2.1 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86697 Archived-At: On Feb 04 2016, Magnus Henoch wrote: > Nikolaus Rath writes:=20 >=20 >> On Jan 27 2016, jorge.alfaro-murillo@yale.edu (Jorge=20 >> A. Alfaro-Murillo) wrote:=20=20 >>> I have:=20=20=20 >>>=20 >>> #+BEGIN_SRC emacs-lisp (add-hook 'message-mode-hook=20 >>> 'use-hard-newlines) #+END_SRC=20=20=20 >>>=20 >>> That allows the message to be sent with format=3Dflowed.=20=20 >>=20 >> For me that breaks e.g. text pasted from a terminal or from a C=20 >> mode window (the pasted stuff is refilled when the message is=20 >> displayed by the recipient).=20=20 >>=20 >> Is that a general problem or something specific to my setup?=20=20 >=20 > I eventually came up with this:=20 >=20 > (defun my-mark-hard-newlines (beg end &rest _ignore)=20 > (interactive (list (point-min) (point-max))) (save-excursion=20 > (goto-char beg) (while (search-forward "\n" end t)=20 > (let ((pos (1- (point))))=20 > (if (get-text-property pos 'hard)=20 > ;; Use `copy-sequence', because display property=20 > values must not be `eq'!=20 > (add-text-properties pos (1+ pos) (list 'display=20 > (copy-sequence "=E2=8F=8E\n")))=20 > (remove-text-properties pos (1+ pos) '(display=20 > nil)))))))=20 >=20 > (defun my-use-and-mark-hard-newlines ()=20 > (interactive) (use-hard-newlines) (add-hook=20 > 'after-change-functions 'my-mark-hard-newlines nil t))=20 >=20 > (with-eval-after-load "message"=20 > (add-hook 'message-mode-hook 'my-use-and-mark-hard-newlines))=20 >=20 > It doesn't fix things automatically, but it lets me see which=20 > newlines are hard, so I get the hint to fix code snippets=20 > manually before sending. Hmm. Trying to call this gives me (on Emacs 24.4): Debugger entered--Lisp error: (wrong-number-of-arguments (lambda=20 (beg end &rest _ignore) (interactive (list (point-min)=20 (point-max))) (save-excursion (goto-char beg) (while=20 (search-forward " " end t) (let ((pos (1- (point)))) (if=20 (get-text-property pos (quote hard)) values must not be (quote eq)=20 (quote !) (add-text-properties pos (1+ pos) (list (quote display)=20 (copy-sequence "=E2=8F=8E "))) (remove-text-properties pos (1+ pos) (quote= =20 (display nil)))))))) 0)=20 my-mark-hard-newlines()=20 Emacs 24.4.=20 I always considered myself able to read backtraces - but the above=20 leaves me clueless. Which function has the wrong number of=20 arguments? Why is the whole function definition included in the=20 error? Best, -Nikolaus =20 (No Cc on replies please, I'm reading the list) --=20 GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB