From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.devel Subject: Re: Why does mml-attach-file put the attachment at the very end of the message... Date: Mon, 26 Oct 2015 09:33:23 +0100 Message-ID: <87pp02kp0s.fsf@mbork.pl> References: <87r3kikp5t.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445848435 5830 80.91.229.3 (26 Oct 2015 08:33:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Oct 2015 08:33:55 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 26 09:33:47 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZqdDs-0005cK-L3 for ged-emacs-devel@m.gmane.org; Mon, 26 Oct 2015 09:33:44 +0100 Original-Received: from localhost ([::1]:51177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqdDr-0005p3-FD for ged-emacs-devel@m.gmane.org; Mon, 26 Oct 2015 04:33:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqdDf-0005ox-ON for emacs-devel@gnu.org; Mon, 26 Oct 2015 04:33:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqdDc-0001EX-I7 for emacs-devel@gnu.org; Mon, 26 Oct 2015 04:33:31 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:34237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqdDc-0001Dj-BK for emacs-devel@gnu.org; Mon, 26 Oct 2015 04:33:28 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 883286F2007 for ; Mon, 26 Oct 2015 09:33:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J9MpdwWRRm17 for ; Mon, 26 Oct 2015 09:33:24 +0100 (CET) Original-Received: from localhost (103-115.echostar.pl [213.156.103.115]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 9BF236F2003 for ; Mon, 26 Oct 2015 09:33:24 +0100 (CET) User-agent: mu4e 0.9.15; emacs 25.0.50.1 In-reply-to: <87r3kikp5t.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192635 Archived-At: Ah, small correction: I should have said "\n-- \n" instead of "-- \n", of course. Here it is: --8<---------------cut here---------------start------------->8--- diff -c --label /usr/local/share/emacs/25.0.50/lisp/gnus/mml.el.gz --label \#\ /tmp/jka-com2530smv /tmp/buffer-content-2530r6E *** /usr/local/share/emacs/25.0.50/lisp/gnus/mml.el.gz --- # *************** *** 1374,1380 **** (list file type description disposition))) ;; If in the message header, attach at the end and leave point unchanged. (let ((head (unless (message-in-body-p) (point)))) ! (if head (goto-char (point-max))) (mml-insert-empty-tag 'part 'type type ;; icicles redefines read-file-name and returns a --- 1374,1382 ---- (list file type description disposition))) ;; If in the message header, attach at the end and leave point unchanged. (let ((head (unless (message-in-body-p) (point)))) ! (when head ! (goto-char (point-max)) ! (search-backward "\n-- \n" nil t)) (mml-insert-empty-tag 'part 'type type ;; icicles redefines read-file-name and returns a Diff finished. Mon Oct 26 09:29:32 2015 --8<---------------cut here---------------end--------------->8--- On 2015-10-26, at 09:30, Marcin Borkowski wrote: > ...instead of right before the sigdashes? > > If there is no particular reason, I propose a patch below. My use case > is a function that cycles through a few possible signatures, where at > one point I delete everything after the sigdashes. > > --8<---------------cut here---------------start------------->8--- > diff -c --label /usr/local/share/emacs/25.0.50/lisp/gnus/mml.el.gz --label \#\ /tmp/jka-com2530smv /tmp/buffer-content-2530r6E > *** /usr/local/share/emacs/25.0.50/lisp/gnus/mml.el.gz > --- # > *************** > *** 1374,1380 **** > (list file type description disposition))) > ;; If in the message header, attach at the end and leave point unchanged. > (let ((head (unless (message-in-body-p) (point)))) > ! (if head (goto-char (point-max))) > (mml-insert-empty-tag 'part > 'type type > ;; icicles redefines read-file-name and returns a > --- 1374,1382 ---- > (list file type description disposition))) > ;; If in the message header, attach at the end and leave point unchanged. > (let ((head (unless (message-in-body-p) (point)))) > ! (when head > ! (goto-char (point-max)) > ! (search-backward "-- \n" nil t)) > (mml-insert-empty-tag 'part > 'type type > ;; icicles redefines read-file-name and returns a > > Diff finished. Mon Oct 26 09:29:32 2015 > --8<---------------cut here---------------end--------------->8--- > > Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University