Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Hrvoje Niksic <hniksic(a)srce.hr> writes:
> I found it impossible to implement compatibly. FSF Emacs 20.2 added
> a 6th argument to read-from-minibuffer. We can't do that compatibly
> because we already have a 6th argument, ABBREV-TABLE, which I wouldn't
> want to lose.
Sometimes I think we should add all new arguments as :keyword
arguments so there is no crap regarding positional arguments and
incompatibabilities like these.
Yes, but we still have the historical crap to think about. The
keyword arguments must follow the normal arguments, even the optional
ones. Regard this entry from the Lisp FAQ:
[3-0] Why does (READ-FROM-STRING "foobar" :START 3) return FOOBAR
instead of BAR?
READ-FROM-STRING is one of the rare functions that takes both
&OPTIONAL and &KEY arguments:
READ-FROM-STRING string &OPTIONAL eof-error-p eof-value
&KEY :start :end :preserve-whitespace
When a function takes both types of arguments, all the optional
arguments must be specified explicitly before any of the keyword
arguments may be specified. In the example above, :START becomes
the value of the optional EOF-ERROR-P parameter and 3 is the value
of the optional EOF-VALUE parameter.
To get the desired result, you should use
(READ-FROM-STRING "foobar" t nil :START 3)
If you need to understand and use the optional arguments, please
refer to CLTL2 under READ-FROM-STRING, otherwise, this will behave
as desired for most purposes.
So, adding keyword arguments to a function that already accepts a
bunch of optional arguments (for historical reasons) would only
introduce *more* problems and confusion.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
The end of the world is coming... SAVE YOUR BUFFERS!