all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why does mml-attach-file put the attachment at the very end of the message...
@ 2015-10-26  8:30 Marcin Borkowski
  2015-10-26  8:33 ` Marcin Borkowski
  2015-10-26  8:51 ` Alexis
  0 siblings, 2 replies; 15+ messages in thread
From: Marcin Borkowski @ 2015-10-26  8:30 UTC (permalink / raw)
  To: emacs-devel

...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



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-10-27  9:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26  8:30 Why does mml-attach-file put the attachment at the very end of the message Marcin Borkowski
2015-10-26  8:33 ` 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

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.