diff options
author | Dirk Hohndel <hohndel@infradead.org> | 2010-04-26 10:41:49 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-26 16:37:47 -0700 |
commit | 56cbff29887420a649e36a69af1ae2ab70fdd8b5 (patch) | |
tree | 54210f1fb387e386846bdb5d9f9ef52ccfaeab2d | |
parent | da9304769f59b55ea8ba2b63105b47a69450fad8 (diff) |
Put signatures at the very end of the message
The existing code inserts the signature before inserting the message
body (which it puts at the very end of the buffer - therefore AFTER
the signature). This little snippet makes us search backwards and
insert the message body before a signature, if it exists.
This also fixes a small indentation issue in David's code.
Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
-rw-r--r-- | emacs/notmuch-mua.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index c7a9aee..9fbb94a 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -98,11 +98,16 @@ list." collect header))) (message-sort-headers) (message-hide-headers) + ;; insert the message body - but put it in front of the signature + ;; if one is present (goto-char (point-max)) + (if (re-search-backward "-- " nil t) + (forward-line -1) + (goto-char (point-max))) (insert body)) - (set-buffer-modified-p nil) + (set-buffer-modified-p nil) - (message-goto-body)) + (message-goto-body)) (defun notmuch-mua-forward-message () (message-forward) |