annotate src/mocklisp.c @ 41765:27b70bc263d6

Include ../src/lisp.h. Don't declare xmalloc. (free_widget_value_tree): Don't free `help' field. (copy_widget_value_tree): Copy `help' simply, without safe_strdup. (merge_widget_value): Compare and copy `help' simply.
author Richard M. Stallman <rms@gnu.org>
date Sun, 02 Dec 2001 04:52:12 +0000
parents 7e3c616777d3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 /* Mocklisp compatibility functions for GNU Emacs Lisp interpreter.
10618
e6c31b26a1b5 (Fml_provide_prefix_argument, Fml_prefix_argument_loop): Use perdisplay.
Karl Heuer <kwzh@gnu.org>
parents: 9119
diff changeset
2 Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc.
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 This file is part of GNU Emacs.
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
12244
ac7375e60931 Update GPL to version 2.
Karl Heuer <kwzh@gnu.org>
parents: 10858
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 any later version.
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 GNU General Public License for more details.
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 12244
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 12244
diff changeset
19 Boston, MA 02111-1307, USA. */
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 /* Compatibility for mocklisp */
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23
4696
1fc792473491 Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents: 2429
diff changeset
24 #include <config.h>
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 #include "lisp.h"
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 #include "buffer.h"
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
40133
471f00614030 (Finsert_string, Fml_if, Fml_provide_prefix_argument)
Miles Bader <miles@gnu.org>
parents: 21588
diff changeset
28 DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
29 doc: /* Mocklisp version of `if'.
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
30 usage: (ml-if COND THEN ELSE...) */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
31 (args)
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 Lisp_Object args;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 register Lisp_Object val;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 struct gcpro gcpro1;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
21588
f269d9565635 (Fml_if): Initialize val.
Richard M. Stallman <rms@gnu.org>
parents: 21514
diff changeset
37 val = Qnil;
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 GCPRO1 (args);
484
3165b2697c78 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 311
diff changeset
39 while (!NILP (args))
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 val = Feval (Fcar (args));
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 args = Fcdr (args);
484
3165b2697c78 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 311
diff changeset
43 if (NILP (args)) break;
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 if (XINT (val))
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 val = Feval (Fcar (args));
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 break;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 args = Fcdr (args);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 UNGCPRO;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 return val;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 /* This is the main entry point to mocklisp execution.
40659
7e3c616777d3 (Fml_defun, Fml_while, Fml_substr): Remove commented and #ifdef'd-out code.
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
57 When eval sees a mocklisp function being called, it calls here
7e3c616777d3 (Fml_defun, Fml_while, Fml_substr): Remove commented and #ifdef'd-out code.
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
58 with the unevaluated argument list. */
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 Lisp_Object
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ml_apply (function, args)
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 Lisp_Object function, args;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 register int count = specpdl_ptr - specpdl;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 register Lisp_Object val;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 specbind (Qmocklisp_arguments, args);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 val = Fprogn (Fcdr (function));
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 return unbind_to (count, val);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 DEFUN ("ml-nargs", Fml_nargs, Sml_nargs, 0, 0, 0,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
73 doc: /* Number of arguments to currently executing mocklisp function. */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
74 ()
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 if (EQ (Vmocklisp_arguments, Qinteractive))
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 return make_number (0);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 return Flength (Vmocklisp_arguments);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 DEFUN ("ml-arg", Fml_arg, Sml_arg, 1, 2, 0,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
82 doc: /* Argument number N to currently executing mocklisp function. */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
83 (n, prompt)
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 Lisp_Object n, prompt;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 if (EQ (Vmocklisp_arguments, Qinteractive))
19550
0e09a1cec19d (Fml_arg): Call Fread_string with
Kenichi Handa <handa@m17n.org>
parents: 18741
diff changeset
87 return Fread_string (prompt, Qnil, Qnil, Qnil, Qnil);
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40565
diff changeset
88 CHECK_NUMBER (n);
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 XSETINT (n, XINT (n) - 1); /* Mocklisp likes to be origin-1 */
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 return Fcar (Fnthcdr (n, Vmocklisp_arguments));
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 DEFUN ("ml-interactive", Fml_interactive, Sml_interactive, 0, 0, 0,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
94 doc: /* True if currently executing mocklisp function was called interactively. */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
95 ()
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 return (EQ (Vmocklisp_arguments, Qinteractive)) ? Qt : Qnil;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 DEFUN ("ml-provide-prefix-argument", Fml_provide_prefix_argument, Sml_provide_prefix_argument,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
101 2, UNEVALLED, 0,
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
102 doc: /* Evaluate second argument, using first argument as prefix arg value.
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
103 usage: (ml-provide-prefix-argument ARG1 ARG2) */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
104 (args)
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 Lisp_Object args;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 struct gcpro gcpro1;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 GCPRO1 (args);
10858
415b568535de (Fml_provide_prefix_argument, Fml_prefix_argument_loop): Undo Jan 31 change.
Karl Heuer <kwzh@gnu.org>
parents: 10618
diff changeset
109 Vcurrent_prefix_arg = Feval (Fcar (args));
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 UNGCPRO;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 return Feval (Fcar (Fcdr (args)));
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 DEFUN ("ml-prefix-argument-loop", Fml_prefix_argument_loop, Sml_prefix_argument_loop,
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 0, UNEVALLED, 0,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
116 doc: /* usage: (ml-prefix-argument-loop ...) */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
117 (args)
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 Lisp_Object args;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 register Lisp_Object tem;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 register int i;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 struct gcpro gcpro1;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 /* Set `arg' in case we call a built-in function that looks at it. Still are a few. */
10858
415b568535de (Fml_provide_prefix_argument, Fml_prefix_argument_loop): Undo Jan 31 change.
Karl Heuer <kwzh@gnu.org>
parents: 10618
diff changeset
125 if (NILP (Vcurrent_prefix_arg))
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 i = 1;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 else
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 {
10858
415b568535de (Fml_provide_prefix_argument, Fml_prefix_argument_loop): Undo Jan 31 change.
Karl Heuer <kwzh@gnu.org>
parents: 10618
diff changeset
129 tem = Vcurrent_prefix_arg;
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 if (CONSP (tem))
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 tem = Fcar (tem);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 if (EQ (tem, Qminus))
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 i = -1;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 else i = XINT (tem);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 GCPRO1 (args);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 while (i-- > 0)
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 Fprogn (args);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 UNGCPRO;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 return Qnil;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 DEFUN ("insert-string", Finsert_string, Sinsert_string, 0, MANY, 0,
40565
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
145 doc: /* Mocklisp-compatibility insert function.
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
146 Like the function `insert' except that any argument that is a number
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
147 is converted into a string by expressing it in decimal.
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
148 usage: (insert-string &rest ARGS) */)
2320f6ae3370 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40148
diff changeset
149 (nargs, args)
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 int nargs;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 Lisp_Object *args;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 register int argnum;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 register Lisp_Object tem;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 for (argnum = 0; argnum < nargs; argnum++)
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 tem = args[argnum];
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 retry:
9119
0c3c25c2456e (Finsert_string): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
160 if (INTEGERP (tem))
2429
96b55f2f19cd Rename int-to-string to number-to-string, since it can handle
Jim Blandy <jimb@redhat.com>
parents: 1011
diff changeset
161 tem = Fnumber_to_string (tem);
9119
0c3c25c2456e (Finsert_string): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
162 if (STRINGP (tem))
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 insert1 (tem);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 else
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 tem = wrong_type_argument (Qstringp, tem);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 goto retry;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 }
295
d63a5e102cab *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 153
diff changeset
170
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 return Qnil;
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 }
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 20392
diff changeset
175 void
153
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 syms_of_mocklisp ()
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 {
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 Qmocklisp = intern ("mocklisp");
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 staticpro (&Qmocklisp);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 defsubr (&Sml_if);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 defsubr (&Sml_arg);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 defsubr (&Sml_nargs);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 defsubr (&Sml_interactive);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 defsubr (&Sml_provide_prefix_argument);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 defsubr (&Sml_prefix_argument_loop);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 defsubr (&Sinsert_string);
636408ebaaaa Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 }