Re: replace mcedit with emacsclient without chaning $EDITOR



On Tue, Feb 09, 2010 at 09:13:00AM +0300, Andrew Borodin wrote:
On Mon, 8 Feb 2010 19:38:15 -0500 Haines Brown KB1GRM ET1 wrote:

...
 
Please write exactly what you did.

/usr/share/mc/bin/mc-wrapper.sh must be run directly or via some wrapper
like /etc/bashrc.d/mc.sh.

In mc-wrapper.sh, I added

EDITOR=/usr/bin/vim

line before 

/usr/bin/mc -P "$MC_PWD_FILE" "$@"

then started mc and unchecked the 'use internal edIt' option. If I
press F4 key, the selected file is opened in vim.

In MC Configuration Options, I have unchecked Use intenal edit and Use 
internal view. I assume this is why nano normally comes up as editor 
rather than mcedit.

In  /usr/share/mc/bin/mc-wrapper.sh I followed your advice and moved 
the "EDITOR=/usr/bin/emacsclient" line to before the "/usr/bin/mc -P 
"$MC_PWD_FILE" "$@"" line. Nano still comes up as editor. I tried 
using "EDITOR=/usr/bin/emacs" instead, but had same result. 

This is all I did. I'm unclear how mc-wrapper.sh is run directly, for 
it is not an executable on my machine and belongs to root, and I'm 
assuming you are not suggesting a change in those default parameters.

My mc.sh is in the same directory as mc-wrapper.sh, and only provides 
an alias for mc:

alias mc='. /usr/share/mc/bin/mc-wrapper.sh'

The space between . and / puzzles me. Also, emacsclient command, 
unlike vim, needs an argument.

Haines



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]