[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-users
Subject:    Re: User-defined variables
From:       George Davidovich <mutt () optimis ! net>
Date:       2010-05-29 1:37:24
Message-ID: 20100529013724.GA6448 () marvin ! optimis ! net
[Download RAW message or body]

On Wed, May 26, 2010 at 09:13:25AM -0700, Michael Elkins wrote:
> On Sat, May 22, 2010 at 07:38:38PM -0700, George Davidovich wrote:
> > # store the current folder name in '$my_folder' (unused for now)
> > folder-hook . "set my_oldrecord=$record; set record=^; \
> > set my_folder=$record; set record=$my_oldrecord"
>
> You probably want to use single quotes here, otherwise the value of your
> variables will be substituted at the time the folder-hook is parsed rather
> than at the time the folder hook actually executes.

Probably true!  ;-)  But it works, and the reasons why it does (or why
it shouldn't) is something I'm generally grappling with. 

> Other than that, this looks ok.

The question I was really asking was the following.  My simplified
example again ...

  folder-hook ~/Mail       "set my_next=~/Mail/lists"
  folder-hook ~/Mail/lists "set my_next=~/Mail"
  folder-hook . "macro browser n <change-dir><kill-line>\$my_next<enter>" 

Starting in ~/Mail, an 'n' in the browser takes me to ~/Mail/lists, as
it should, but the game ends there.  What I want to do is to use 'n' so
that I can repeatedly cycle between those two hierarchies while still in
the browser.  

That would involve re-setting $my_next each time in the macro is
executed, yes?  That's what I can't seem to figure out.

Thanks.

-- 
George
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic