Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site godot.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!godot!massar From: massar@godot.UUCP (J.P. Massar) Newsgroups: net.emacs Subject: CCA Emacs/Elisp bug fix / enhancement Message-ID: <552@godot.UUCP> Date: Thu, 29-Nov-84 12:27:57 EST Article-I.D.: godot.552 Posted: Thu Nov 29 12:27:57 1984 Date-Received: Fri, 30-Nov-84 06:53:20 EST Distribution: net Organization: Thinking Machines, Cambridge, MA Lines: 66 The following is an enhancement to Emacs/Elisp which is really quite necessary for doing many things: *************************************************************************** 11/19/84 JP Massar Added the Emacs/Elisp Variable '& Current Character' which allows one to test which key invoked a command (e.g., if 'a', 'b', ... 'z' were all bound to the same Elisp 'edefuned' command, #V"&Current Character" would return "a", "b" ... "z" depending on the key hit). Here is the diff (unfortunately it is backward): 'diff e_vars.h e_vars.h~' --> 120d119 < gchar Dcc[] = "Character last read."; 163d161 < "& Current Character", INT, &cc, Dcc, RO, *************************************************************************** The following is a bug fix. If one were to load a keyboard macro libary after loading Elisp EDEFUN-ed functions unknown, and probably disasterous results would ensue. In the file e_kbm.c, in the routine kbmload, at the end: OLD CODE: if (nullcom != onullcom) { qsort((char *)comtab, NCOMS, sizeof(struct key), pstrcmpc); for (i = 0; i < PREFSIZ * (nprefch + 4); i++) if (keytab[i].keyset) keytab[i].keyset = binsrch(keytab[i].name, (char *)comtab, NCOMS, sizeof(struct key)); qsort((char *)kbmtab, nkbm, sizeof(struct kbm), pstrcmpc); NEW CODE: (add the line at the end) if (nullcom != onullcom) { qsort((char *)comtab, NCOMS, sizeof(struct key), pstrcmpc); for (i = 0; i < PREFSIZ * (nprefch + 4); i++) if (keytab[i].keyset) keytab[i].keyset = binsrch(keytab[i].name, (char *)comtab, NCOMS, sizeof(struct key)); qsort((char *)kbmtab, nkbm, sizeof(struct kbm), pstrcmpc); el_reset_efunctions(); *************************************************************************** Finally, the current Emacs allows for up to 1000 named keyboard macros (!). Given the existence of Elisp now, it seems extremely unlikely that this limit will ever be approached. 8c8 < #define MAXKBM 1000 --- > #define MAXKBM 200 This would seem more than adequate and saves a few thousand bytes. *************************************************************************** Caveat emptor: There is no guarentee that these or any other bug fixes / enhancements will be incorporated into CCA's next version of CCA Emacs.