[net.emacs] CCA Emacs/Elisp bug fix / enhancement

massar@godot.UUCP (J.P. Massar) (11/29/84)

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.