notmuch-show-get-filename and maildir location

Michal Sojka sojkam1 at fel.cvut.cz
Sat Feb 5 16:26:26 PST 2011


On Fri, 04 Feb 2011, micah wrote:
> 
> I recently upgraded to the newer notmuch to test out the new folder
> patch (its great!) and the new decryption/signature verification (its
> fantastic!), and noticed something odd start happening.
> 
> I think that notmuch moves a new message to the maildir cur directory,
> From the new directory when you first read it. Is that right? This is
> actually what I would expect with maildirs, but notmuch wasn't doing
> this before.
> 
> The reason why I care is because if I open a message,
> notmuch-show-get-filename tells me that the file is located in the
> 'new/' path, but it is actually not there at all, looking around it
> appears to be in the 'cur/' directory. 
> 
> This is because I made a function to let me do bayes training by putting
> mistaken emails in my Mistakes folder, so that they can be retrained:
> 
> (defun notmuch-mark-as-mistake ()
> "Moves the current message into the Mistakes folder"
>   (interactive)
> (let* ((fullpath (notmuch-show-get-filename))

Hi Micah,

Use this instead of the above line.

  (let* ((fullpath (car (process-lines notmuch-command "search"
                                       "--output=files" (notmuch-show-get-message-id))))
	
	  
> Incidentally, does anyone know how I can do this without having to
> actually do a notmuch-show on the message? Most spam I can recognize by
> the subject in my inbox, and I dont need to open it to see that.

Look at http://notmuchmail.org/emacstips/#index5h2. This is similar to
what you want.

-Michal


More information about the notmuch mailing list