<<< Date Index >>>     <<< Thread Index >>>

Conditional Configuration in .muttrc



I happen to like pager_index_lines=8 to show me where I am in the
thread.  But at times I read mail from my PDA with a small screen.  I
want to conditionally change the configuration such that large
terminals get pager_index_lines set to a value but small terminals do
not set this value.

I came up with the following.  This works.  I can conditionally set
the value by using a shell escape.

  set pager_index_lines=`test $(stty -a | sed -n '/rows/s/.*rows 
\([0-9][0-9]*\);.*/\1/p') -gt 30 && echo 8 || echo 0`

But is there a better way that I am missing?  Is there a way in the
muttrc to conditionally include a whole section of configuration?
Something to be able to set a whole section at a time like this?

  if test $(stty -a | sed -n '/rows/s/.*rows \([0-9][0-9]*\);.*/\1/p') -gt 30
    set pager_index_lines=8
    set editor="my-tiny-editor"
    set mailcap_path=~/.mutt/mailcap-tiny
  fi

If not then that is okay.  But I thought I would ask since I might be
missing something.

Thanks
Bob