I'm trying to get org-capture and mu4e working together nicely. Org-capture is already correctly set up; I can capture links to source code files with the following template:
(setq org-capture-templates '(("t" "Todo" entry (file+headline "" "General To-Dos") "** TODO %?\n %i\n %A\n")))
I'd like to capture links to emails in
mu4e. I have
org-mu4e required, and
org-capture-link works as expected in the mu4e message view. Great so far.
Now, I try to use the same template to use org capture an email. This always fails with the error,
Capture abort: (args-out-of-range 99) (The number varies; I assume this is a code point, but cannot get it to render as anything other than a fairly opaque number).
Using the debugger, I've traced this error to the following code block in
;; Simple %-escapes (goto-char (point-min)) (while (re-search-forward "%\\([tTuUaliAcxkKInfF]\\)" nil t) (unless (org-capture-escaped-%) (when (and initial (equal (match-string 0) "%i")) (save-match-data (let* ((lead (buffer-substring (point-at-bol) (match-beginning 0)))) (setq v-i (mapconcat 'identity (org-split-string initial "\n") (concat "\n" lead)))))) (replace-match (or (eval (intern (concat "v-" (match-string 1)))) "") t t)))
As best as I can tell, everything up to
replace-match is working perfectly. The error occurs when
replace-match tries to replace a template character (using any of the link characters
%l) with the captured link to the mu4e message. Instead of correctly doing the replace,
args-out-of-range is thrown. Normally, I'd assume there was no correctly set
replace-match to act on -- but
match-string returns a correct match result, as does inspecting the match in the debugger.
I'm using Emacs 24.5.1, Org 8.3.4, and mu4e 0.9.16. I've tried this on two different Macs and a Fedora 22 machine; the behavior is absolutely consistent.