Putting the signature above the reply in mu4e

I’m assuming you already know what mu4e is and how to edit your ~/.emacs file, otherwise you wouldn’t be interested.

I put the following in my ~/.emacs, and it works for me!

(setq mu4e-compose-signature-auto-include nil)

;; Signature above reply:
(defun message-insert-signature () nil)

(defun my-mu4e-insert-signature-above-reply ()
  "Insert signature just above the quoted reply when composing"
  (save-excursion
    (goto-char (point-min))
    (when (re-search-forward "^--text follows this line--" nil t)
      (forward-line)
      (insert (concat mu4e-compose-signature "\n\n")))))

(add-hook 'mu4e-compose-mode-hook #'my-mu4e-insert-signature-above-reply)

;; this is where I tell mu4e what signature to use
(setq message-signature "\n\n--\nbgc")

And now when I reply, I get my signature above, and I don’t have to copy it from below every time!

Published by

The Grey Literature

This is the personal blog of Benjamin Gregory Carlisle PhD. Queer; Academic; Queer academic. "I'm the research fairy, here to make your academic problems disappear!"

One thought on “Putting the signature above the reply in mu4e”

  1. To use with contexts:

    (defun my-mu4e-insert-signature-above-reply ()
    “Insert signature just above the quoted reply when composing”
    (save-excursion
    (goto-char (point-min))
    (when (re-search-forward “^–text follows this line–” nil t)
    (forward-line)
    (insert (concat “\n–\n”
    (f-read-text (concat message-signature-directory message-signature-file)))) )))

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.