On Friday 12 November 2010 16:23:58 Matthieu Lemerre wrote:
>  - Processing mails which do not have any automatically added tag is
>    boring, because I need to press several keys to archive them: "+" to
>    add a tag, and then "a". If I forget about +, then my mail is
>    impossible to find.

I feel the same !
I do not know if notmuch/xapian can find mail with 0 tag or only "attachment" 
tag for exemple ?

The dirty solution I found is to create a virtual folder called "orphan" that 
contains none of all the other tags (ie not tag:foo and not tag:bar and not 
...)


I do not considere "attachment" as a real tag. I should now do the same for 
"replied" and all other new stuff

"""
(require 'cl)

(defun tagreduce(a b)
  (if (or (string= a "attachment") (string= b "attachment"))
      (if (string= a "attachment")
        b
        a
        )
    (if (not (string-match "and not" a))
        (concat "not tag:" a " and not tag:" b)
      (concat a " and not tag:" b)
      )
    )
  )


(defun orphan() 
  (reduce 'tagreduce (split-string (with-output-to-string
                                     (with-current-buffer standard-output
                                       (apply 'call-process notmuch-command nil 
t nil 
"search-tags" nil))) "\n+" t))
)

(setq pnotmuch-orphans (append '("orphan") (orphan)))
(setq notmuch-folders (append notmuch-folders (list pnotmuch-orphans)))

"""

(excuse my lisp ...)

-- 
Cédric
_______________________________________________
notmuch mailing list
[email protected]
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to