On Fri, March 19, 2010 3:02 am, [email protected] wrote: >>On 2010-03-18, peng shao <[email protected]> wrote: >>Folder hooks are processed as the manual says. However, the push >>command pushes its arguments onto a stack and mutt's input parser >>later pops those arguments off the stack to parse and execute them. >>It's that pushing and popping that reverses the order of your pushed >>commands. The solution is to enter those folder hooks that contain >>pushes into your muttrc "upside down", like this: >> >> folder-hook inbox 'push :inbox' >> folder-hook . 'push :default' >> >>It would be nice to be able to put commands into a queue rather than >>onto a stack. I don't know why it is the way it is. > > I'm going to take a guess at this one, but when I see stuff like this, > it means the code is optimized to take the fewest cpu cycles possible > vs. spending a few extra cpu cycles processing a queue. On slow CPU's, > makes perfect sense. Faster cpus, users will always question with > "Why???". ;-) > > I prefer optimized but easy to read code, with good comments.
A queue really isn't much harder to code than a stack (and most *nix systems have a queue library), and even on slow CPU's the difference will be insignificant; mutt's command stack is only ever likely to contain a handful of pushed commands waiting to be processed. It's probably too late to change this in mutt, though. Toby -- Dr T. S. Cubitt Quantum information theory group Department of Mathematics University of Bristol United Kingdom
