mu4e~compose-mail has a problem with the argument OTHER-HEADERS

7 views
Skip to first unread message

Marcin Borkowski

unread,
Feb 19, 2016, 9:26:04 AM2/19/16
to mu-di...@googlegroups.com
Hi all,

I wanted to be able to use mu4e with the debbugs-gnu interface to Emacs
bug database. Since it didn't really work (debbugs assumes Gnus by
default), I switched `debbugs-gnu-mail-backend' to 'rmail. This
triggered an error. After some digging it turned out that
mu4e~compose-mail seemingly mistreats the OTHER-HEADERS argument. Below
is a proposed patch which seems to help. Notice: I know very little
about how Emacs handles mail (and how an email message looks under the
hood); I came up with this quick fix after a cursory look of what
`message-add-header' expects and what `mu4e~compose-mail' gets.
Comments welcome.

--8<---------------cut here---------------start------------->8---
diff -u --label /usr/local/share/emacs/site-lisp/mu4e/mu4e-compose.el --label \#\<buffer\ mu4e-compose.el\> /usr/local/share/emacs/site-lisp/mu4e/mu4e-compose.el /tmp/buffer-content-19033RF
--- /usr/local/share/emacs/site-lisp/mu4e/mu4e-compose.el
+++ #<buffer mu4e-compose.el>
@@ -544,7 +544,10 @@

;; add any other headers specified
(when other-headers
- (message-add-header other-headers))
+ (apply #'message-add-header
+ (mapcar (lambda (pair)
+ (concat (capitalize (car pair)) ": " (cdr pair)))
+ other-headers)))

;; yank message
(if (bufferp yank-action)

Diff finished. Fri Feb 19 15:20:47 2016
--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

Dirk-Jan C. Binnema

unread,
Feb 19, 2016, 12:28:55 PM2/19/16
to mu-di...@googlegroups.com
Hi Marcin,
Ah, good catch!

Can you make a pull-request, with
(format "%s: %s" (car pair) (cdr pair))
instead of the concat/capitalize?

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Marcin Borkowski

unread,
Feb 19, 2016, 12:41:58 PM2/19/16
to mu-di...@googlegroups.com
Thanks:-)

> Can you make a pull-request, with
> (format "%s: %s" (car pair) (cdr pair))
> instead of the concat/capitalize?

Yes, of course, though I guess `capitalize' is still needed (it seemed
not to work without it for me for some headers).

> Kind regards,
> Dirk.
Reply all
Reply to author
Forward
0 new messages