Hi Christian,
> > .. or write an implementation for emacs :)
>
> you could either substitute the call to emacsclient directly or when
> running under UNIX get $EDITOR and start that.
Just setting EDITOR is not enough.
Substituting' another editor instead of 'vim is the way to go. I don't
know 'emacs', but I understand it is more flexible than 'vim', so it
must be possible.
What is needed is just to replace a single expression in "lib/edit.l",
line 40, where 'vim' is called:
(call 'vim
"+set isk=33-34,36-38,42-90,92,94-95,97-125"
"+map K yw:call setline(line(\"$\"), \"(\" . line(\".\") . \" \" . @@ .
\")\")^MZZ"
"+map Q GC(0)^[ZZ"
(pack "+" "N")
"*F" )
Explanation:
This calls 'vim' with the file "*F" (here the last argument). The other
four arguments instruct the editor to do the following things:
1. Define which characters constitute a symbol ('isk' = "iskeyword")
!"
$%&
*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
\
^_
abcdefghijklmnopqrstuvwxyz{|}
2. Define a mapping for 'K':
- Read the word (Lisp symbol) at the current cursor location
- Overwrite the last line of the edit buffer with a list
(<lineNumber> <symbol>). This information is used later by
'edit' to restart the editing session with <symbol> added, and
to return to <lineNumber> when going back.
- Save changes and exit 'vim'
3. Define a mapping for 'Q':
- Overwrite the last line with (0). This is used by 'edit' to go
back one level.
- Save changes and exit 'vim'
4. Go to line number "N"
An implementation for another editor would probably define different key
mappings instead of 'K' and 'Q', according to the conventions of that
editor (e.g. some finger-twisting combinations for 'emacs').
Cheers,
- Alex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe