[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why does mml-attach-file put the attachment at the very end of the messa
From: |
Marcin Borkowski |
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 |
User-agent: |
mu4e 0.9.15; emacs 25.0.50.1 |
...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