Hi Vlad,
On Tue, Dec 03, 2013 at 10:02:50AM +0100, Vladimir Marek wrote:
Hi,
I'm not saying I can do anything about it, I just want to clear up your
question.
Actually, I have been meaning to get into the mutt source for a while.
If you can point me to the relevant functions, I could try it myself.
> I would like to write a few macros for easy access to virtual
folders.
First question, why? I guess the standard way is to create
virtual-mailboxes and select the 'folder' I want to see. What advantage
has macro for you?
Well, macros are faster! Without a macro, I usually use the
sidebar-next/prev functions followed by sidebar-open. Compared to that,
using a macro is just two keystrokes. I use them for (virtual) folders
I visit very often.
> Of course I can always create a query and put it in a macro, but
then I
> do not have the nice relevant names. To give you an example:
>
> virtual-mailboxes "Topic" "<complicated query>"
>
> When visiting the above folder, I have the easy to read name "Topic" in
> the status line. But for the following macro:
>
> macro index,pager gT "<vfolder-from-query><complicated
query><enter>" \
> "Topic description for help screen"
>
> I have "$nm_default_uri?query=<<complicated query>" as the folder
name.
> This can be a bit confusing; I have to look at the query carefully to
> find out what I'm looking at.
Understood, the query string could have another parameter 'name'
similarly to 'limit' and 'type'. Is it worth? Karel Zak or anyone
creating a patch would know :)
I'm not sure; I thought the query string is supposed to be the Xapian
query passed on to libnotmuch. This is more a UI enhancement, I would
think it is better to keep the two separate.
> I also never figured out how to enter a text string to
<change-vfolder>.
> If that is possible, it would solve the above issue too.
Yes, that didn't work for me also, but it's quite some time I tried
that.
The problem I have with virtual-mailboxes is, that I can't search them
by their name. If I want to go to folder 'notmuch' for example, I would
like to
- press X
- press CR (that should not be necessary, I guess. But it is at the moment)
- / ( for searching a name)
- type 'notmuch' and <CR>
Unfortunately the searching looks into the mailbox specification, and
since the mailbox specification always starts with 'notmuch://?query...'
just jumps to next line.
This I do not follow. This is what I see after 'X <any character>':
186( 137) Today
236( 178) Yest
3233( 0) Inboxes
447( 447) virtual folder 1
1330( 747) virtual folder 2
Now I can search with '/Today<enter>' and I'm in today. How do you
define the virtual folders? This is what I do:
virtual-mailboxes \
"Inboxes" "$my_nmuri is:inbox" \
"Today" "$my_nmuri date:today..today &limit=500" \
"Yest" "$my_nmuri date:yesterday..yesterday
&limit=500"
The first quoted string serves as the folder name shown above.
Cheers,
--
Suvayu
Open source is the future. It sets us free.