Closed xxzozaxx closed 5 years ago
I really liked the idea, I will work on it as soon as I find some time.
Meanwhile you can use this following solution but it requires some typing and scheme. You can pass a lambda instead of a string to #:program
option. That lambda should take two parameters, file name and mime type. Within that lambda you can extract the information that you want and run your program. Something like this may work for you:
(assoc
#:pattern "N[0-9]+"
#:program (lambda (file-path mime-type)
(define mail-id (regexp-substitute #f (string-match "N([0-9]+)" file-path) 1)) ;; 1 is the first capture group here.
(system* "grap_the_full_message_program" mail-id)))
string-match
applies given regexp and returns a regexp object. Then we can call regexp-substitute
function to replace whole text with only the first capture group.
It works. Thanks so much.
With the latest commit you can do this:
(assoc
#:pattern "N([0-9]+)"
#:program "grap_the_full_message_program %1")
Thanks for your efforts. I was planning to do it myself, but I did'nt find time for reading the code, and I'm a noob schemer.
Hi, first of all thanks for this great application.
I found it so useful, a wonder if you have any plans to add feature of capture part of
#:pattern
and play around with it.for examble: this example show neatmail(1)1 in work suppose that I have inbox with somethig like that:
and
N140
is the mail ID, now the feature is to have something like thatwhich allow you to capture the ID without N and put it in
$1
.This idea have been shown by Plan9OS program called plumber(1)[2] introduced by Rop Pike but it's kind of mess, the /Rule/ of plumer written as this
FootNote:
[2]: paper: http://doc.cat-v.org/plan_9/4th_edition/papers/plumb man: http://man.cat-v.org/plan_9/1/plumb