GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
/* Compatibility for mocklisp */
* }
*/
\f
-DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0, "Mocklisp version of `if'.")
- (args)
+DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0,
+ doc: /* Mocklisp version of `if'.
+usage: (ml-if COND THEN ELSE...) */)
+ (args)
Lisp_Object args;
{
register Lisp_Object val;
struct gcpro gcpro1;
+ val = Qnil;
GCPRO1 (args);
while (!NILP (args))
{
return val;
}
-/* Now converted to regular "while" by hairier conversion code.
-* DEFUN ("ml-while", Fml_while, Sml_while, 1, UNEVALLED, 0, "while for mocklisp programs")
-* (args)
-* Lisp_Object args;
-* {
-* Lisp_Object test, body, tem;
-* struct gcpro gcpro1, gcpro2;
-*
-* GCPRO2 (test, body);
-*
-* test = Fcar (args);
-* body = Fcdr (args);
-* while (tem = Feval (test), XINT (tem))
-* {
-* QUIT;
-* Fprogn (body);
-* }
-*
-* UNGCPRO;
-* return Qnil;
-*}
+#if 0 /* Now converted to regular "while" by hairier conversion code. */
+/**/DEFUN ("ml-while", Fml_while, Sml_while, 1, UNEVALLED, 0, "while for mocklisp programs")
+ (args)
+ Lisp_Object args;
+{
+ Lisp_Object test, body, tem;
+ struct gcpro gcpro1, gcpro2;
+
+ GCPRO2 (test, body);
+
+ test = Fcar (args);
+ body = Fcdr (args);
+ while (tem = Feval (test), XINT (tem))
+ {
+ QUIT;
+ Fprogn (body);
+ }
+
+ UNGCPRO;
+ return Qnil;
+}
+#endif
\f
/* This is the main entry point to mocklisp execution.
When eval sees a mocklisp function being called, it calls here
}
DEFUN ("ml-nargs", Fml_nargs, Sml_nargs, 0, 0, 0,
- "Number of arguments to currently executing mocklisp function.")
- ()
+ doc: /* Number of arguments to currently executing mocklisp function. */)
+ ()
{
if (EQ (Vmocklisp_arguments, Qinteractive))
return make_number (0);
}
DEFUN ("ml-arg", Fml_arg, Sml_arg, 1, 2, 0,
- "Argument number N to currently executing mocklisp function.")
- (n, prompt)
+ doc: /* Argument number N to currently executing mocklisp function. */)
+ (n, prompt)
Lisp_Object n, prompt;
{
if (EQ (Vmocklisp_arguments, Qinteractive))
- return Fread_string (prompt, Qnil);
+ return Fread_string (prompt, Qnil, Qnil, Qnil, Qnil);
CHECK_NUMBER (n, 0);
XSETINT (n, XINT (n) - 1); /* Mocklisp likes to be origin-1 */
return Fcar (Fnthcdr (n, Vmocklisp_arguments));
}
DEFUN ("ml-interactive", Fml_interactive, Sml_interactive, 0, 0, 0,
- "True if currently executing mocklisp function was called interactively.")
- ()
+ doc: /* True if currently executing mocklisp function was called interactively. */)
+ ()
{
return (EQ (Vmocklisp_arguments, Qinteractive)) ? Qt : Qnil;
}
\f
DEFUN ("ml-provide-prefix-argument", Fml_provide_prefix_argument, Sml_provide_prefix_argument,
- 2, UNEVALLED, 0,
- "Evaluate second argument, using first argument as prefix arg value.")
- (args)
+ 2, UNEVALLED, 0,
+ doc: /* Evaluate second argument, using first argument as prefix arg value.
+usage: (ml-provide-prefix-argument ARG1 ARG2) */)
+ (args)
Lisp_Object args;
{
struct gcpro gcpro1;
GCPRO1 (args);
- if (!current_perdisplay)
- abort ();
- current_perdisplay->Vcurrent_prefix_arg = Feval (Fcar (args));
+ Vcurrent_prefix_arg = Feval (Fcar (args));
UNGCPRO;
return Feval (Fcar (Fcdr (args)));
}
DEFUN ("ml-prefix-argument-loop", Fml_prefix_argument_loop, Sml_prefix_argument_loop,
0, UNEVALLED, 0,
- "")
- (args)
+ doc: /* usage: (ml-prefix-argument-loop ...) */)
+ (args)
Lisp_Object args;
{
register Lisp_Object tem;
struct gcpro gcpro1;
/* Set `arg' in case we call a built-in function that looks at it. Still are a few. */
- if (!current_perdisplay)
- abort ();
- tem = current_perdisplay->Vcurrent_prefix_arg;
- if (NILP (tem))
+ if (NILP (Vcurrent_prefix_arg))
i = 1;
else
{
+ tem = Vcurrent_prefix_arg;
if (CONSP (tem))
tem = Fcar (tem);
if (EQ (tem, Qminus))
#if 0 /* Now in mlsupport.el */
DEFUN ("ml-substr", Fml_substr, Sml_substr, 3, 3, 0,
- "Return a substring of STRING, starting at index FROM and of length LENGTH.\n\
-If either FROM or LENGTH is negative, the length of STRING is added to it.")
- (string, from, to)
+ doc: /* Return a substring of STRING, starting at index FROM and of length LENGTH.
+If either FROM or LENGTH is negative, the length of STRING is added to it. */)
+ (string, from, to)
Lisp_Object string, from, to;
{
CHECK_STRING (string, 0);
}
#endif /* 0 */
DEFUN ("insert-string", Finsert_string, Sinsert_string, 0, MANY, 0,
- "Mocklisp-compatibility insert function.\n\
-Like the function `insert' except that any argument that is a number\n\
-is converted into a string by expressing it in decimal.")
- (nargs, args)
+ doc: /* Mocklisp-compatibility insert function.
+Like the function `insert' except that any argument that is a number
+is converted into a string by expressing it in decimal.
+usage: (insert-string &rest ARGS) */)
+ (nargs, args)
int nargs;
Lisp_Object *args;
{
}
\f
+void
syms_of_mocklisp ()
{
Qmocklisp = intern ("mocklisp");