mu4e-action-show-thread fails when message was opened from an org-capture link

17 views
Skip to first unread message

Ben Maughan

unread,
Mar 23, 2016, 6:39:24 PM3/23/16
to mu-discuss
If I follow a link from an org-mode buffer, it takes me to the message in a mu4e-view buffer, but if I then use the action mu4e-action-show-thread I receive an error

[mu4e] cannot find message in headers buffer.

A crude work around is to quit the view buffer before executing the search by modifying the action to

(defun mu4e-action-show-thread (msg)
 
"Show all messages that are in the same thread as the message
at point."

 
(let ((msgid (mu4e-message-field msg :message-id)))
   
(when msgid
     
(let ((mu4e-headers-show-threads t)
           
(mu4e-headers-include-related t))
       
(mu4e~view-quit-buffer) ;; added this line
       
(mu4e-headers-search
         
(format "msgid:%s" msgid))))))

Is there a better way to do this?

Also, is it possible to highlight (by changing the face) the message with the searched for msgid in the resulting mu4e-headers buffer that shows the thread?

Cheers,
 Ben

Josiah Schwab

unread,
Mar 23, 2016, 7:45:19 PM3/23/16
to mu-di...@googlegroups.com
Hi Ben,

> If I follow a link from an org-mode buffer, it takes me to the message
> in a mu4e-view buffer, but if I then use the action
> mu4e-action-show-thread I receive an error
>
> [mu4e] cannot find message in headers buffer.
>
> [...snip...]
>
> Is there a better way to do this?

I believe this issue is no longer present in the development version.

There were some changes about a month ago that mean org-mode links now
do use a headers buffer. See commits

https://github.com/djcb/mu/commit/7ac492190257d6dc07d1adefb5bfe8bbaeeab3b3
https://github.com/djcb/mu/commit/74691afde8a2502648bb749e3411cd6ced69ba0f
https://github.com/djcb/mu/commit/eab45dc88d18429f4011a776ee4329f5b9dde11a

Hope that helps,
Josiah

Dirk-Jan C. Binnema

unread,
Mar 24, 2016, 12:58:18 AM3/24/16
to mu-di...@googlegroups.com
Indeed.

Opening a message by its message-id used to be 'special', so there was
no headers buffer connected. But since those commits, we first do a
normal search, then automatically open the message whose message-id we
were looking for.

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
Reply all
Reply to author
Forward
0 new messages