Skip to content

Mutt config: double-double-quote

A little oddity of Mutt I just discovered, which I haven’t seen documented anywhere. When setting a string variable containing spaces

set index_format="'%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s'"

you seem to need two layers of nested quotes. (Ahem. And it needs to be all on one line. But you knew that.) At least as far as I could see — with single nesting (single or double quotes) you get complaints that %Z is an unknown variable, which seems to mean that it’s treating the space as the end of the new value for index_format, so anything thereafter must be a new variable. (The syntax is set a=valA b=valB and so on.)

Also, I didn’t find any way to query the current value of a variable (just to see it, not for anything complicated) — if anyone knows (Robin?) please let me know.

Update: It’s not true. You only need two levels of nesting if you do what I in fact did:

folder-hook . set index_format="'...'"

Which I guess could also be

folder-hook . "set index_format='...'"

(Also see comments for Robin’s answer to the second question.)

2 Comments

  1. Robin wrote:

    I don’t know, this is all guesses, but you can type Mutt commands from within mutt by prefixing them with something. I think it’s ‘:’. See if you can find a command such as show, echo, or something that shows a variable. Even just saying ’set varname’ with no actual value may tell you. I haven’t used it in a long while, but if kmail keeps crashing on me, and I can work out how to improve Mutts IMAP support, I may be moving back to it.

    Friday, June 23, 2006 at 3:09 pm | Permalink
  2. tikitu wrote:

    Yeah, I know about :command, but I couldn’t find anything like echo or show. But indeed, set index_format echoes the current value, thanks.

    Friday, June 23, 2006 at 3:14 pm | Permalink