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: Why does mml-attach-file put the attachment at the very end of the message... Date: Mon, 26 Oct 2015 09:30:22 +0100 Message-ID: <87r3kikp5t.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445848284 3721 80.91.229.3 (26 Oct 2015 08:31:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Oct 2015 08:31:24 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 26 09:31:14 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 1ZqdBQ-0003OB-TM for ged-emacs-devel@m.gmane.org; Mon, 26 Oct 2015 09:31:13 +0100 Original-Received: from localhost ([::1]:51175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqdBQ-0005I1-6H for ged-emacs-devel@m.gmane.org; Mon, 26 Oct 2015 04:31:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqdBF-0005Hw-2O for emacs-devel@gnu.org; Mon, 26 Oct 2015 04:31:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqdBB-0000Qr-Ry for emacs-devel@gnu.org; Mon, 26 Oct 2015 04:31:00 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:36031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqdBB-0000Qm-LX for emacs-devel@gnu.org; Mon, 26 Oct 2015 04:30:57 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id EFC256F2007 for ; Mon, 26 Oct 2015 09:30:35 +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 gBuISS8EXWYB for ; Mon, 26 Oct 2015 09:30:28 +0100 (CET) Original-Received: from localhost (103-115.echostar.pl [213.156.103.115]) by mail.mojserwer.eu (Postfix) with ESMTPSA id C7EC16F2003 for ; Mon, 26 Oct 2015 09:30:26 +0100 (CET) User-agent: mu4e 0.9.15; emacs 25.0.50.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.110.48.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:192634 Archived-At: ...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