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!cbosgd!ihnp4!godot!massar From: massar@godot.UUCP (J.P. Massar) Newsgroups: net.emacs Subject: CCA Emacs Elisp bug fix Message-ID: <970@godot.UUCP> Date: Thu, 14-Feb-85 02:30:40 EST Article-I.D.: godot.970 Posted: Thu Feb 14 02:30:40 1985 Date-Received: Fri, 15-Feb-85 03:36:17 EST Distribution: net Organization: Thinking Machines, Cambridge, MA Lines: 78 Following is a quick fix to make edefuned functions given numeric arguments obey the documentation. The problem is that the following: (edefun foo (argtype argval) (print-line argtype) (print-line argval)) when invoked as follows: C-U 5 M-X foo produces 10 5 instead of 2 5 (where 2 is the value of the Elisp constant 'numarg'). Here is the diff: *** e_lisp.c~ Wed Feb 13 23:52:44 1985 --- e_lisp.c Thu Feb 14 01:32:11 1985 *************** *** 720,726 char *s1, *s2, *s3; { register n; ! elispinit(); if (c == -1) n = xcnum; --- 720,726 ----- char *s1, *s2, *s3; { register n; ! int enumarg; elispinit(); if (c == -1) n = xcnum; *************** *** 726,732 n = xcnum; else n = keytab[disp].keyset; ! return(el_execute_function(comtab[n].name, numarg, arg, s1, s2, s3, STD_ERROR_HANDLING)); } --- 726,733 ----- n = xcnum; else n = keytab[disp].keyset; ! enumarg = (numarg == 10) ? NUMARG : numarg; ! return(el_execute_function(comtab[n].name, enumarg, arg, s1, s2, s3, STD_ERROR_HANDLING)); } --------------------------------------------------------------------------- Any edefuned function is supposed to have 0 ('noarg') as the value of its first argument if invoked with no C-U argument; 1 ('nullarg') if invoked with a C-U but without any numeric value; 2 ('numarg') if invoked with C-U followed by a numeric value; and finally 3 ('signarg') if invoked with C-U followed by a '-'. The signarg convention does not work; has never worked; I don't know how to make it work and there is very little purpose in even trying, since it is quite useless (it was only put in to conform to certain Emacs M-X commands which somehow distinguish between C-U -1 and C-U - (!)). JP Massar ihnp4!godot!massar massar@cca-unix