summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2025-01-19 04:59:22 +0100
committerStefan Kangas <stefankangas@gmail.com>2025-01-19 14:29:41 +0100
commit251e3d2654ae8e5fdee4624d9af93fb9c0e1b698 (patch)
tree5058c941d114e9b194310856b5351514e1b09bb5 /src/lread.c
parent7362f9f75d5aca1c97f920531dd62763918ba5fe (diff)
downloademacs-251e3d2654ae8e5fdee4624d9af93fb9c0e1b698.tar.gz
emacs-251e3d2654ae8e5fdee4624d9af93fb9c0e1b698.tar.bz2
emacs-251e3d2654ae8e5fdee4624d9af93fb9c0e1b698.zip
Replace call[1-8] with calln
Since the introduction of the 'calln' macro, the 'call1', 'call2', ..., 'call8' macros are just aliases for the former. This is slightly misleading and potentially unhelpful. The number of arguments N can also easily go out-of-synch with the used alias callN. There is no reason not to replace these aliases with using 'calln' directly. To reduce the risk for mistakes, the tool Coccinelle was used to make these changes. See <https://coccinelle.gitlabpages.inria.fr/website/>. * src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c: * src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c: * src/chartab.c, src/cmds.c, src/coding.c, src/composite.c: * src/data.c, src/dbusbind.c, src/dired.c, src/doc.c: * src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c: * src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c: * src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c: * src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c: * src/pgtkselect.c, src/print.c, src/process.c, src/sort.c: * src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c: * src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c: * src/xmenu.c, src/xselect.c, src/xterm.c: Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/lread.c b/src/lread.c
index ab900b3bee6..e5d1ba0e6bb 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -524,7 +524,7 @@ unreadchar (Lisp_Object readcharfun, int c)
unread_char = c;
}
else
- call1 (readcharfun, make_fixnum (c));
+ calln (readcharfun, make_fixnum (c));
}
static int
@@ -1342,7 +1342,7 @@ Return t if the file exists and loads successfully. */)
handler = Ffind_file_name_handler (file, Qload);
if (!NILP (handler))
return
- call6 (handler, Qload, file, noerror, nomessage, nosuffix, must_suffix);
+ calln (handler, Qload, file, noerror, nomessage, nosuffix, must_suffix);
/* The presence of this call is the result of a historical accident:
it used to be in every file-operation and when it got removed
@@ -1446,7 +1446,7 @@ Return t if the file exists and loads successfully. */)
else
handler = Ffind_file_name_handler (found, Qload);
if (! NILP (handler))
- return call5 (handler, Qload, found, noerror, nomessage, Qt);
+ return calln (handler, Qload, found, noerror, nomessage, Qt);
#ifdef DOS_NT
/* Tramp has to deal with semi-broken packages that prepend
drive letters to remote files. For that reason, Tramp
@@ -1612,7 +1612,7 @@ Return t if the file exists and loads successfully. */)
lread_close (fd);
clear_unwind_protect (fd_index);
}
- val = call4 (Vload_source_file_function, found, hist_file_name,
+ val = calln (Vload_source_file_function, found, hist_file_name,
NILP (noerror) ? Qnil : Qt,
(NILP (nomessage) || force_load_messages) ? Qnil : Qt);
return unbind_to (count, val);
@@ -1739,7 +1739,7 @@ Return t if the file exists and loads successfully. */)
/* Run any eval-after-load forms for this file. */
if (!NILP (Ffboundp (Qdo_after_load_evaluation)))
- call1 (Qdo_after_load_evaluation, hist_file_name) ;
+ calln (Qdo_after_load_evaluation, hist_file_name);
for (int i = 0; i < ARRAYELTS (saved_strings); i++)
{
@@ -2079,7 +2079,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
exists = !NILP (Ffile_readable_p (string));
else
{
- Lisp_Object tmp = call1 (predicate, string);
+ Lisp_Object tmp = calln (predicate, string);
if (NILP (tmp))
exists = false;
else if (EQ (tmp, Qdir_ok)
@@ -2343,7 +2343,7 @@ readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand)
form in the progn as a top-level form. This way, if one form in
the progn defines a macro, that macro is in effect when we expand
the remaining forms. See similar code in bytecomp.el. */
- val = call2 (macroexpand, val, Qnil);
+ val = calln (macroexpand, val, Qnil);
if (EQ (CAR_SAFE (val), Qprogn))
{
Lisp_Object subforms = XCDR (val);
@@ -2352,7 +2352,7 @@ readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand)
val = readevalloop_eager_expand_eval (XCAR (subforms), macroexpand);
}
else
- val = eval_sub (call2 (macroexpand, val, Qt));
+ val = eval_sub (calln (macroexpand, val, Qt));
return val;
}
@@ -2501,7 +2501,7 @@ readevalloop (Lisp_Object readcharfun,
{
if (!NILP (readfun))
{
- val = call1 (readfun, readcharfun);
+ val = calln (readfun, readcharfun);
/* If READCHARFUN has set point to ZV, we should
stop reading, even if the form read sets point
@@ -2514,7 +2514,7 @@ readevalloop (Lisp_Object readcharfun,
}
}
else if (! NILP (Vload_read_function))
- val = call1 (Vload_read_function, readcharfun);
+ val = calln (Vload_read_function, readcharfun);
else
val = read_internal_start (readcharfun, Qnil, Qnil, false);
}
@@ -2673,8 +2673,7 @@ STREAM or the value of `standard-input' may be:
minibuffer without a stream, as in (read). But is this feature
ever used, and if so, why? IOW, will anything break if this
feature is removed !? */
- return call1 (Qread_minibuffer,
- build_string ("Lisp expression: "));
+ return calln (Qread_minibuffer, build_string ("Lisp expression: "));
return read_internal_start (stream, Qnil, Qnil, false);
}
@@ -2701,8 +2700,7 @@ STREAM or the value of `standard-input' may be:
stream = Qread_char;
if (EQ (stream, Qread_char))
/* FIXME: ?! When is this used !? */
- return call1 (Qread_minibuffer,
- build_string ("Lisp expression: "));
+ return calln (Qread_minibuffer, build_string ("Lisp expression: "));
return read_internal_start (stream, Qnil, Qnil, true);
}
@@ -2811,7 +2809,7 @@ character_name_to_code (char const *name, ptrdiff_t name_len,
Lisp_Object code
= (name[0] == 'U' && name[1] == '+'
? string_to_number (name + 1, 16, &len)
- : call2 (Qchar_from_name, make_unibyte_string (name, name_len), Qt));
+ : calln (Qchar_from_name, make_unibyte_string (name, name_len), Qt));
if (! RANGED_FIXNUMP (0, code, MAX_UNICODE_CHAR)
|| len != name_len - 1
@@ -5400,7 +5398,7 @@ map_obarray (Lisp_Object obarray,
static void
mapatoms_1 (Lisp_Object sym, Lisp_Object function)
{
- call1 (function, sym);
+ calln (function, sym);
}
DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0,