From dba75277232766c23b04adf908d677ecfd021489 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 14 Jan 2025 00:16:40 +0100 Subject: [PATCH] Prefer calln to CALLN where applicable * src/callint.c (read_file_name): * src/comp.c (CALL0I, CALL1I, CALL2I, CALL4I, declare_imported_func): * src/data.c (Ffset, notify_variable_watchers): * src/eval.c (Ffuncall_with_delayed_message): * src/keymap.c (Fdescribe_buffer_bindings): * src/minibuf.c (Fread_buffer, Fcompleting_read): * src/pdumper.c (Fdump_emacs_portable): * src/print.c (print_vectorlike_unreadable): * src/treesit.c (treesit_traverse_match_predicate) (treesit_build_sparse_tree): Prefer calln to CALLN. (cherry picked from commit 383de5c3f6f1ca7c8da7450d6e1716b43e9d2020) --- src/callint.c | 2 +- src/comp.c | 10 +++++----- src/data.c | 4 ++-- src/eval.c | 2 +- src/keymap.c | 30 ++++++++++-------------------- src/minibuf.c | 6 ++---- src/pdumper.c | 2 +- src/print.c | 3 +-- src/treesit.c | 6 +++--- 9 files changed, 26 insertions(+), 39 deletions(-) diff --git a/src/callint.c b/src/callint.c index 075f5542f90..ca6e8fe1512 100644 --- a/src/callint.c +++ b/src/callint.c @@ -228,7 +228,7 @@ static Lisp_Object read_file_name (Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object initial, Lisp_Object predicate) { - return CALLN (Ffuncall, Qread_file_name, + return calln (Qread_file_name, callint_message, Qnil, default_filename, mustmatch, initial, predicate); } diff --git a/src/comp.c b/src/comp.c index b96fae4ae95..8b56bcf0257 100644 --- a/src/comp.c +++ b/src/comp.c @@ -504,19 +504,19 @@ load_gccjit_if_necessary (bool mandatory) /* Like call0 but stringify and intern. */ #define CALL0I(fun) \ - CALLN (Ffuncall, intern_c_string (STR (fun))) + calln (intern_c_string (STR (fun))) /* Like call1 but stringify and intern. */ #define CALL1I(fun, arg) \ - CALLN (Ffuncall, intern_c_string (STR (fun)), arg) + calln (intern_c_string (STR (fun)), arg) /* Like call2 but stringify and intern. */ #define CALL2I(fun, arg1, arg2) \ - CALLN (Ffuncall, intern_c_string (STR (fun)), arg1, arg2) + calln (intern_c_string (STR (fun)), arg1, arg2) /* Like call4 but stringify and intern. */ #define CALL4I(fun, arg1, arg2, arg3, arg4) \ - CALLN (Ffuncall, intern_c_string (STR (fun)), arg1, arg2, arg3, arg4) + calln (intern_c_string (STR (fun)), arg1, arg2, arg3, arg4) #define DECL_BLOCK(name, func) \ gcc_jit_block *(name) = \ @@ -1016,7 +1016,7 @@ declare_imported_func (Lisp_Object subr_sym, gcc_jit_type *ret_type, /* String containing the function ptr name. */ Lisp_Object f_ptr_name = - CALLN (Ffuncall, intern_c_string ("comp-c-func-name"), + calln (intern_c_string ("comp-c-func-name"), subr_sym, make_string ("R", 1)); gcc_jit_type *f_ptr_type = diff --git a/src/data.c b/src/data.c index bbe14c83dfb..be85f817014 100644 --- a/src/data.c +++ b/src/data.c @@ -911,7 +911,7 @@ signal a `cyclic-function-indirection' error. */) if (!NILP (Vnative_comp_enable_subr_trampolines) && SUBRP (function) && !NATIVE_COMP_FUNCTIONP (function)) - CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol); + calln (Qcomp_subr_trampoline_install, symbol); #endif set_symbol_function (symbol, definition); @@ -1910,7 +1910,7 @@ notify_variable_watchers (Lisp_Object symbol, funcall_subr (XSUBR (watcher), ARRAYELTS (args), args); } else - CALLN (Ffuncall, watcher, symbol, newval, operation, where); + calln (watcher, symbol, newval, operation, where); } unbind_to (count, Qnil); diff --git a/src/eval.c b/src/eval.c index a73700419dd..b0cc2505a35 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1169,7 +1169,7 @@ is not displayed. */) xstrdup (SSDATA (message))); record_unwind_protect_ptr (with_delayed_message_cancel, timer); - Lisp_Object result = CALLN (Ffuncall, function); + Lisp_Object result = calln (function); return unbind_to (count, result); } diff --git a/src/keymap.c b/src/keymap.c index 5c0ddcd1d9d..9ff0b52df72 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2894,8 +2894,7 @@ You type Translation\n\ if (!NILP (Vkey_translation_map)) { Lisp_Object msg = build_unibyte_string ("Key translations"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, Vkey_translation_map, Qnil, Qnil, prefix, msg, nomenu, Qt, Qnil, Qnil, buffer); } @@ -2908,8 +2907,7 @@ You type Translation\n\ if (!NILP (start1)) { Lisp_Object msg = build_unibyte_string ("\f\nOverriding Bindings"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, start1, Qt, shadow, prefix, msg, nomenu, Qnil, Qnil, Qnil, buffer); shadow = Fcons (start1, shadow); @@ -2921,8 +2919,7 @@ You type Translation\n\ if (!NILP (start1)) { Lisp_Object msg = build_unibyte_string ("\f\nOverriding Bindings"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, start1, Qt, shadow, prefix, msg, nomenu, Qnil, Qnil, Qnil, buffer); shadow = Fcons (start1, shadow); @@ -2944,8 +2941,7 @@ You type Translation\n\ if (!NILP (start1)) { Lisp_Object msg = build_unibyte_string ("\f\n`keymap' Property Bindings"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, start1, Qt, shadow, prefix, msg, nomenu, Qnil, Qnil, Qnil, buffer); shadow = Fcons (start1, shadow); @@ -2977,8 +2973,7 @@ You type Translation\n\ *p = 0; Lisp_Object msg = build_unibyte_string (title); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, maps[i], Qt, shadow, prefix, msg, nomenu, Qnil, Qnil, Qnil, buffer); shadow = Fcons (maps[i], shadow); @@ -2995,16 +2990,14 @@ You type Translation\n\ CALLN (Fformat, build_unibyte_string ("\f\n`%s' Major Mode Bindings"), XBUFFER (buffer)->major_mode_); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, start1, Qt, shadow, prefix, msg, nomenu, Qnil, Qnil, Qnil, buffer); } else { Lisp_Object msg = build_unibyte_string ("\f\n`local-map' Property Bindings"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, start1, Qt, shadow, prefix, msg, nomenu, Qnil, Qnil, Qnil, buffer); } @@ -3014,8 +3007,7 @@ You type Translation\n\ } Lisp_Object msg = build_unibyte_string ("\f\nGlobal Bindings"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, current_global_map, Qt, shadow, prefix, msg, nomenu, Qnil, Qt, Qnil, buffer); @@ -3023,8 +3015,7 @@ You type Translation\n\ if (!NILP (KVAR (current_kboard, Vlocal_function_key_map))) { Lisp_Object msg = build_unibyte_string ("\f\nFunction key map translations"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, KVAR (current_kboard, Vlocal_function_key_map), Qnil, Qnil, prefix, msg, nomenu, Qt, Qnil, Qnil, buffer); } @@ -3033,8 +3024,7 @@ You type Translation\n\ if (!NILP (KVAR (current_kboard, Vinput_decode_map))) { Lisp_Object msg = build_unibyte_string ("\f\nInput decoding map translations"); - CALLN (Ffuncall, - Qhelp__describe_map_tree, + calln (Qhelp__describe_map_tree, KVAR (current_kboard, Vinput_decode_map), Qnil, Qnil, prefix, msg, nomenu, Qt, Qnil, Qnil, buffer); } diff --git a/src/minibuf.c b/src/minibuf.c index 4ac2781456e..d1056d7f12c 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1478,8 +1478,7 @@ behavior. */) STRING_MULTIBYTE (prompt)); } - prompt = CALLN (Ffuncall, Qformat_prompt, - prompt, + prompt = calln (Qformat_prompt, prompt, CONSP (def) ? XCAR (def) : def); } @@ -1921,8 +1920,7 @@ Completion ignores case if the ambient value of See also `completing-read-function'. */) (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) { - return CALLN (Ffuncall, - Fsymbol_value (Qcompleting_read_function), + return calln (Fsymbol_value (Qcompleting_read_function), prompt, collection, predicate, require_match, initial_input, hist, def, inherit_input_method); } diff --git a/src/pdumper.c b/src/pdumper.c index 7d6eabb4b15..97d3d1412b7 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4156,7 +4156,7 @@ types. */) error ("No other Lisp threads can be running when this function is called"); #ifdef HAVE_NATIVE_COMP - CALLN (Ffuncall, intern_c_string ("load--fixup-all-elns")); + calln (intern_c_string ("load--fixup-all-elns")); #endif check_pure_size (); diff --git a/src/print.c b/src/print.c index 4694df98882..f3814859cb3 100644 --- a/src/print.c +++ b/src/print.c @@ -1680,8 +1680,7 @@ print_vectorlike_unreadable (Lisp_Object obj, Lisp_Object printcharfun, record_unwind_current_buffer (); set_buffer_internal (XBUFFER (Vprint__unreadable_callback_buffer)); } - Lisp_Object result = CALLN (Ffuncall, func, obj, - escapeflag? Qt: Qnil); + Lisp_Object result = calln (func, obj, escapeflag? Qt: Qnil); unbind_to (count, Qnil); if (!NILP (result)) diff --git a/src/treesit.c b/src/treesit.c index 918b1a510ea..439109e72db 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3730,7 +3730,7 @@ treesit_traverse_match_predicate (TSTreeCursor *cursor, Lisp_Object pred, && !(SYMBOLP (pred) && !NILP (Fget (pred, Qtreesit_thing_symbol)))) { Lisp_Object lisp_node = make_treesit_node (parser, node); - return !NILP (CALLN (Ffuncall, pred, lisp_node)); + return !NILP (calln (pred, lisp_node)); } else if (SYMBOLP (pred) && BASE_EQ (pred, Qnamed)) { @@ -3784,7 +3784,7 @@ treesit_traverse_match_predicate (TSTreeCursor *cursor, Lisp_Object pred, return false; Lisp_Object lisp_node = make_treesit_node (parser, node); - if (NILP (CALLN (Ffuncall, cdr, lisp_node))) + if (NILP (calln (cdr, lisp_node))) return false; return true; @@ -4053,7 +4053,7 @@ treesit_build_sparse_tree (TSTreeCursor *cursor, Lisp_Object parent, TSNode node = ts_tree_cursor_current_node (cursor); Lisp_Object lisp_node = make_treesit_node (parser, node); if (!NILP (process_fn)) - lisp_node = CALLN (Ffuncall, process_fn, lisp_node); + lisp_node = calln (process_fn, lisp_node); Lisp_Object this = Fcons (lisp_node, Qnil); Fsetcdr (parent, Fcons (this, Fcdr (parent))); -- 2.39.5