cowboy me, 2.0: jose nazario beauty and the street


mg on OS X

http://monkey.org/~jose/figs/IMG_1183.jpg

the escape key on the powerbook 12 inch is so small, i suspect that the designer doesn't know about the "vi" editor. hence, i started using a lightweight emacs like editor mg, which comes from openbsd. i can use the editor with much greater ease than i can vi, since i keep fat fingering the F1 key (which, because it's vim and not vi, freaks out the editor some). and since it's not pico, it actually meets a programmer's need.

do a CVS checkout of the code (see the server list and instructions on the openbsd site):
   $ cvs -d SERVER co src/usr.bin/mg
and then apply this patch to build the code. i compiled it with a simple brute force gcc invocation:
   $ gcc -O2 -Wall -DDO_METAKEY -DPREFIXREGION -DXKEYS -DFKEYS -DREGEX \
     -lcurses -o mg *.c
you're now left with an "mg" binary. install it in /usr/bin and install the manpage. the key combos are mostly emacs, but you don't have any of the plugins, or bloat, of emacs. not a bad compromise.

if you must have emacs on OS X, see Emacs 21 for Mac OS X, the site of the former maintainer. read why he left the project and you'll get a good, and mostly correct, insight into the crappy world of OSS politics and projects.

diff below.
Index: fileio.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/fileio.c,v
retrieving revision 1.49
diff -u -r1.49 fileio.c
--- fileio.c    3 Apr 2005 02:09:28 -0000       1.49
+++ fileio.c    25 Apr 2005 16:00:07 -0000
@@ -243,6 +243,7 @@
 {
        static char      fnb[MAXPATHLEN];
        const char      *cp;
+#define LOGIN_NAME_MAX            MAXLOGNAME
        char             user[LOGIN_NAME_MAX + 1], path[MAXPATHLEN];
        int              len;

Index: main.c =================================================================== RCS file: /cvs/src/usr.bin/mg/main.c,v retrieving revision 1.38 diff -u -r1.38 main.c --- main.c 3 Apr 2005 02:09:28 -0000 1.38 +++ main.c 25 Apr 2005 16:00:07 -0000 @@ -97,10 +97,10 @@ for (nfiles = 0, i = 0; i < argc; i++) { if (argv[i][0] == '+' && strlen(argv[i]) >= 2) { int lval; - const char *errstr; + char *errstr;

- lval = strtonum(&argv[i][1], INT_MIN, INT_MAX, &errstr); - if (argv[i][1] == '\0' || errstr != NULL) + lval = (int)strtol(&argv[i][1], &errstr, 10); + if (argv[i][1] == '\0' || *errstr != NULL) goto notnum; startrow = lval; } else { Index: undo.c =================================================================== RCS file: /cvs/src/usr.bin/mg/undo.c,v retrieving revision 1.25 diff -u -r1.25 undo.c --- undo.c 3 Apr 2005 02:09:28 -0000 1.25 +++ undo.c 25 Apr 2005 16:00:10 -0000 @@ -157,6 +157,7 @@ { struct undo_rec *rec;

+#define LIST_END(head) NULL rec = LIST_END(&curwp->w_undo); if (rec != NULL) { undo_free_num--;

|

----

| archives

Last modified: Monday, Apr 25, 2005 @ 11:01am
Weblog Commenting and Trackback by HaloScan.com

Your Ad Here

copyright © 2002-2005 jose nazario, all rights reserved.