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

Restructuring MUTT



Dear developers,

I've been bombarding the irc-channel with questions and suggestionss over
the past few weeks and now that I think that I got a pretty good
understanding of MUTT I want to make some suggestions concerning how
MUTT's command interface should be restructured.

The first and most important change I want to emphazise is that there
should not be a distinct difference between how functions and commands
are handled. All operations should be considered commands - some
interactive and some not. That way everything can be accessed by
commands and not some things by calling functions which in turn can only
be called by certain commands and so on. That is very cumbersome and
over-complicated.


Here are my suggestions to overhaul MUTTs command interface bottom up -
additional suggestions are welcomed, but I think the following cover it
all (at least I hope so)

regards, --MD

----Suggestion 1: New command----

Command name:           enter-command [<arg1> [<arg2>]]
Description:            Opens the command prompt line the
                        <enter-command> function did so far, prepares
                        (if specified) and input <arg1> and <arg2> with
                        the cursor between the two.
Example:                :enter-command "set folder="
                        Promts the user for a command with ":set
                        folder=" already in the prompt

-------

----Suggestion 2: New command----

Command name:           define <macroname> <commandsequence>
Description:            Defines a custom command which, if called,
                        executes <commandsequence>. Within the
                        commandsequence arguments passed to macroname
                        are available as $0, $1, ...
Example:                :define dummySetFolder "set folder=$1"

-------

----Suggestion 3: Command change----

Command name:           bind <map> <key> <commandsequence>
Description:            bind should from now on take only a command or
                        command sequenceas its last argument
Example:                bind browser q "close-all-imap; quit"
                        Closes all imap connection and quits mutt when q
                        is pressed in the browser.

-------

----Suggestion 4: Make all functions commands----

Description:            Everything that has been a function so far
                        should become an according command
Example:                The <shell-escape> function becomes a command
                        with the name "!". In order to obtain the
                        functionality currently bound to the key ! by
                        default, one would specify
                        :map browser ! "enter-command !"

-------

----Suggestion 5: New command-----

Command name:           eval <shellcommand>
Description:            The future heard of MUTT, the most powerful and
                        universal command! What it does ist the
                        following:
                        Executes <shellcommand> in the current shell and
                        evaluates the output of it as a new command
                        sequence to process. This, but only in conjuction
                        with the before suggestion will provide MUTT with
                        infinite flexibility.
Example:                Think of something your self :>

-------