On 26Jul2011 22:09, Marcelo Luiz de Laia <[email protected]> wrote:
| On Wed, 27 Jul 2011, Cameron Simpson wrote:
| > (I presume you've set EDITOR in your shell environment
|
| No. I have been set it in muttedit script. After you tell me, I test
| it and got no success!
[...]
| line 227:
| E492: Not an editor command: MapToggle <F8> hlsearch
| line 228:
| E492: Not an editor command: MapToggle <F9> wrap
| Press ENTER or type command to continue
That looks like q bunch of vim configuration stuff or something.
Probably you have vim-specific stuff in vi's configuration files and vi
isn't supporting those commands. But you're an emacs user, so let us not
waste time on that. Instead, we need to set you up so that muttedit runs
emacs for you.
In the muttedit script this line:
: ${EDITOR:=vi}
is a slightly magic piece of shell to set the environment variable $EDITOR
to "vi" _if_ $EDITOR is not already present in your environment. The
idea is that an emacs user such as yourself will have:
EDITOR='emacs -nw'
in your login shell environment already, and muttedit will quietly accept
that as your preference and use it.
What is your shell? In the examples below I will presume it is bash. If
not, say otherwise and we will adapt.
When you login (or, if you're using a GUI login, with luck when you open
a terminal window, such as to run mutt) the shell should be running its
own initialisation file. bash's login initialisation file is the file
~/.bash_profile and you would place at the bottom of it a line like
this:
export EDITOR='emacs -nw'
This will sett the environment variable $EDITOR to your preferred
terminal mode editor. muttedit will then use it. You'll need to open a
new terminal window to see the effect. Type:
echo $EDITOR
to the shell to check the value.
| My environment EDITOR is:
| :~$ update-alternatives --config editor
| Existem 5 escolhas para a alternativa editor (disponibiliza
| /usr/bin/editor).
|
| Selecção Caminho Prioridade Estado
| ------------------------------------------------------------
| 0 /bin/nano 40 modo automático
| 1 /bin/ed -100 modo manual
| 2 /bin/nano 40 modo manual
| 3 /usr/bin/dtemacs 0 modo manual
| * 4 /usr/bin/emacs22 0 modo manual
| 5 /usr/bin/vim.tiny 10 modo manual
Ok, I gather you're running a Ubuntu system in Portuguese. The
command you're running there chooses the edit invoked by the command
"/usr/bin/editor", which is intended as a placeholder command so
system scripts can invoke something without making an editor decision
themselves. However, it has two issues.
First, it doesn't affect anything using the wider convention of
honouring $EDITOR to suggest the caller's editor.
Second, while you may be the only user of your Ubuntu system, setting
the systemwide isn't really an appropriate thing to do; set it in you
own environment. That way if you share the system you haven't imposed on
someone else and also if you copy you account to another system you get
to take your $EDITOR preference with you!
Please try setting $EDITOR in your .bash_profile and see if it works
with the unchanged muttedit script.
| The only issue is
| the signature duplicated on the bottom.
I think for this you need tweak your .muttrc - not sure how yet. When
are send-hooks applied? Do you see two signatures in the file that gets
edited, or in the email after it is sent?
Cheers,
--
Cameron Simpson <[email protected]> DoD#743
http://www.cskk.ezoshosting.com/cs/
Yes, sometimes Perl looks like line-noise to the uninitiated, but to the
seasoned Perl programmer, it looks like checksummed line-noise with a mission
in life. - The Llama Book