From: Marcin Borkowski <mbork@mbork.pl>
To: emacs-devel <emacs-devel@gnu.org>
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 [thread overview]
Message-ID: <87r3kikp5t.fsf@mbork.pl> (raw)
...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 \#\<buffer\ mml.el.gz\> /tmp/jka-com2530smv /tmp/buffer-content-2530r6E
*** /usr/local/share/emacs/25.0.50/lisp/gnus/mml.el.gz
--- #<buffer 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
next reply other threads:[~2015-10-26 8:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 8:30 Marcin Borkowski [this message]
2015-10-26 8:33 ` Why does mml-attach-file put the attachment at the very end of the message Marcin Borkowski
2015-10-26 9:36 ` Katsumi Yamaoka
2015-10-26 10:37 ` Marcin Borkowski
2015-10-26 11:02 ` Andreas Schwab
2015-10-26 11:24 ` Marcin Borkowski
2015-10-26 12:02 ` Andreas Schwab
2015-10-26 11:31 ` Katsumi Yamaoka
2015-10-26 13:53 ` Drew Adams
2015-10-27 0:13 ` Emanuel Berg
2015-10-27 9:41 ` Nicolas Richard
2015-10-26 8:51 ` Alexis
2015-10-26 9:08 ` Marcin Borkowski
2015-10-26 9:28 ` Alexis
2015-10-26 16:00 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r3kikp5t.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.