unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch-show-get-filename and maildir location
@ 2011-02-04  0:15 micah
  2011-02-06  0:26 ` Michal Sojka
  0 siblings, 1 reply; 2+ messages in thread
From: micah @ 2011-02-04  0:15 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]


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))
      (filename (file-name-nondirectory fullpath)))
      (save-excursion
(rename-file fullpath (concat "/home/micah/Maildir/INBOX.Mistakes/new/" filename)))
(notmuch-show-archive-thread-then-exit)
(notmuch-search-refresh-view)
(hl-line-mode 1)(hl-line-mode 1)))

(define-key notmuch-show-mode-map (kbd "S") 'notmuch-mark-as-mistake)

if I hit the 'S' key on a message now, it complains that it cannot
rename the file because it doesn't exist.

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.

micah

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: notmuch-show-get-filename and maildir location
  2011-02-04  0:15 notmuch-show-get-filename and maildir location micah
@ 2011-02-06  0:26 ` Michal Sojka
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Sojka @ 2011-02-06  0:26 UTC (permalink / raw)
  To: micah, notmuch

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-06  0:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-04  0:15 notmuch-show-get-filename and maildir location micah
2011-02-06  0:26 ` Michal Sojka

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).