[Ovmsdev] Emacs

Mark Webb-Johnson mark at openvehicles.com
Wed Dec 13 11:28:32 HKT 2017


Working with Steve and Greg, we’ve got a very minimal emacs style editor running in the latest code just committed. It is based on the openemacs project (which is based on another project called kilo). Both attempt to get an editor into 1024 lines (ours is 1458; but we put braces on lines of their own).

As a side-requirement of this, Steve has now implemented a way for executing commands to switch into a mode where they can get raw keyboard input. That is useful for several other things (other than WYSIWYG editors).

Command is:

vfs edit <filepath>

A few caveats:

I haven’t implemented search yet. It should come at some stage.

Log messages currently screw up the screen. @Steve will try to work out a way to suppress/discard these during input feedback mode. In the meantime, Control-L (screen refresh) is your friend.

Control-X Control-S doesn’t work on the async console. I think something is swallowing the Control-S. But Control-X S/s works just fine.

Control-X Control-C sometimes crashes the ssh console. I get "Bad packet length 3324299854” and then all goes to hell.

Telnet behaves very well, and seems to support both Control-S and Control-C properly.

CR/LF handling seems wrong. Behaves strangely when pasting.

It is pretty slow to paste characters. OK for writing/changing small scripts, but painful for much more.

It works on my terminal (OSX iTerm2). It might not work on yours. ANSI/VT100 is a mess. The way we get terminal size (rows, columns) is kludgingly elegant.

Memory usage is about 2 to 3 times the size of the file being edited. Seems ok for script files, but beware.

Syntax highlighting does work. Very cool. Of course, this means we need syntax highlighting for ovms scripts.

Enjoy, Mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20171213/68412fc6/attachment-0001.html>


More information about the OvmsDev mailing list