unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: micah <micah@riseup.net>
To: notmuch@notmuchmail.org
Subject: notmuch-show-get-filename and maildir location
Date: Thu, 03 Feb 2011 19:15:22 -0500	[thread overview]
Message-ID: <874o8kk63p.fsf@algae.riseup.net> (raw)

[-- 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 --]

             reply	other threads:[~2011-02-04  0:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04  0:15 micah [this message]
2011-02-06  0:26 ` notmuch-show-get-filename and maildir location Michal Sojka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874o8kk63p.fsf@algae.riseup.net \
    --to=micah@riseup.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).