aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog60
-rw-r--r--src/alloc.c108
-rw-r--r--src/buffer.c11
-rw-r--r--src/callint.c27
-rw-r--r--src/charset.c15
-rw-r--r--src/chartab.c6
-rw-r--r--src/coding.c106
-rw-r--r--src/composite.c38
-rw-r--r--src/data.c5
-rw-r--r--src/dbusbind.c7
-rw-r--r--src/dired.c56
-rw-r--r--src/doc.c13
-rw-r--r--src/editfns.c53
-rw-r--r--src/emacs.c5
-rw-r--r--src/eval.c21
-rw-r--r--src/fileio.c46
-rw-r--r--src/filelock.c12
-rw-r--r--src/fns.c76
-rw-r--r--src/font.c22
-rw-r--r--src/fontset.c15
-rw-r--r--src/ftfont.c8
-rw-r--r--src/gtkutil.c23
-rw-r--r--src/insdel.c16
-rw-r--r--src/keyboard.c37
-rw-r--r--src/keymap.c5
-rw-r--r--src/lisp.h9
-rw-r--r--src/lread.c15
-rw-r--r--src/minibuf.c23
-rw-r--r--src/print.c7
-rw-r--r--src/process.c28
-rw-r--r--src/sound.c26
-rw-r--r--src/term.c18
-rw-r--r--src/window.c10
-rw-r--r--src/xdisp.c27
-rw-r--r--src/xfaces.c65
-rw-r--r--src/xfont.c8
-rw-r--r--src/xselect.c31
37 files changed, 429 insertions, 629 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a8b9c3bf1c6..b137045f216 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,63 @@
12015-01-25 Paul Eggert <eggert@cs.ucla.edu>
2
3 Count MANY function args more reliably
4 * alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
5 * buffer.c (Fbuffer_list, Fkill_buffer):
6 * callint.c (read_file_name, Fcall_interactively):
7 * charset.c (Fset_charset_priority, syms_of_charset):
8 * chartab.c (uniprop_encode_value_numeric):
9 * coding.c (syms_of_coding):
10 * composite.c (syms_of_composite):
11 * data.c (wrong_range):
12 * dbusbind.c (syms_of_dbusbind):
13 * dired.c (file_attributes):
14 * editfns.c (Fdecode_time, update_buffer_properties, format2):
15 * eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
16 (call4, call5, call6, call7):
17 * fileio.c (Finsert_file_contents, choose_write_coding_system)
18 (Fcar_less_than_car, build_annotations, auto_save_error):
19 * filelock.c (get_boot_time):
20 * fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
21 (maybe_resize_hash_table, secure_hash):
22 * font.c (font_style_to_value, font_open_by_name, Flist_fonts):
23 * fontset.c (fontset_add, Fset_fontset_font):
24 * ftfont.c (ftfont_lookup_cache):
25 * gtkutil.c (xg_get_font):
26 * insdel.c (signal_before_change, signal_after_change):
27 * keymap.c (append_key):
28 * lread.c (load_warn_old_style_backquotes, Fload, init_lread):
29 * minibuf.c (Fread_buffer):
30 * print.c (print_preprocess):
31 * process.c (Fformat_network_address, Fmake_network_process)
32 (server_accept_connection):
33 * sound.c (Fplay_sound_internal):
34 * term.c (Fsuspend_tty, Fresume_tty):
35 * window.c (window_list):
36 * xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
37 (message_with_string):
38 * xfaces.c (Fx_list_fonts):
39 * xfont.c (syms_of_xfont):
40 * xselect.c (x_handle_selection_request)
41 (x_handle_selection_clear, x_clear_frame_selections)
42 (x_clipboard_manager_error_1):
43 Prefer CALLMANY and CALLN to counting args by hand.
44 * doc.c (reread_doc_file): Remove unused code.
45 * fns.c (concat2, concat3): Redo to avoid need for local-var vector.
46 (cmpfn_user_defined, hashfn_user_defined, Fmaphash):
47 Prefer call1 and call2 to Ffuncall.
48 * keyboard.c (safe_run_hook_funcall, safe_run_hooks):
49 Use struct literal rather than a local var, for simplicity.
50 * keymap.c (where_is_internal): Use NULL rather than a pointer
51 to unused args.
52 * lisp.h (CALLMANY, CALLN): New macros.
53 * sound.c (Fplay_sound_internal): Coalesce duplicate code.
54 Fixes: bug#19634
55
56 Use gnustep-config if available
57 * emacs.c [NS_IMPL_GNUSTEP]: Don't include <GNUstepBase/GSConfig.h>.
58 It doesn't appear to be needed, and the inclusion breaks on
59 Ubuntu 14.10 when 'configure' uses 'gnustep-config'.
60
12015-01-22 Eli Zaretskii <eliz@gnu.org> 612015-01-22 Eli Zaretskii <eliz@gnu.org>
2 62
3 * xdisp.c (init_iterator): Restore a comment lost in transition. 63 * xdisp.c (init_iterator): Restore a comment lost in transition.
diff --git a/src/alloc.c b/src/alloc.c
index 571b2b03a29..9aa94b8a559 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4408,19 +4408,17 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
4408 doc: /* Show information about live and zombie objects. */) 4408 doc: /* Show information about live and zombie objects. */)
4409 (void) 4409 (void)
4410{ 4410{
4411 Lisp_Object args[8], zombie_list = Qnil; 4411 Lisp_Object zombie_list = Qnil;
4412 EMACS_INT i; 4412 for (int i = 0; i < min (MAX_ZOMBIES, nzombies); i++)
4413 for (i = 0; i < min (MAX_ZOMBIES, nzombies); i++)
4414 zombie_list = Fcons (zombies[i], zombie_list); 4413 zombie_list = Fcons (zombies[i], zombie_list);
4415 args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); 4414 return CALLN (Fmessage,
4416 args[1] = make_number (ngcs); 4415 build_string ("%d GCs, avg live/zombies = %.2f/%.2f"
4417 args[2] = make_float (avg_live); 4416 " (%f%%), max %d/%d\nzombies: %S"),
4418 args[3] = make_float (avg_zombies); 4417 make_number (ngcs), make_float (avg_live),
4419 args[4] = make_float (avg_zombies / avg_live / 100); 4418 make_float (avg_zombies),
4420 args[5] = make_number (max_live); 4419 make_float (avg_zombies / avg_live / 100),
4421 args[6] = make_number (max_zombies); 4420 make_number (max_live), make_number (max_zombies),
4422 args[7] = zombie_list; 4421 zombie_list);
4423 return Fmessage (8, args);
4424} 4422}
4425 4423
4426#endif /* GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES */ 4424#endif /* GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES */
@@ -5297,10 +5295,8 @@ purecopy (Lisp_Object obj)
5297 } 5295 }
5298 else 5296 else
5299 { 5297 {
5300 Lisp_Object args[2]; 5298 Lisp_Object fmt = build_pure_c_string ("Don't know how to purify: %S");
5301 args[0] = build_pure_c_string ("Don't know how to purify: %S"); 5299 Fsignal (Qerror, list1 (CALLN (Fformat, fmt, obj)));
5302 args[1] = obj;
5303 Fsignal (Qerror, (Fcons (Fformat (2, args), Qnil)));
5304 } 5300 }
5305 5301
5306 if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */ 5302 if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
@@ -5678,56 +5674,44 @@ garbage_collect_1 (void *end)
5678 } 5674 }
5679 5675
5680 unbind_to (count, Qnil); 5676 unbind_to (count, Qnil);
5681 {
5682 Lisp_Object total[11];
5683 int total_size = 10;
5684
5685 total[0] = list4 (Qconses, make_number (sizeof (struct Lisp_Cons)),
5686 bounded_number (total_conses),
5687 bounded_number (total_free_conses));
5688
5689 total[1] = list4 (Qsymbols, make_number (sizeof (struct Lisp_Symbol)),
5690 bounded_number (total_symbols),
5691 bounded_number (total_free_symbols));
5692
5693 total[2] = list4 (Qmiscs, make_number (sizeof (union Lisp_Misc)),
5694 bounded_number (total_markers),
5695 bounded_number (total_free_markers));
5696
5697 total[3] = list4 (Qstrings, make_number (sizeof (struct Lisp_String)),
5698 bounded_number (total_strings),
5699 bounded_number (total_free_strings));
5700
5701 total[4] = list3 (Qstring_bytes, make_number (1),
5702 bounded_number (total_string_bytes));
5703 5677
5704 total[5] = list3 (Qvectors, 5678 Lisp_Object total[] = {
5705 make_number (header_size + sizeof (Lisp_Object)), 5679 list4 (Qconses, make_number (sizeof (struct Lisp_Cons)),
5706 bounded_number (total_vectors)); 5680 bounded_number (total_conses),
5707 5681 bounded_number (total_free_conses)),
5708 total[6] = list4 (Qvector_slots, make_number (word_size), 5682 list4 (Qsymbols, make_number (sizeof (struct Lisp_Symbol)),
5709 bounded_number (total_vector_slots), 5683 bounded_number (total_symbols),
5710 bounded_number (total_free_vector_slots)); 5684 bounded_number (total_free_symbols)),
5711 5685 list4 (Qmiscs, make_number (sizeof (union Lisp_Misc)),
5712 total[7] = list4 (Qfloats, make_number (sizeof (struct Lisp_Float)), 5686 bounded_number (total_markers),
5713 bounded_number (total_floats), 5687 bounded_number (total_free_markers)),
5714 bounded_number (total_free_floats)); 5688 list4 (Qstrings, make_number (sizeof (struct Lisp_String)),
5715 5689 bounded_number (total_strings),
5716 total[8] = list4 (Qintervals, make_number (sizeof (struct interval)), 5690 bounded_number (total_free_strings)),
5717 bounded_number (total_intervals), 5691 list3 (Qstring_bytes, make_number (1),
5718 bounded_number (total_free_intervals)); 5692 bounded_number (total_string_bytes)),
5719 5693 list3 (Qvectors,
5720 total[9] = list3 (Qbuffers, make_number (sizeof (struct buffer)), 5694 make_number (header_size + sizeof (Lisp_Object)),
5721 bounded_number (total_buffers)); 5695 bounded_number (total_vectors)),
5696 list4 (Qvector_slots, make_number (word_size),
5697 bounded_number (total_vector_slots),
5698 bounded_number (total_free_vector_slots)),
5699 list4 (Qfloats, make_number (sizeof (struct Lisp_Float)),
5700 bounded_number (total_floats),
5701 bounded_number (total_free_floats)),
5702 list4 (Qintervals, make_number (sizeof (struct interval)),
5703 bounded_number (total_intervals),
5704 bounded_number (total_free_intervals)),
5705 list3 (Qbuffers, make_number (sizeof (struct buffer)),
5706 bounded_number (total_buffers)),
5722 5707
5723#ifdef DOUG_LEA_MALLOC 5708#ifdef DOUG_LEA_MALLOC
5724 total_size++; 5709 list4 (Qheap, make_number (1024),
5725 total[10] = list4 (Qheap, make_number (1024), 5710 bounded_number ((mallinfo ().uordblks + 1023) >> 10),
5726 bounded_number ((mallinfo ().uordblks + 1023) >> 10), 5711 bounded_number ((mallinfo ().fordblks + 1023) >> 10)),
5727 bounded_number ((mallinfo ().fordblks + 1023) >> 10));
5728#endif 5712#endif
5729 retval = Flist (total_size, total); 5713 };
5730 } 5714 retval = CALLMANY (Flist, total);
5731 5715
5732#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES 5716#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
5733 { 5717 {
diff --git a/src/buffer.c b/src/buffer.c
index 6bff57fe12e..223683db6f3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -390,7 +390,6 @@ followed by the rest of the buffers. */)
390 if (FRAMEP (frame)) 390 if (FRAMEP (frame))
391 { 391 {
392 Lisp_Object framelist, prevlist, tail; 392 Lisp_Object framelist, prevlist, tail;
393 Lisp_Object args[3];
394 393
395 framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); 394 framelist = Fcopy_sequence (XFRAME (frame)->buffer_list);
396 prevlist = Fnreverse (Fcopy_sequence 395 prevlist = Fnreverse (Fcopy_sequence
@@ -411,10 +410,7 @@ followed by the rest of the buffers. */)
411 tail = XCDR (tail); 410 tail = XCDR (tail);
412 } 411 }
413 412
414 args[0] = framelist; 413 return CALLN (Fnconc, framelist, general, prevlist);
415 args[1] = general;
416 args[2] = prevlist;
417 return Fnconc (3, args);
418 } 414 }
419 else 415 else
420 return general; 416 return general;
@@ -1657,15 +1653,14 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1657 /* Run hooks with the buffer to be killed the current buffer. */ 1653 /* Run hooks with the buffer to be killed the current buffer. */
1658 { 1654 {
1659 ptrdiff_t count = SPECPDL_INDEX (); 1655 ptrdiff_t count = SPECPDL_INDEX ();
1660 Lisp_Object arglist[1];
1661 1656
1662 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 1657 record_unwind_protect (save_excursion_restore, save_excursion_save ());
1663 set_buffer_internal (b); 1658 set_buffer_internal (b);
1664 1659
1665 /* First run the query functions; if any query is answered no, 1660 /* First run the query functions; if any query is answered no,
1666 don't kill the buffer. */ 1661 don't kill the buffer. */
1667 arglist[0] = Qkill_buffer_query_functions; 1662 tem = CALLN (Frun_hook_with_args_until_failure,
1668 tem = Frun_hook_with_args_until_failure (1, arglist); 1663 Qkill_buffer_query_functions);
1669 if (NILP (tem)) 1664 if (NILP (tem))
1670 return unbind_to (count, Qnil); 1665 return unbind_to (count, Qnil);
1671 1666
diff --git a/src/callint.c b/src/callint.c
index 165d374dd62..60021fdfc82 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -229,17 +229,10 @@ read_file_name (Lisp_Object default_filename, Lisp_Object mustmatch,
229 Lisp_Object initial, Lisp_Object predicate) 229 Lisp_Object initial, Lisp_Object predicate)
230{ 230{
231 struct gcpro gcpro1; 231 struct gcpro gcpro1;
232 Lisp_Object args[7];
233
234 GCPRO1 (default_filename); 232 GCPRO1 (default_filename);
235 args[0] = intern ("read-file-name"); 233 RETURN_UNGCPRO (CALLN (Ffuncall, intern ("read-file-name"),
236 args[1] = callint_message; 234 callint_message, Qnil, default_filename,
237 args[2] = Qnil; 235 mustmatch, initial, predicate));
238 args[3] = default_filename;
239 args[4] = mustmatch;
240 args[5] = initial;
241 args[6] = predicate;
242 RETURN_UNGCPRO (Ffuncall (7, args));
243} 236}
244 237
245/* BEWARE: Calling this directly from C would defeat the purpose! */ 238/* BEWARE: Calling this directly from C would defeat the purpose! */
@@ -397,15 +390,11 @@ invoke it. If KEYS is omitted or nil, the return value of
397 Vreal_this_command = save_real_this_command; 390 Vreal_this_command = save_real_this_command;
398 kset_last_command (current_kboard, save_last_command); 391 kset_last_command (current_kboard, save_last_command);
399 392
400 { 393 Lisp_Object result
401 Lisp_Object args[3]; 394 = unbind_to (speccount, CALLN (Fapply, Qfuncall_interactively,
402 args[0] = Qfuncall_interactively; 395 function, specs));
403 args[1] = function; 396 SAFE_FREE ();
404 args[2] = specs; 397 return result;
405 Lisp_Object result = unbind_to (speccount, Fapply (3, args));
406 SAFE_FREE ();
407 return result;
408 }
409 } 398 }
410 399
411 /* SPECS is set to a string; use it as an interactive prompt. 400 /* SPECS is set to a string; use it as an interactive prompt.
diff --git a/src/charset.c b/src/charset.c
index ea1480e806a..908084074fd 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -2146,7 +2146,7 @@ DEFUN ("set-charset-priority", Fset_charset_priority, Sset_charset_priority,
2146usage: (set-charset-priority &rest charsets) */) 2146usage: (set-charset-priority &rest charsets) */)
2147 (ptrdiff_t nargs, Lisp_Object *args) 2147 (ptrdiff_t nargs, Lisp_Object *args)
2148{ 2148{
2149 Lisp_Object new_head, old_list, arglist[2]; 2149 Lisp_Object new_head, old_list;
2150 Lisp_Object list_2022, list_emacs_mule; 2150 Lisp_Object list_2022, list_emacs_mule;
2151 ptrdiff_t i; 2151 ptrdiff_t i;
2152 int id; 2152 int id;
@@ -2162,9 +2162,9 @@ usage: (set-charset-priority &rest charsets) */)
2162 new_head = Fcons (make_number (id), new_head); 2162 new_head = Fcons (make_number (id), new_head);
2163 } 2163 }
2164 } 2164 }
2165 arglist[0] = Fnreverse (new_head); 2165 Vcharset_non_preferred_head = old_list;
2166 arglist[1] = Vcharset_non_preferred_head = old_list; 2166 Vcharset_ordered_list = CALLN (Fnconc, Fnreverse (new_head), old_list);
2167 Vcharset_ordered_list = Fnconc (2, arglist); 2167
2168 charset_ordered_list_tick++; 2168 charset_ordered_list_tick++;
2169 2169
2170 charset_unibyte = -1; 2170 charset_unibyte = -1;
@@ -2353,12 +2353,7 @@ syms_of_charset (void)
2353 Vemacs_mule_charset_list = Qnil; 2353 Vemacs_mule_charset_list = Qnil;
2354 2354
2355 staticpro (&Vcharset_hash_table); 2355 staticpro (&Vcharset_hash_table);
2356 { 2356 Vcharset_hash_table = CALLN (Fmake_hash_table, QCtest, Qeq);
2357 Lisp_Object args[2];
2358 args[0] = QCtest;
2359 args[1] = Qeq;
2360 Vcharset_hash_table = Fmake_hash_table (2, args);
2361 }
2362 2357
2363 charset_table = charset_table_init; 2358 charset_table = charset_table_init;
2364 charset_table_size = ARRAYELTS (charset_table_init); 2359 charset_table_size = ARRAYELTS (charset_table_init);
diff --git a/src/chartab.c b/src/chartab.c
index 013a5be575e..acaabce54a7 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -1255,8 +1255,10 @@ uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value)
1255 break; 1255 break;
1256 value = make_number (i); 1256 value = make_number (i);
1257 if (i == size) 1257 if (i == size)
1258 set_char_table_extras (table, 4, Fvconcat (2, ((Lisp_Object []) { 1258 set_char_table_extras (table, 4,
1259 XCHAR_TABLE (table)->extras[4], Fmake_vector (make_number (1), value) }))); 1259 CALLN (Fvconcat,
1260 XCHAR_TABLE (table)->extras[4],
1261 Fmake_vector (make_number (1), value)));
1260 return make_number (i); 1262 return make_number (i);
1261} 1263}
1262 1264
diff --git a/src/coding.c b/src/coding.c
index 43ebbe06856..54811588c6a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -10776,12 +10776,7 @@ void
10776syms_of_coding (void) 10776syms_of_coding (void)
10777{ 10777{
10778 staticpro (&Vcoding_system_hash_table); 10778 staticpro (&Vcoding_system_hash_table);
10779 { 10779 Vcoding_system_hash_table = CALLN (Fmake_hash_table, QCtest, Qeq);
10780 Lisp_Object args[2];
10781 args[0] = QCtest;
10782 args[1] = Qeq;
10783 Vcoding_system_hash_table = Fmake_hash_table (2, args);
10784 }
10785 10780
10786 staticpro (&Vsjis_coding_system); 10781 staticpro (&Vsjis_coding_system);
10787 Vsjis_coding_system = Qnil; 10782 Vsjis_coding_system = Qnil;
@@ -11269,60 +11264,59 @@ See also `keyboard-translate-table'.
11269Use of this variable for character code unification was rendered 11264Use of this variable for character code unification was rendered
11270obsolete in Emacs 23.1 and later, since Unicode is now the basis of 11265obsolete in Emacs 23.1 and later, since Unicode is now the basis of
11271internal character representation. */); 11266internal character representation. */);
11272 Vtranslation_table_for_input = Qnil; 11267 Vtranslation_table_for_input = Qnil;
11273 11268
11274 { 11269 Lisp_Object args[coding_arg_undecided_max];
11275 Lisp_Object args[coding_arg_undecided_max]; 11270 memclear (args, sizeof args);
11276 memclear (args, sizeof args); 11271
11277 11272 Lisp_Object plist[] =
11278 Lisp_Object plist[16]; 11273 {
11279 plist[0] = intern_c_string (":name"); 11274 intern_c_string (":name"),
11280 plist[1] = args[coding_arg_name] = Qno_conversion; 11275 args[coding_arg_name] = Qno_conversion,
11281 plist[2] = intern_c_string (":mnemonic"); 11276 intern_c_string (":mnemonic"),
11282 plist[3] = args[coding_arg_mnemonic] = make_number ('='); 11277 args[coding_arg_mnemonic] = make_number ('='),
11283 plist[4] = intern_c_string (":coding-type"); 11278 intern_c_string (":coding-type"),
11284 plist[5] = args[coding_arg_coding_type] = Qraw_text; 11279 args[coding_arg_coding_type] = Qraw_text,
11285 plist[6] = intern_c_string (":ascii-compatible-p"); 11280 intern_c_string (":ascii-compatible-p"),
11286 plist[7] = args[coding_arg_ascii_compatible_p] = Qt; 11281 args[coding_arg_ascii_compatible_p] = Qt,
11287 plist[8] = intern_c_string (":default-char"); 11282 intern_c_string (":default-char"),
11288 plist[9] = args[coding_arg_default_char] = make_number (0); 11283 args[coding_arg_default_char] = make_number (0),
11289 plist[10] = intern_c_string (":for-unibyte"); 11284 intern_c_string (":for-unibyte"),
11290 plist[11] = args[coding_arg_for_unibyte] = Qt; 11285 args[coding_arg_for_unibyte] = Qt,
11291 plist[12] = intern_c_string (":docstring"); 11286 intern_c_string (":docstring"),
11292 plist[13] = build_pure_c_string ("Do no conversion.\n\ 11287 (build_pure_c_string
11293\n\ 11288 ("Do no conversion.\n"
11294When you visit a file with this coding, the file is read into a\n\ 11289 "\n"
11295unibyte buffer as is, thus each byte of a file is treated as a\n\ 11290 "When you visit a file with this coding, the file is read into a\n"
11296character."); 11291 "unibyte buffer as is, thus each byte of a file is treated as a\n"
11297 plist[14] = intern_c_string (":eol-type"); 11292 "character.")),
11298 plist[15] = args[coding_arg_eol_type] = Qunix; 11293 intern_c_string (":eol-type"),
11299 args[coding_arg_plist] = Flist (16, plist); 11294 args[coding_arg_eol_type] = Qunix,
11300 Fdefine_coding_system_internal (coding_arg_max, args); 11295 };
11301 11296 args[coding_arg_plist] = CALLMANY (Flist, plist);
11302 plist[1] = args[coding_arg_name] = Qundecided; 11297 Fdefine_coding_system_internal (coding_arg_max, args);
11303 plist[3] = args[coding_arg_mnemonic] = make_number ('-'); 11298
11304 plist[5] = args[coding_arg_coding_type] = Qundecided; 11299 plist[1] = args[coding_arg_name] = Qundecided;
11305 /* This is already set. 11300 plist[3] = args[coding_arg_mnemonic] = make_number ('-');
11306 plist[7] = args[coding_arg_ascii_compatible_p] = Qt; */ 11301 plist[5] = args[coding_arg_coding_type] = Qundecided;
11307 plist[8] = intern_c_string (":charset-list"); 11302 /* This is already set.
11308 plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil); 11303 plist[7] = args[coding_arg_ascii_compatible_p] = Qt; */
11309 plist[11] = args[coding_arg_for_unibyte] = Qnil; 11304 plist[8] = intern_c_string (":charset-list");
11310 plist[13] = build_pure_c_string ("No conversion on encoding, automatic conversion on decoding."); 11305 plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil);
11311 plist[15] = args[coding_arg_eol_type] = Qnil; 11306 plist[11] = args[coding_arg_for_unibyte] = Qnil;
11312 args[coding_arg_plist] = Flist (16, plist); 11307 plist[13] = build_pure_c_string ("No conversion on encoding, "
11313 args[coding_arg_undecided_inhibit_null_byte_detection] = make_number (0); 11308 "automatic conversion on decoding.");
11314 args[coding_arg_undecided_inhibit_iso_escape_detection] = make_number (0); 11309 plist[15] = args[coding_arg_eol_type] = Qnil;
11315 Fdefine_coding_system_internal (coding_arg_undecided_max, args); 11310 args[coding_arg_plist] = CALLMANY (Flist, plist);
11316 } 11311 args[coding_arg_undecided_inhibit_null_byte_detection] = make_number (0);
11312 args[coding_arg_undecided_inhibit_iso_escape_detection] = make_number (0);
11313 Fdefine_coding_system_internal (coding_arg_undecided_max, args);
11317 11314
11318 setup_coding_system (Qno_conversion, &safe_terminal_coding); 11315 setup_coding_system (Qno_conversion, &safe_terminal_coding);
11319 11316
11320 { 11317 for (int i = 0; i < coding_category_max; i++)
11321 int i; 11318 Fset (AREF (Vcoding_category_table, i), Qno_conversion);
11322 11319
11323 for (i = 0; i < coding_category_max; i++)
11324 Fset (AREF (Vcoding_category_table, i), Qno_conversion);
11325 }
11326#if defined (DOS_NT) 11320#if defined (DOS_NT)
11327 system_eol_type = Qdos; 11321 system_eol_type = Qdos;
11328#else 11322#else
diff --git a/src/composite.c b/src/composite.c
index 8ac5ef712c6..577b97920f4 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1891,36 +1891,18 @@ syms_of_composite (void)
1891 DEFSYM (Qcomposition, "composition"); 1891 DEFSYM (Qcomposition, "composition");
1892 1892
1893 /* Make a hash table for static composition. */ 1893 /* Make a hash table for static composition. */
1894 { 1894 /* We used to make the hash table weak so that unreferenced
1895 Lisp_Object args[6]; 1895 compositions can be garbage-collected. But, usually once
1896 1896 created compositions are repeatedly used in an Emacs session,
1897 args[0] = QCtest; 1897 and thus it's not worth to save memory in such a way. So, we
1898 args[1] = Qequal; 1898 make the table not weak. */
1899 args[2] = QCweakness; 1899 Lisp_Object args[] = {QCtest, Qequal, QCsize, make_number (311)};
1900 /* We used to make the hash table weak so that unreferenced 1900 composition_hash_table = CALLMANY (Fmake_hash_table, args);
1901 compositions can be garbage-collected. But, usually once 1901 staticpro (&composition_hash_table);
1902 created compositions are repeatedly used in an Emacs session,
1903 and thus it's not worth to save memory in such a way. So, we
1904 make the table not weak. */
1905 args[3] = Qnil;
1906 args[4] = QCsize;
1907 args[5] = make_number (311);
1908 composition_hash_table = Fmake_hash_table (6, args);
1909 staticpro (&composition_hash_table);
1910 }
1911 1902
1912 /* Make a hash table for glyph-string. */ 1903 /* Make a hash table for glyph-string. */
1913 { 1904 gstring_hash_table = CALLMANY (Fmake_hash_table, args);
1914 Lisp_Object args[6]; 1905 staticpro (&gstring_hash_table);
1915 args[0] = QCtest;
1916 args[1] = Qequal;
1917 args[2] = QCweakness;
1918 args[3] = Qnil;
1919 args[4] = QCsize;
1920 args[5] = make_number (311);
1921 gstring_hash_table = Fmake_hash_table (6, args);
1922 staticpro (&gstring_hash_table);
1923 }
1924 1906
1925 staticpro (&gstring_work_headers); 1907 staticpro (&gstring_work_headers);
1926 gstring_work_headers = make_uninit_vector (8); 1908 gstring_work_headers = make_uninit_vector (8);
diff --git a/src/data.c b/src/data.c
index 0389eb49b06..d06b9916b3a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -972,9 +972,8 @@ wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong)
972 AUTO_STRING (value_should_be_from, "Value should be from "); 972 AUTO_STRING (value_should_be_from, "Value should be from ");
973 AUTO_STRING (to, " to "); 973 AUTO_STRING (to, " to ");
974 xsignal2 (Qerror, 974 xsignal2 (Qerror,
975 Fconcat (4, ((Lisp_Object []) 975 CALLN (Fconcat, value_should_be_from, Fnumber_to_string (min),
976 {value_should_be_from, Fnumber_to_string (min), 976 to, Fnumber_to_string (max)),
977 to, Fnumber_to_string (max)})),
978 wrong); 977 wrong);
979} 978}
980 979
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 3bdec0fa4a6..54e92cce16e 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1849,12 +1849,7 @@ string denoting the bus address. SERIAL is the serial number of the
1849non-blocking method call, a reply is expected. Both arguments must 1849non-blocking method call, a reply is expected. Both arguments must
1850not be nil. The value in the hash table is HANDLER, the function to 1850not be nil. The value in the hash table is HANDLER, the function to
1851be called when the D-Bus reply message arrives. */); 1851be called when the D-Bus reply message arrives. */);
1852 { 1852 Vdbus_registered_objects_table = CALLN (Fmake_hash_table, QCtest, Qequal);
1853 Lisp_Object args[2];
1854 args[0] = QCtest;
1855 args[1] = Qequal;
1856 Vdbus_registered_objects_table = Fmake_hash_table (2, args);
1857 }
1858 1853
1859 DEFVAR_LISP ("dbus-debug", Vdbus_debug, 1854 DEFVAR_LISP ("dbus-debug", Vdbus_debug,
1860 doc: /* If non-nil, debug messages of D-Bus bindings are raised. */); 1855 doc: /* If non-nil, debug messages of D-Bus bindings are raised. */);
diff --git a/src/dired.c b/src/dired.c
index ca43cd90219..e31fdf87ac2 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -914,7 +914,6 @@ so last access time will always be midnight of that day. */)
914static Lisp_Object 914static Lisp_Object
915file_attributes (int fd, char const *name, Lisp_Object id_format) 915file_attributes (int fd, char const *name, Lisp_Object id_format)
916{ 916{
917 Lisp_Object values[12];
918 struct stat s; 917 struct stat s;
919 int lstat_result; 918 int lstat_result;
920 919
@@ -941,10 +940,6 @@ file_attributes (int fd, char const *name, Lisp_Object id_format)
941 if (lstat_result < 0) 940 if (lstat_result < 0)
942 return Qnil; 941 return Qnil;
943 942
944 values[0] = (S_ISLNK (s.st_mode) ? emacs_readlinkat (fd, name)
945 : S_ISDIR (s.st_mode) ? Qt : Qnil);
946 values[1] = make_number (s.st_nlink);
947
948 if (!(NILP (id_format) || EQ (id_format, Qinteger))) 943 if (!(NILP (id_format) || EQ (id_format, Qinteger)))
949 { 944 {
950 block_input (); 945 block_input ();
@@ -952,34 +947,35 @@ file_attributes (int fd, char const *name, Lisp_Object id_format)
952 gname = stat_gname (&s); 947 gname = stat_gname (&s);
953 unblock_input (); 948 unblock_input ();
954 } 949 }
955 if (uname)
956 values[2] = DECODE_SYSTEM (build_unibyte_string (uname));
957 else
958 values[2] = make_fixnum_or_float (s.st_uid);
959 if (gname)
960 values[3] = DECODE_SYSTEM (build_unibyte_string (gname));
961 else
962 values[3] = make_fixnum_or_float (s.st_gid);
963
964 values[4] = make_lisp_time (get_stat_atime (&s));
965 values[5] = make_lisp_time (get_stat_mtime (&s));
966 values[6] = make_lisp_time (get_stat_ctime (&s));
967
968 /* If the file size is a 4-byte type, assume that files of sizes in
969 the 2-4 GiB range wrap around to negative values, as this is a
970 common bug on older 32-bit platforms. */
971 if (sizeof (s.st_size) == 4)
972 values[7] = make_fixnum_or_float (s.st_size & 0xffffffffu);
973 else
974 values[7] = make_fixnum_or_float (s.st_size);
975 950
976 filemodestring (&s, modes); 951 filemodestring (&s, modes);
977 values[8] = make_string (modes, 10);
978 values[9] = Qt;
979 values[10] = INTEGER_TO_CONS (s.st_ino);
980 values[11] = INTEGER_TO_CONS (s.st_dev);
981 952
982 return Flist (ARRAYELTS (values), values); 953 return CALLN (Flist,
954 (S_ISLNK (s.st_mode) ? emacs_readlinkat (fd, name)
955 : S_ISDIR (s.st_mode) ? Qt : Qnil),
956 make_number (s.st_nlink),
957 (uname
958 ? DECODE_SYSTEM (build_unibyte_string (uname))
959 : make_fixnum_or_float (s.st_uid)),
960 (gname
961 ? DECODE_SYSTEM (build_unibyte_string (gname))
962 : make_fixnum_or_float (s.st_gid)),
963 make_lisp_time (get_stat_atime (&s)),
964 make_lisp_time (get_stat_mtime (&s)),
965 make_lisp_time (get_stat_ctime (&s)),
966
967 /* If the file size is a 4-byte type, assume that
968 files of sizes in the 2-4 GiB range wrap around to
969 negative values, as this is a common bug on older
970 32-bit platforms. */
971 make_fixnum_or_float (sizeof (s.st_size) == 4
972 ? s.st_size & 0xffffffffu
973 : s.st_size),
974
975 make_string (modes, 10),
976 Qt,
977 INTEGER_TO_CONS (s.st_ino),
978 INTEGER_TO_CONS (s.st_dev));
983} 979}
984 980
985DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0, 981DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0,
diff --git a/src/doc.c b/src/doc.c
index a6ef84b4db6..8b18fb0a5a2 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -299,19 +299,6 @@ read_doc_string (Lisp_Object filepos)
299static bool 299static bool
300reread_doc_file (Lisp_Object file) 300reread_doc_file (Lisp_Object file)
301{ 301{
302#if 0
303 Lisp_Object reply, prompt[3];
304 struct gcpro gcpro1;
305 GCPRO1 (file);
306 prompt[0] = build_string ("File ");
307 prompt[1] = NILP (file) ? Vdoc_file_name : file;
308 prompt[2] = build_string (" is out of sync. Reload? ");
309 reply = Fy_or_n_p (Fconcat (3, prompt));
310 UNGCPRO;
311 if (NILP (reply))
312 return 0;
313#endif
314
315 if (NILP (file)) 302 if (NILP (file))
316 Fsnarf_documentation (Vdoc_file_name); 303 Fsnarf_documentation (Vdoc_file_name);
317 else 304 else
diff --git a/src/editfns.c b/src/editfns.c
index 621e841c3f5..7026ccc084e 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2033,20 +2033,20 @@ DOW and ZONE.) */)
2033 /* Avoid overflow when INT_MAX < EMACS_INT_MAX. */ 2033 /* Avoid overflow when INT_MAX < EMACS_INT_MAX. */
2034 EMACS_INT tm_year_base = TM_YEAR_BASE; 2034 EMACS_INT tm_year_base = TM_YEAR_BASE;
2035 2035
2036 return Flist (9, ((Lisp_Object []) 2036 return CALLN (Flist,
2037 {make_number (local_tm.tm_sec), 2037 make_number (local_tm.tm_sec),
2038 make_number (local_tm.tm_min), 2038 make_number (local_tm.tm_min),
2039 make_number (local_tm.tm_hour), 2039 make_number (local_tm.tm_hour),
2040 make_number (local_tm.tm_mday), 2040 make_number (local_tm.tm_mday),
2041 make_number (local_tm.tm_mon + 1), 2041 make_number (local_tm.tm_mon + 1),
2042 make_number (local_tm.tm_year + tm_year_base), 2042 make_number (local_tm.tm_year + tm_year_base),
2043 make_number (local_tm.tm_wday), 2043 make_number (local_tm.tm_wday),
2044 local_tm.tm_isdst ? Qt : Qnil, 2044 local_tm.tm_isdst ? Qt : Qnil,
2045 (HAVE_TM_GMTOFF 2045 (HAVE_TM_GMTOFF
2046 ? make_number (tm_gmtoff (&local_tm)) 2046 ? make_number (tm_gmtoff (&local_tm))
2047 : gmtime_r (&time_spec, &gmt_tm) 2047 : gmtime_r (&time_spec, &gmt_tm)
2048 ? make_number (tm_diff (&local_tm, &gmt_tm)) 2048 ? make_number (tm_diff (&local_tm, &gmt_tm))
2049 : Qnil)})); 2049 : Qnil));
2050} 2050}
2051 2051
2052/* Return OBJ - OFFSET, checking that OBJ is a valid fixnum and that 2052/* Return OBJ - OFFSET, checking that OBJ is a valid fixnum and that
@@ -2679,25 +2679,20 @@ update_buffer_properties (ptrdiff_t start, ptrdiff_t end)
2679 call them, specifying the range of the buffer being accessed. */ 2679 call them, specifying the range of the buffer being accessed. */
2680 if (!NILP (Vbuffer_access_fontify_functions)) 2680 if (!NILP (Vbuffer_access_fontify_functions))
2681 { 2681 {
2682 Lisp_Object args[3];
2683 Lisp_Object tem;
2684
2685 args[0] = Qbuffer_access_fontify_functions;
2686 XSETINT (args[1], start);
2687 XSETINT (args[2], end);
2688
2689 /* But don't call them if we can tell that the work 2682 /* But don't call them if we can tell that the work
2690 has already been done. */ 2683 has already been done. */
2691 if (!NILP (Vbuffer_access_fontified_property)) 2684 if (!NILP (Vbuffer_access_fontified_property))
2692 { 2685 {
2693 tem = Ftext_property_any (args[1], args[2], 2686 Lisp_Object tem
2694 Vbuffer_access_fontified_property, 2687 = Ftext_property_any (make_number (start), make_number (end),
2695 Qnil, Qnil); 2688 Vbuffer_access_fontified_property,
2696 if (! NILP (tem)) 2689 Qnil, Qnil);
2697 Frun_hook_with_args (3, args); 2690 if (NILP (tem))
2691 return;
2698 } 2692 }
2699 else 2693
2700 Frun_hook_with_args (3, args); 2694 CALLN (Frun_hook_with_args, Qbuffer_access_fontify_functions,
2695 make_number (start), make_number (end));
2701 } 2696 }
2702} 2697}
2703 2698
@@ -4516,7 +4511,7 @@ Lisp_Object
4516format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) 4511format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
4517{ 4512{
4518 AUTO_STRING (format, string1); 4513 AUTO_STRING (format, string1);
4519 return Fformat (3, (Lisp_Object []) {format, arg0, arg1}); 4514 return CALLN (Fformat, format, arg0, arg1);
4520} 4515}
4521 4516
4522DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, 4517DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,
diff --git a/src/emacs.c b/src/emacs.c
index d83311ac5b6..03dea46fe2d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -59,11 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59#include TERM_HEADER 59#include TERM_HEADER
60#endif /* HAVE_WINDOW_SYSTEM */ 60#endif /* HAVE_WINDOW_SYSTEM */
61 61
62#ifdef NS_IMPL_GNUSTEP
63/* At least under Debian, GSConfig is in a subdirectory. --Stef */
64#include <GNUstepBase/GSConfig.h>
65#endif
66
67#include "commands.h" 62#include "commands.h"
68#include "intervals.h" 63#include "intervals.h"
69#include "character.h" 64#include "character.h"
diff --git a/src/eval.c b/src/eval.c
index e649c152a5d..b98b224e622 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2535,15 +2535,14 @@ run_hook (Lisp_Object hook)
2535void 2535void
2536run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2) 2536run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2)
2537{ 2537{
2538 Frun_hook_with_args (3, ((Lisp_Object []) { hook, arg1, arg2 })); 2538 CALLN (Frun_hook_with_args, hook, arg1, arg2);
2539} 2539}
2540 2540
2541/* Apply fn to arg. */ 2541/* Apply fn to arg. */
2542Lisp_Object 2542Lisp_Object
2543apply1 (Lisp_Object fn, Lisp_Object arg) 2543apply1 (Lisp_Object fn, Lisp_Object arg)
2544{ 2544{
2545 return (NILP (arg) ? Ffuncall (1, &fn) 2545 return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg);
2546 : Fapply (2, ((Lisp_Object []) { fn, arg })));
2547} 2546}
2548 2547
2549/* Call function fn on no arguments. */ 2548/* Call function fn on no arguments. */
@@ -2558,7 +2557,7 @@ call0 (Lisp_Object fn)
2558Lisp_Object 2557Lisp_Object
2559call1 (Lisp_Object fn, Lisp_Object arg1) 2558call1 (Lisp_Object fn, Lisp_Object arg1)
2560{ 2559{
2561 return Ffuncall (2, ((Lisp_Object []) { fn, arg1 })); 2560 return CALLN (Ffuncall, fn, arg1);
2562} 2561}
2563 2562
2564/* Call function fn with 2 arguments arg1, arg2. */ 2563/* Call function fn with 2 arguments arg1, arg2. */
@@ -2566,7 +2565,7 @@ call1 (Lisp_Object fn, Lisp_Object arg1)
2566Lisp_Object 2565Lisp_Object
2567call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) 2566call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2)
2568{ 2567{
2569 return Ffuncall (3, ((Lisp_Object []) { fn, arg1, arg2 })); 2568 return CALLN (Ffuncall, fn, arg1, arg2);
2570} 2569}
2571 2570
2572/* Call function fn with 3 arguments arg1, arg2, arg3. */ 2571/* Call function fn with 3 arguments arg1, arg2, arg3. */
@@ -2574,7 +2573,7 @@ call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2)
2574Lisp_Object 2573Lisp_Object
2575call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) 2574call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
2576{ 2575{
2577 return Ffuncall (4, ((Lisp_Object []) { fn, arg1, arg2, arg3 })); 2576 return CALLN (Ffuncall, fn, arg1, arg2, arg3);
2578} 2577}
2579 2578
2580/* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */ 2579/* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */
@@ -2583,7 +2582,7 @@ Lisp_Object
2583call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, 2582call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
2584 Lisp_Object arg4) 2583 Lisp_Object arg4)
2585{ 2584{
2586 return Ffuncall (5, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4 })); 2585 return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4);
2587} 2586}
2588 2587
2589/* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */ 2588/* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */
@@ -2592,7 +2591,7 @@ Lisp_Object
2592call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, 2591call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
2593 Lisp_Object arg4, Lisp_Object arg5) 2592 Lisp_Object arg4, Lisp_Object arg5)
2594{ 2593{
2595 return Ffuncall (6, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4, arg5 })); 2594 return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5);
2596} 2595}
2597 2596
2598/* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */ 2597/* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */
@@ -2601,8 +2600,7 @@ Lisp_Object
2601call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, 2600call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
2602 Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6) 2601 Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6)
2603{ 2602{
2604 return Ffuncall (7, ((Lisp_Object []) 2603 return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6);
2605 { fn, arg1, arg2, arg3, arg4, arg5, arg6 }));
2606} 2604}
2607 2605
2608/* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */ 2606/* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */
@@ -2611,8 +2609,7 @@ Lisp_Object
2611call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, 2609call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
2612 Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7) 2610 Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7)
2613{ 2611{
2614 return Ffuncall (8, ((Lisp_Object []) 2612 return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2615 { fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7 }));
2616} 2613}
2617 2614
2618/* The caller should GCPRO all the elements of ARGS. */ 2615/* The caller should GCPRO all the elements of ARGS. */
diff --git a/src/fileio.c b/src/fileio.c
index d0fd08a742e..43ab456d813 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3650,11 +3650,9 @@ by calling `format-decode', which see. */)
3650 { 3650 {
3651 /* If we have not yet decided a coding system, check 3651 /* If we have not yet decided a coding system, check
3652 file-coding-system-alist. */ 3652 file-coding-system-alist. */
3653 Lisp_Object args[6]; 3653 coding_system = CALLN (Ffind_operation_coding_system,
3654 3654 Qinsert_file_contents, orig_filename,
3655 args[0] = Qinsert_file_contents, args[1] = orig_filename; 3655 visit, beg, end, replace);
3656 args[2] = visit, args[3] = beg, args[4] = end, args[5] = replace;
3657 coding_system = Ffind_operation_coding_system (6, args);
3658 if (CONSP (coding_system)) 3656 if (CONSP (coding_system))
3659 coding_system = XCAR (coding_system); 3657 coding_system = XCAR (coding_system);
3660 } 3658 }
@@ -4231,11 +4229,9 @@ by calling `format-decode', which see. */)
4231 { 4229 {
4232 /* If the coding system is not yet decided, check 4230 /* If the coding system is not yet decided, check
4233 file-coding-system-alist. */ 4231 file-coding-system-alist. */
4234 Lisp_Object args[6]; 4232 coding_system = CALLN (Ffind_operation_coding_system,
4235 4233 Qinsert_file_contents, orig_filename,
4236 args[0] = Qinsert_file_contents, args[1] = orig_filename; 4234 visit, beg, end, Qnil);
4237 args[2] = visit, args[3] = beg, args[4] = end, args[5] = Qnil;
4238 coding_system = Ffind_operation_coding_system (6, args);
4239 if (CONSP (coding_system)) 4235 if (CONSP (coding_system))
4240 coding_system = XCAR (coding_system); 4236 coding_system = XCAR (coding_system);
4241 } 4237 }
@@ -4563,12 +4559,9 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4563 if (NILP (val)) 4559 if (NILP (val))
4564 { 4560 {
4565 /* Check file-coding-system-alist. */ 4561 /* Check file-coding-system-alist. */
4566 Lisp_Object args[7], coding_systems; 4562 Lisp_Object coding_systems
4567 4563 = CALLN (Ffind_operation_coding_system, Qwrite_region, start, end,
4568 args[0] = Qwrite_region; args[1] = start; args[2] = end; 4564 filename, append, visit, lockname);
4569 args[3] = filename; args[4] = append; args[5] = visit;
4570 args[6] = lockname;
4571 coding_systems = Ffind_operation_coding_system (7, args);
4572 if (CONSP (coding_systems) && !NILP (XCDR (coding_systems))) 4565 if (CONSP (coding_systems) && !NILP (XCDR (coding_systems)))
4573 val = XCDR (coding_systems); 4566 val = XCDR (coding_systems);
4574 } 4567 }
@@ -5021,10 +5014,7 @@ DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0,
5021 doc: /* Return t if (car A) is numerically less than (car B). */) 5014 doc: /* Return t if (car A) is numerically less than (car B). */)
5022 (Lisp_Object a, Lisp_Object b) 5015 (Lisp_Object a, Lisp_Object b)
5023{ 5016{
5024 Lisp_Object args[2]; 5017 return CALLN (Flss, Fcar (a), Fcar (b));
5025 args[0] = Fcar (a);
5026 args[1] = Fcar (b);
5027 return Flss (2, args);
5028} 5018}
5029 5019
5030/* Build the complete list of annotations appropriate for writing out 5020/* Build the complete list of annotations appropriate for writing out
@@ -5043,7 +5033,7 @@ build_annotations (Lisp_Object start, Lisp_Object end)
5043 struct gcpro gcpro1, gcpro2; 5033 struct gcpro gcpro1, gcpro2;
5044 Lisp_Object original_buffer; 5034 Lisp_Object original_buffer;
5045 int i; 5035 int i;
5046 bool used_global = 0; 5036 bool used_global = false;
5047 5037
5048 XSETBUFFER (original_buffer, current_buffer); 5038 XSETBUFFER (original_buffer, current_buffer);
5049 5039
@@ -5055,11 +5045,10 @@ build_annotations (Lisp_Object start, Lisp_Object end)
5055 struct buffer *given_buffer = current_buffer; 5045 struct buffer *given_buffer = current_buffer;
5056 if (EQ (Qt, XCAR (p)) && !used_global) 5046 if (EQ (Qt, XCAR (p)) && !used_global)
5057 { /* Use the global value of the hook. */ 5047 { /* Use the global value of the hook. */
5058 Lisp_Object arg[2]; 5048 used_global = true;
5059 used_global = 1; 5049 p = CALLN (Fappend,
5060 arg[0] = Fdefault_value (Qwrite_region_annotate_functions); 5050 Fdefault_value (Qwrite_region_annotate_functions),
5061 arg[1] = XCDR (p); 5051 XCDR (p));
5062 p = Fappend (2, arg);
5063 continue; 5052 continue;
5064 } 5053 }
5065 Vwrite_region_annotations_so_far = annotations; 5054 Vwrite_region_annotations_so_far = annotations;
@@ -5388,9 +5377,8 @@ auto_save_error (Lisp_Object error_val)
5388 ring_bell (XFRAME (selected_frame)); 5377 ring_bell (XFRAME (selected_frame));
5389 5378
5390 AUTO_STRING (format, "Auto-saving %s: %s"); 5379 AUTO_STRING (format, "Auto-saving %s: %s");
5391 msg = Fformat (3, ((Lisp_Object []) 5380 msg = CALLN (Fformat, format, BVAR (current_buffer, name),
5392 {format, BVAR (current_buffer, name), 5381 Ferror_message_string (error_val));
5393 Ferror_message_string (error_val)}));
5394 GCPRO1 (msg); 5382 GCPRO1 (msg);
5395 5383
5396 for (i = 0; i < 3; ++i) 5384 for (i = 0; i < 3; ++i)
diff --git a/src/filelock.c b/src/filelock.c
index 8e88435a673..89d3e350219 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -209,8 +209,6 @@ get_boot_time (void)
209 WTMP_FILE, counter); 209 WTMP_FILE, counter);
210 if (! NILP (Ffile_exists_p (tempname))) 210 if (! NILP (Ffile_exists_p (tempname)))
211 { 211 {
212 Lisp_Object args[6];
213
214 /* The utmp functions on mescaline.gnu.org accept only 212 /* The utmp functions on mescaline.gnu.org accept only
215 file names up to 8 characters long. Choose a 2 213 file names up to 8 characters long. Choose a 2
216 character long prefix, and call make_temp_file with 214 character long prefix, and call make_temp_file with
@@ -219,13 +217,9 @@ get_boot_time (void)
219 filename = Fexpand_file_name (build_string ("wt"), 217 filename = Fexpand_file_name (build_string ("wt"),
220 Vtemporary_file_directory); 218 Vtemporary_file_directory);
221 filename = make_temp_name (filename, 1); 219 filename = make_temp_name (filename, 1);
222 args[0] = build_string ("gzip"); 220 CALLN (Fcall_process, build_string ("gzip"), Qnil,
223 args[1] = Qnil; 221 list2 (QCfile, filename), Qnil,
224 args[2] = list2 (QCfile, filename); 222 build_string ("-cd"), tempname);
225 args[3] = Qnil;
226 args[4] = build_string ("-cd");
227 args[5] = tempname;
228 Fcall_process (6, args);
229 delete_flag = 1; 223 delete_flag = 1;
230 } 224 }
231 } 225 }
diff --git a/src/fns.c b/src/fns.c
index a4b2e6d8e85..4c7095133eb 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -440,21 +440,14 @@ static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args,
440Lisp_Object 440Lisp_Object
441concat2 (Lisp_Object s1, Lisp_Object s2) 441concat2 (Lisp_Object s1, Lisp_Object s2)
442{ 442{
443 Lisp_Object args[2]; 443 return concat (2, ((Lisp_Object []) {s1, s2}), Lisp_String, 0);
444 args[0] = s1;
445 args[1] = s2;
446 return concat (2, args, Lisp_String, 0);
447} 444}
448 445
449/* ARGSUSED */ 446/* ARGSUSED */
450Lisp_Object 447Lisp_Object
451concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3) 448concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3)
452{ 449{
453 Lisp_Object args[3]; 450 return concat (3, ((Lisp_Object []) {s1, s2, s3}), Lisp_String, 0);
454 args[0] = s1;
455 args[1] = s2;
456 args[2] = s3;
457 return concat (3, args, Lisp_String, 0);
458} 451}
459 452
460DEFUN ("append", Fappend, Sappend, 0, MANY, 0, 453DEFUN ("append", Fappend, Sappend, 0, MANY, 0,
@@ -2255,12 +2248,7 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, int depth, bool props,
2255 if (depth > 200) 2248 if (depth > 200)
2256 error ("Stack overflow in equal"); 2249 error ("Stack overflow in equal");
2257 if (NILP (ht)) 2250 if (NILP (ht))
2258 { 2251 ht = CALLN (Fmake_hash_table, QCtest, Qeq);
2259 Lisp_Object args[2];
2260 args[0] = QCtest;
2261 args[1] = Qeq;
2262 ht = Fmake_hash_table (2, args);
2263 }
2264 switch (XTYPE (o1)) 2252 switch (XTYPE (o1))
2265 { 2253 {
2266 case Lisp_Cons: case Lisp_Misc: case Lisp_Vectorlike: 2254 case Lisp_Cons: case Lisp_Misc: case Lisp_Vectorlike:
@@ -2464,10 +2452,7 @@ This makes STRING unibyte and may change its length. */)
2464Lisp_Object 2452Lisp_Object
2465nconc2 (Lisp_Object s1, Lisp_Object s2) 2453nconc2 (Lisp_Object s1, Lisp_Object s2)
2466{ 2454{
2467 Lisp_Object args[2]; 2455 return CALLN (Fnconc, s1, s2);
2468 args[0] = s1;
2469 args[1] = s2;
2470 return Fnconc (2, args);
2471} 2456}
2472 2457
2473DEFUN ("nconc", Fnconc, Snconc, 0, MANY, 0, 2458DEFUN ("nconc", Fnconc, Snconc, 0, MANY, 0,
@@ -2715,7 +2700,7 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
2715 } 2700 }
2716 2701
2717 AUTO_STRING (yes_or_no, "(yes or no) "); 2702 AUTO_STRING (yes_or_no, "(yes or no) ");
2718 prompt = Fconcat (2, (Lisp_Object []) {prompt, yes_or_no}); 2703 prompt = CALLN (Fconcat, prompt, yes_or_no);
2719 GCPRO1 (prompt); 2704 GCPRO1 (prompt);
2720 2705
2721 while (1) 2706 while (1)
@@ -2995,15 +2980,13 @@ usage: (widget-apply WIDGET PROPERTY &rest ARGS) */)
2995 (ptrdiff_t nargs, Lisp_Object *args) 2980 (ptrdiff_t nargs, Lisp_Object *args)
2996{ 2981{
2997 /* This function can GC. */ 2982 /* This function can GC. */
2998 Lisp_Object newargs[3];
2999 struct gcpro gcpro1, gcpro2; 2983 struct gcpro gcpro1, gcpro2;
3000 Lisp_Object result; 2984 Lisp_Object widget = args[0];
3001 2985 Lisp_Object property = args[1];
3002 newargs[0] = Fwidget_get (args[0], args[1]); 2986 Lisp_Object propval = Fwidget_get (widget, property);
3003 newargs[1] = args[0]; 2987 Lisp_Object trailing_args = Flist (nargs - 2, args + 2);
3004 newargs[2] = Flist (nargs - 2, args + 2); 2988 GCPRO2 (propval, trailing_args);
3005 GCPRO2 (newargs[0], newargs[2]); 2989 Lisp_Object result = CALLN (Fapply, propval, widget, trailing_args);
3006 result = Fapply (3, newargs);
3007 UNGCPRO; 2990 UNGCPRO;
3008 return result; 2991 return result;
3009} 2992}
@@ -3750,12 +3733,7 @@ cmpfn_user_defined (struct hash_table_test *ht,
3750 Lisp_Object key1, 3733 Lisp_Object key1,
3751 Lisp_Object key2) 3734 Lisp_Object key2)
3752{ 3735{
3753 Lisp_Object args[3]; 3736 return !NILP (call2 (ht->user_cmp_function, key1, key2));
3754
3755 args[0] = ht->user_cmp_function;
3756 args[1] = key1;
3757 args[2] = key2;
3758 return !NILP (Ffuncall (3, args));
3759} 3737}
3760 3738
3761 3739
@@ -3803,11 +3781,7 @@ hashfn_equal (struct hash_table_test *ht, Lisp_Object key)
3803static EMACS_UINT 3781static EMACS_UINT
3804hashfn_user_defined (struct hash_table_test *ht, Lisp_Object key) 3782hashfn_user_defined (struct hash_table_test *ht, Lisp_Object key)
3805{ 3783{
3806 Lisp_Object args[2], hash; 3784 Lisp_Object hash = call1 (ht->user_hash_function, key);
3807
3808 args[0] = ht->user_hash_function;
3809 args[1] = key;
3810 hash = Ffuncall (2, args);
3811 return hashfn_eq (ht, hash); 3785 return hashfn_eq (ht, hash);
3812} 3786}
3813 3787
@@ -3980,9 +3954,8 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
3980#ifdef ENABLE_CHECKING 3954#ifdef ENABLE_CHECKING
3981 if (HASH_TABLE_P (Vpurify_flag) 3955 if (HASH_TABLE_P (Vpurify_flag)
3982 && XHASH_TABLE (Vpurify_flag) == h) 3956 && XHASH_TABLE (Vpurify_flag) == h)
3983 Fmessage (2, ((Lisp_Object []) 3957 CALLN (Fmessage, build_string ("Growing hash table to: %d"),
3984 { build_string ("Growing hash table to: %d"), 3958 make_number (new_size));
3985 make_number (new_size) }));
3986#endif 3959#endif
3987 3960
3988 set_hash_key_and_value (h, larger_vector (h->key_and_value, 3961 set_hash_key_and_value (h, larger_vector (h->key_and_value,
@@ -4759,17 +4732,10 @@ FUNCTION is called with two arguments, KEY and VALUE.
4759 (Lisp_Object function, Lisp_Object table) 4732 (Lisp_Object function, Lisp_Object table)
4760{ 4733{
4761 struct Lisp_Hash_Table *h = check_hash_table (table); 4734 struct Lisp_Hash_Table *h = check_hash_table (table);
4762 Lisp_Object args[3];
4763 ptrdiff_t i;
4764 4735
4765 for (i = 0; i < HASH_TABLE_SIZE (h); ++i) 4736 for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i)
4766 if (!NILP (HASH_HASH (h, i))) 4737 if (!NILP (HASH_HASH (h, i)))
4767 { 4738 call2 (function, HASH_KEY (h, i), HASH_VALUE (h, i));
4768 args[0] = function;
4769 args[1] = HASH_KEY (h, i);
4770 args[2] = HASH_VALUE (h, i);
4771 Ffuncall (3, args);
4772 }
4773 4739
4774 return Qnil; 4740 return Qnil;
4775} 4741}
@@ -4911,11 +4877,9 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start,
4911 if (NILP (coding_system) && !NILP (Fbuffer_file_name (object))) 4877 if (NILP (coding_system) && !NILP (Fbuffer_file_name (object)))
4912 { 4878 {
4913 /* Check file-coding-system-alist. */ 4879 /* Check file-coding-system-alist. */
4914 Lisp_Object args[4], val; 4880 Lisp_Object val = CALLN (Ffind_operation_coding_system,
4915 4881 Qwrite_region, start, end,
4916 args[0] = Qwrite_region; args[1] = start; args[2] = end; 4882 Fbuffer_file_name (object));
4917 args[3] = Fbuffer_file_name (object);
4918 val = Ffind_operation_coding_system (4, args);
4919 if (CONSP (val) && !NILP (XCDR (val))) 4883 if (CONSP (val) && !NILP (XCDR (val)))
4920 coding_system = XCDR (val); 4884 coding_system = XCDR (val);
4921 } 4885 }
diff --git a/src/font.c b/src/font.c
index d05742ce2bf..d1a008e794d 100644
--- a/src/font.c
+++ b/src/font.c
@@ -374,8 +374,7 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val,
374 elt = Fmake_vector (make_number (2), make_number (100)); 374 elt = Fmake_vector (make_number (2), make_number (100));
375 ASET (elt, 1, val); 375 ASET (elt, 1, val);
376 ASET (font_style_table, prop - FONT_WEIGHT_INDEX, 376 ASET (font_style_table, prop - FONT_WEIGHT_INDEX,
377 Fvconcat (2, ((Lisp_Object []) 377 CALLN (Fvconcat, table, Fmake_vector (make_number (1), elt)));
378 { table, Fmake_vector (make_number (1), elt) })));
379 return (100 << 8) | (i << 4); 378 return (100 << 8) | (i << 4);
380 } 379 }
381 else 380 else
@@ -3400,16 +3399,11 @@ font_open_by_spec (struct frame *f, Lisp_Object spec)
3400Lisp_Object 3399Lisp_Object
3401font_open_by_name (struct frame *f, Lisp_Object name) 3400font_open_by_name (struct frame *f, Lisp_Object name)
3402{ 3401{
3403 Lisp_Object args[2]; 3402 Lisp_Object spec = CALLN (Ffont_spec, QCname, name);
3404 Lisp_Object spec, ret; 3403 Lisp_Object ret = font_open_by_spec (f, spec);
3405
3406 args[0] = QCname;
3407 args[1] = name;
3408 spec = Ffont_spec (2, args);
3409 ret = font_open_by_spec (f, spec);
3410 /* Do not lose name originally put in. */ 3404 /* Do not lose name originally put in. */
3411 if (!NILP (ret)) 3405 if (!NILP (ret))
3412 font_put_extra (ret, QCuser_spec, args[1]); 3406 font_put_extra (ret, QCuser_spec, name);
3413 3407
3414 return ret; 3408 return ret;
3415} 3409}
@@ -4181,13 +4175,7 @@ how close they are to PREFER. */)
4181 else 4175 else
4182 vec = font_vconcat_entity_vectors (list); 4176 vec = font_vconcat_entity_vectors (list);
4183 if (n == 0 || n >= ASIZE (vec)) 4177 if (n == 0 || n >= ASIZE (vec))
4184 { 4178 list = CALLN (Fappend, vec, Qnil);
4185 Lisp_Object args[2];
4186
4187 args[0] = vec;
4188 args[1] = Qnil;
4189 list = Fappend (2, args);
4190 }
4191 else 4179 else
4192 { 4180 {
4193 for (list = Qnil, n--; n >= 0; n--) 4181 for (list = Qnil, n--; n >= 0; n--)
diff --git a/src/fontset.c b/src/fontset.c
index b257da117b6..357526bacfe 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -349,16 +349,17 @@ fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Objec
349 from1 = from, to1 = to; 349 from1 = from, to1 = to;
350 args[idx] = char_table_ref_and_range (fontset, from, &from1, &to1); 350 args[idx] = char_table_ref_and_range (fontset, from, &from1, &to1);
351 char_table_set_range (fontset, from, to1, 351 char_table_set_range (fontset, from, to1,
352 NILP (args[idx]) ? args[1 - idx] 352 (NILP (args[idx]) ? args[1 - idx]
353 : Fvconcat (2, args)); 353 : CALLMANY (Fvconcat, args)));
354 from = to1 + 1; 354 from = to1 + 1;
355 } while (from < to); 355 } while (from < to);
356 } 356 }
357 else 357 else
358 { 358 {
359 args[idx] = FONTSET_FALLBACK (fontset); 359 args[idx] = FONTSET_FALLBACK (fontset);
360 set_fontset_fallback 360 set_fontset_fallback (fontset,
361 (fontset, NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args)); 361 (NILP (args[idx]) ? args[1 - idx]
362 : CALLMANY (Fvconcat, args)));
362 } 363 }
363} 364}
364 365
@@ -1432,12 +1433,8 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1432 } 1433 }
1433 else if (STRINGP (font_spec)) 1434 else if (STRINGP (font_spec))
1434 { 1435 {
1435 Lisp_Object args[2];
1436
1437 fontname = font_spec; 1436 fontname = font_spec;
1438 args[0] = QCname; 1437 font_spec = CALLN (Ffont_spec, QCname, fontname);
1439 args[1] = font_spec;
1440 font_spec = Ffont_spec (2, args);
1441 } 1438 }
1442 else if (FONT_SPEC_P (font_spec)) 1439 else if (FONT_SPEC_P (font_spec))
1443 fontname = Ffont_xlfd_name (font_spec, Qnil); 1440 fontname = Ffont_xlfd_name (font_spec, Qnil);
diff --git a/src/ftfont.c b/src/ftfont.c
index 053b95fc69f..adf188815de 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -375,13 +375,7 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)
375 if (NILP (cache)) 375 if (NILP (cache))
376 { 376 {
377 if (NILP (ft_face_cache)) 377 if (NILP (ft_face_cache))
378 { 378 ft_face_cache = CALLN (Fmake_hash_table, QCtest, Qequal);
379 Lisp_Object args[2];
380
381 args[0] = QCtest;
382 args[1] = Qequal;
383 ft_face_cache = Fmake_hash_table (2, args);
384 }
385 cache_data = xmalloc (sizeof *cache_data); 379 cache_data = xmalloc (sizeof *cache_data);
386 cache_data->ft_face = NULL; 380 cache_data->ft_face = NULL;
387 cache_data->fc_charset = NULL; 381 cache_data->fc_charset = NULL;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index da05742b0c6..21f3cb15e66 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2072,28 +2072,17 @@ xg_get_font (struct frame *f, const char *default_name)
2072 2072
2073 if (desc) 2073 if (desc)
2074 { 2074 {
2075 Lisp_Object args[10];
2076 const char *name = pango_font_description_get_family (desc); 2075 const char *name = pango_font_description_get_family (desc);
2077 gint size = pango_font_description_get_size (desc); 2076 gint size = pango_font_description_get_size (desc);
2078 PangoWeight weight = pango_font_description_get_weight (desc); 2077 PangoWeight weight = pango_font_description_get_weight (desc);
2079 PangoStyle style = pango_font_description_get_style (desc); 2078 PangoStyle style = pango_font_description_get_style (desc);
2080 2079
2081 args[0] = QCname; 2080 font = CALLN (Ffont_spec,
2082 args[1] = build_string (name); 2081 QCname, build_string (name),
2083 2082 QCsize, make_float (pango_units_to_double (size)),
2084 args[2] = QCsize; 2083 QCweight, XG_WEIGHT_TO_SYMBOL (weight),
2085 args[3] = make_float (pango_units_to_double (size)); 2084 QCslant, XG_STYLE_TO_SYMBOL (style),
2086 2085 QCtype, Qxft);
2087 args[4] = QCweight;
2088 args[5] = XG_WEIGHT_TO_SYMBOL (weight);
2089
2090 args[6] = QCslant;
2091 args[7] = XG_STYLE_TO_SYMBOL (style);
2092
2093 args[8] = QCtype;
2094 args[9] = Qxft;
2095
2096 font = Ffont_spec (10, args);
2097 2086
2098 pango_font_description_free (desc); 2087 pango_font_description_free (desc);
2099 dupstring (&x_last_font_name, name); 2088 dupstring (&x_last_font_name, name);
diff --git a/src/insdel.c b/src/insdel.c
index 4463721b897..3b5b520aac8 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1997,7 +1997,6 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
1997 /* Now run the before-change-functions if any. */ 1997 /* Now run the before-change-functions if any. */
1998 if (!NILP (Vbefore_change_functions)) 1998 if (!NILP (Vbefore_change_functions))
1999 { 1999 {
2000 Lisp_Object args[3];
2001 rvoe_arg.location = &Vbefore_change_functions; 2000 rvoe_arg.location = &Vbefore_change_functions;
2002 rvoe_arg.errorp = 1; 2001 rvoe_arg.errorp = 1;
2003 2002
@@ -2008,10 +2007,8 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
2008 record_unwind_protect_ptr (reset_var_on_error, &rvoe_arg); 2007 record_unwind_protect_ptr (reset_var_on_error, &rvoe_arg);
2009 2008
2010 /* Actually run the hook functions. */ 2009 /* Actually run the hook functions. */
2011 args[0] = Qbefore_change_functions; 2010 CALLN (Frun_hook_with_args, Qbefore_change_functions,
2012 args[1] = FETCH_START; 2011 FETCH_START, FETCH_END);
2013 args[2] = FETCH_END;
2014 Frun_hook_with_args (3, args);
2015 2012
2016 /* There was no error: unarm the reset_on_error. */ 2013 /* There was no error: unarm the reset_on_error. */
2017 rvoe_arg.errorp = 0; 2014 rvoe_arg.errorp = 0;
@@ -2079,7 +2076,6 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
2079 2076
2080 if (!NILP (Vafter_change_functions)) 2077 if (!NILP (Vafter_change_functions))
2081 { 2078 {
2082 Lisp_Object args[4];
2083 rvoe_arg.location = &Vafter_change_functions; 2079 rvoe_arg.location = &Vafter_change_functions;
2084 rvoe_arg.errorp = 1; 2080 rvoe_arg.errorp = 1;
2085 2081
@@ -2087,11 +2083,9 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
2087 record_unwind_protect_ptr (reset_var_on_error, &rvoe_arg); 2083 record_unwind_protect_ptr (reset_var_on_error, &rvoe_arg);
2088 2084
2089 /* Actually run the hook functions. */ 2085 /* Actually run the hook functions. */
2090 args[0] = Qafter_change_functions; 2086 CALLN (Frun_hook_with_args, Qafter_change_functions,
2091 XSETFASTINT (args[1], charpos); 2087 make_number (charpos), make_number (charpos + lenins),
2092 XSETFASTINT (args[2], charpos + lenins); 2088 make_number (lendel));
2093 XSETFASTINT (args[3], lendel);
2094 Frun_hook_with_args (4, args);
2095 2089
2096 /* There was no error: unarm the reset_on_error. */ 2090 /* There was no error: unarm the reset_on_error. */
2097 rvoe_arg.errorp = 0; 2091 rvoe_arg.errorp = 0;
diff --git a/src/keyboard.c b/src/keyboard.c
index e9ecd8cbd3d..a5e1363326c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1844,7 +1844,7 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
1844 AUTO_STRING (format, "Error in %s (%S): %S"); 1844 AUTO_STRING (format, "Error in %s (%S): %S");
1845 Lisp_Object hook = args[0]; 1845 Lisp_Object hook = args[0];
1846 Lisp_Object fun = args[1]; 1846 Lisp_Object fun = args[1];
1847 Fmessage (4, (Lisp_Object []) {format, hook, fun, error}); 1847 CALLN (Fmessage, format, hook, fun, error);
1848 1848
1849 if (SYMBOLP (hook)) 1849 if (SYMBOLP (hook))
1850 { 1850 {
@@ -1877,13 +1877,10 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
1877static Lisp_Object 1877static Lisp_Object
1878safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) 1878safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args)
1879{ 1879{
1880 Lisp_Object iargs[2];
1881
1882 eassert (nargs == 2); 1880 eassert (nargs == 2);
1883 /* Yes, run_hook_with_args works this way. */ 1881 /* Yes, run_hook_with_args works with args in the other order. */
1884 iargs[0] = args[1]; 1882 internal_condition_case_n (safe_run_hooks_1,
1885 iargs[1] = args[0]; 1883 2, ((Lisp_Object []) {args[1], args[0]}),
1886 internal_condition_case_n (safe_run_hooks_1, 2, iargs,
1887 Qt, safe_run_hooks_error); 1884 Qt, safe_run_hooks_error);
1888 return Qnil; 1885 return Qnil;
1889} 1886}
@@ -1895,16 +1892,12 @@ safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args)
1895void 1892void
1896safe_run_hooks (Lisp_Object hook) 1893safe_run_hooks (Lisp_Object hook)
1897{ 1894{
1898 Lisp_Object args[2];
1899 struct gcpro gcpro1; 1895 struct gcpro gcpro1;
1900 ptrdiff_t count = SPECPDL_INDEX (); 1896 ptrdiff_t count = SPECPDL_INDEX ();
1901 1897
1902 args[0] = hook;
1903 args[1] = hook;
1904
1905 GCPRO1 (hook); 1898 GCPRO1 (hook);
1906 specbind (Qinhibit_quit, Qt); 1899 specbind (Qinhibit_quit, Qt);
1907 run_hook_with_args (2, args, safe_run_hook_funcall); 1900 run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall);
1908 unbind_to (count, Qnil); 1901 unbind_to (count, Qnil);
1909 UNGCPRO; 1902 UNGCPRO;
1910} 1903}
@@ -10756,25 +10749,25 @@ The elements of this list correspond to the arguments of
10756`set-input-mode'. */) 10749`set-input-mode'. */)
10757 (void) 10750 (void)
10758{ 10751{
10759 Lisp_Object val[4];
10760 struct frame *sf = XFRAME (selected_frame); 10752 struct frame *sf = XFRAME (selected_frame);
10761 10753
10762 val[0] = interrupt_input ? Qt : Qnil; 10754 Lisp_Object interrupt = interrupt_input ? Qt : Qnil;
10755 Lisp_Object flow, meta;
10763 if (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)) 10756 if (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))
10764 { 10757 {
10765 val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil; 10758 flow = FRAME_TTY (sf)->flow_control ? Qt : Qnil;
10766 val[2] = (FRAME_TTY (sf)->meta_key == 2 10759 meta = (FRAME_TTY (sf)->meta_key == 2
10767 ? make_number (0) 10760 ? make_number (0)
10768 : (CURTTY ()->meta_key == 1 ? Qt : Qnil)); 10761 : (CURTTY ()->meta_key == 1 ? Qt : Qnil));
10769 } 10762 }
10770 else 10763 else
10771 { 10764 {
10772 val[1] = Qnil; 10765 flow = Qnil;
10773 val[2] = Qt; 10766 meta = Qt;
10774 } 10767 }
10775 XSETFASTINT (val[3], quit_char); 10768 Lisp_Object quit = make_number (quit_char);
10776 10769
10777 return Flist (ARRAYELTS (val), val); 10770 return list4 (interrupt, flow, meta, quit);
10778} 10771}
10779 10772
10780DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0, 10773DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0,
diff --git a/src/keymap.c b/src/keymap.c
index 9c7b4d29a3e..34fe1cb7a95 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1292,7 +1292,7 @@ static Lisp_Object
1292append_key (Lisp_Object key_sequence, Lisp_Object key) 1292append_key (Lisp_Object key_sequence, Lisp_Object key)
1293{ 1293{
1294 AUTO_LIST1 (key_list, key); 1294 AUTO_LIST1 (key_list, key);
1295 return Fvconcat (2, ((Lisp_Object []) { key_sequence, key_list })); 1295 return CALLN (Fvconcat, key_sequence, key_list);
1296} 1296}
1297 1297
1298/* Given a event type C which is a symbol, 1298/* Given a event type C which is a symbol,
@@ -2435,8 +2435,7 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps,
2435 if (NILP (where_is_cache)) 2435 if (NILP (where_is_cache))
2436 { 2436 {
2437 /* We need to create the cache. */ 2437 /* We need to create the cache. */
2438 Lisp_Object args[2]; 2438 where_is_cache = Fmake_hash_table (0, NULL);
2439 where_is_cache = Fmake_hash_table (0, args);
2440 where_is_cache_keymaps = Qt; 2439 where_is_cache_keymaps = Qt;
2441 } 2440 }
2442 else 2441 else
diff --git a/src/lisp.h b/src/lisp.h
index 76a9ed8f159..87bc3efd198 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2803,6 +2803,15 @@ enum maxargs
2803 UNEVALLED = -1 2803 UNEVALLED = -1
2804 }; 2804 };
2805 2805
2806/* Call a function F that accepts many args, passing it ARRAY's elements. */
2807#define CALLMANY(f, array) (f) (ARRAYELTS (array), array)
2808
2809/* Call a function F that accepts many args, passing it the remaining args,
2810 E.g., 'return CALLN (Fformat, fmt, text);' is less error-prone than
2811 '{ Lisp_Object a[2]; a[0] = fmt; a[1] = text; return Fformat (2, a); }'.
2812 CALLN is overkill for simple usages like 'Finsert (1, &text);'. */
2813#define CALLN(f, ...) CALLMANY (f, ((Lisp_Object []) {__VA_ARGS__}))
2814
2806extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *); 2815extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *);
2807extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *); 2816extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *);
2808extern void defvar_bool (struct Lisp_Boolfwd *, const char *, bool *); 2817extern void defvar_bool (struct Lisp_Boolfwd *, const char *, bool *);
diff --git a/src/lread.c b/src/lread.c
index 7f7bd8985d9..69ec05964be 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -947,7 +947,7 @@ load_warn_old_style_backquotes (Lisp_Object file)
947 if (!NILP (Vold_style_backquotes)) 947 if (!NILP (Vold_style_backquotes))
948 { 948 {
949 AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); 949 AUTO_STRING (format, "Loading `%s': old-style backquotes detected!");
950 Fmessage (2, (Lisp_Object []) {format, file}); 950 CALLN (Fmessage, format, file);
951 } 951 }
952} 952}
953 953
@@ -1100,12 +1100,7 @@ Return t if the file exists and loads successfully. */)
1100 { 1100 {
1101 suffixes = Fget_load_suffixes (); 1101 suffixes = Fget_load_suffixes ();
1102 if (NILP (must_suffix)) 1102 if (NILP (must_suffix))
1103 { 1103 suffixes = CALLN (Fappend, suffixes, Vload_file_rep_suffixes);
1104 Lisp_Object arg[2];
1105 arg[0] = suffixes;
1106 arg[1] = Vload_file_rep_suffixes;
1107 suffixes = Fappend (2, arg);
1108 }
1109 } 1104 }
1110 1105
1111 fd = openp (Vload_path, file, suffixes, &found, Qnil, load_prefer_newer); 1106 fd = openp (Vload_path, file, suffixes, &found, Qnil, load_prefer_newer);
@@ -4401,12 +4396,10 @@ init_lread (void)
4401 /* Replace nils from EMACSLOADPATH by default. */ 4396 /* Replace nils from EMACSLOADPATH by default. */
4402 while (CONSP (elpath)) 4397 while (CONSP (elpath))
4403 { 4398 {
4404 Lisp_Object arg[2];
4405 elem = XCAR (elpath); 4399 elem = XCAR (elpath);
4406 elpath = XCDR (elpath); 4400 elpath = XCDR (elpath);
4407 arg[0] = Vload_path; 4401 Vload_path = CALLN (Fappend, Vload_path,
4408 arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil); 4402 NILP (elem) ? default_lpath : list1 (elem));
4409 Vload_path = Fappend (2, arg);
4410 } 4403 }
4411 } /* Fmemq (Qnil, Vload_path) */ 4404 } /* Fmemq (Qnil, Vload_path) */
4412 } 4405 }
diff --git a/src/minibuf.c b/src/minibuf.c
index 0d6e2c79813..3408bb995c6 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1131,9 +1131,8 @@ function, instead of the usual behavior. */)
1131 } 1131 }
1132 1132
1133 AUTO_STRING (format, "%s (default %s): "); 1133 AUTO_STRING (format, "%s (default %s): ");
1134 prompt = Fformat (3, ((Lisp_Object []) 1134 prompt = CALLN (Fformat, format, prompt,
1135 {format, prompt, 1135 CONSP (def) ? XCAR (def) : def);
1136 CONSP (def) ? XCAR (def) : def}));
1137 } 1136 }
1138 1137
1139 result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), 1138 result = Fcompleting_read (prompt, intern ("internal-complete-buffer"),
@@ -1141,8 +1140,7 @@ function, instead of the usual behavior. */)
1141 Qbuffer_name_history, def, Qnil); 1140 Qbuffer_name_history, def, Qnil);
1142 } 1141 }
1143 else 1142 else
1144 result = Ffuncall (4, ((Lisp_Object []) 1143 result = call3 (Vread_buffer_function, prompt, def, require_match);
1145 { Vread_buffer_function, prompt, def, require_match }));
1146 return unbind_to (count, result); 1144 return unbind_to (count, result);
1147} 1145}
1148 1146
@@ -1662,17 +1660,10 @@ Completion ignores case if the ambient value of
1662See also `completing-read-function'. */) 1660See also `completing-read-function'. */)
1663 (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) 1661 (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)
1664{ 1662{
1665 Lisp_Object args[9]; 1663 return CALLN (Ffuncall,
1666 args[0] = Fsymbol_value (intern ("completing-read-function")); 1664 Fsymbol_value (intern ("completing-read-function")),
1667 args[1] = prompt; 1665 prompt, collection, predicate, require_match, initial_input,
1668 args[2] = collection; 1666 hist, def, inherit_input_method);
1669 args[3] = predicate;
1670 args[4] = require_match;
1671 args[5] = initial_input;
1672 args[6] = hist;
1673 args[7] = def;
1674 args[8] = inherit_input_method;
1675 return Ffuncall (9, args);
1676} 1667}
1677 1668
1678/* Test whether TXT is an exact completion. */ 1669/* Test whether TXT is an exact completion. */
diff --git a/src/print.c b/src/print.c
index 688327dfe1c..75288bc6a3a 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1175,12 +1175,7 @@ print_preprocess (Lisp_Object obj)
1175 if (PRINT_CIRCLE_CANDIDATE_P (obj)) 1175 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1176 { 1176 {
1177 if (!HASH_TABLE_P (Vprint_number_table)) 1177 if (!HASH_TABLE_P (Vprint_number_table))
1178 { 1178 Vprint_number_table = CALLN (Fmake_hash_table, QCtest, Qeq);
1179 Lisp_Object args[2];
1180 args[0] = QCtest;
1181 args[1] = Qeq;
1182 Vprint_number_table = Fmake_hash_table (2, args);
1183 }
1184 1179
1185 /* In case print-circle is nil and print-gensym is t, 1180 /* In case print-circle is nil and print-gensym is t,
1186 add OBJ to Vprint_number_table only when OBJ is a symbol. */ 1181 add OBJ to Vprint_number_table only when OBJ is a symbol. */
diff --git a/src/process.c b/src/process.c
index 0789f20f1d2..1d935ba8a3e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1338,7 +1338,7 @@ Returns nil if format of ADDRESS is invalid. */)
1338 if (CONSP (address)) 1338 if (CONSP (address))
1339 { 1339 {
1340 AUTO_STRING (format, "<Family %d>"); 1340 AUTO_STRING (format, "<Family %d>");
1341 return Fformat (2, (Lisp_Object []) {format, Fcar (address)}); 1341 return CALLN (Fformat, format, Fcar (address));
1342 } 1342 }
1343 1343
1344 return Qnil; 1344 return Qnil;
@@ -3422,7 +3422,7 @@ usage: (make-network-process &rest ARGS) */)
3422 struct gcpro gcpro1; 3422 struct gcpro gcpro1;
3423 /* Qt denotes we have not yet called Ffind_operation_coding_system. */ 3423 /* Qt denotes we have not yet called Ffind_operation_coding_system. */
3424 Lisp_Object coding_systems = Qt; 3424 Lisp_Object coding_systems = Qt;
3425 Lisp_Object fargs[5], val; 3425 Lisp_Object val;
3426 3426
3427 if (!NILP (tem)) 3427 if (!NILP (tem))
3428 { 3428 {
@@ -3445,10 +3445,10 @@ usage: (make-network-process &rest ARGS) */)
3445 coding_systems = Qnil; 3445 coding_systems = Qnil;
3446 else 3446 else
3447 { 3447 {
3448 fargs[0] = Qopen_network_stream, fargs[1] = name,
3449 fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
3450 GCPRO1 (proc); 3448 GCPRO1 (proc);
3451 coding_systems = Ffind_operation_coding_system (5, fargs); 3449 coding_systems = CALLN (Ffind_operation_coding_system,
3450 Qopen_network_stream, name, buffer,
3451 host, service);
3452 UNGCPRO; 3452 UNGCPRO;
3453 } 3453 }
3454 if (CONSP (coding_systems)) 3454 if (CONSP (coding_systems))
@@ -3478,10 +3478,10 @@ usage: (make-network-process &rest ARGS) */)
3478 coding_systems = Qnil; 3478 coding_systems = Qnil;
3479 else 3479 else
3480 { 3480 {
3481 fargs[0] = Qopen_network_stream, fargs[1] = name,
3482 fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
3483 GCPRO1 (proc); 3481 GCPRO1 (proc);
3484 coding_systems = Ffind_operation_coding_system (5, fargs); 3482 coding_systems = CALLN (Ffind_operation_coding_system,
3483 Qopen_network_stream, name, buffer,
3484 host, service);
3485 UNGCPRO; 3485 UNGCPRO;
3486 } 3486 }
3487 } 3487 }
@@ -4064,12 +4064,12 @@ server_accept_connection (Lisp_Object server, int channel)
4064 unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; 4064 unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr;
4065 4065
4066 AUTO_STRING (ipv4_format, "%d.%d.%d.%d"); 4066 AUTO_STRING (ipv4_format, "%d.%d.%d.%d");
4067 host = Fformat (5, ((Lisp_Object []) 4067 host = CALLN (Fformat, ipv4_format,
4068 { ipv4_format, make_number (ip[0]), 4068 make_number (ip[0]), make_number (ip[1]),
4069 make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); 4069 make_number (ip[2]), make_number (ip[3]));
4070 service = make_number (ntohs (saddr.in.sin_port)); 4070 service = make_number (ntohs (saddr.in.sin_port));
4071 AUTO_STRING (caller_format, " <%s:%d>"); 4071 AUTO_STRING (caller_format, " <%s:%d>");
4072 caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); 4072 caller = CALLN (Fformat, caller_format, host, service);
4073 } 4073 }
4074 break; 4074 break;
4075 4075
@@ -4084,10 +4084,10 @@ server_accept_connection (Lisp_Object server, int channel)
4084 args[0] = ipv6_format; 4084 args[0] = ipv6_format;
4085 for (i = 0; i < 8; i++) 4085 for (i = 0; i < 8; i++)
4086 args[i + 1] = make_number (ntohs (ip6[i])); 4086 args[i + 1] = make_number (ntohs (ip6[i]));
4087 host = Fformat (9, args); 4087 host = CALLMANY (Fformat, args);
4088 service = make_number (ntohs (saddr.in.sin_port)); 4088 service = make_number (ntohs (saddr.in.sin_port));
4089 AUTO_STRING (caller_format, " <[%s]:%d>"); 4089 AUTO_STRING (caller_format, " <[%s]:%d>");
4090 caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); 4090 caller = CALLN (Fformat, caller_format, host, service);
4091 } 4091 }
4092 break; 4092 break;
4093#endif 4093#endif
diff --git a/src/sound.c b/src/sound.c
index 6f7e2adecc9..05c7b060104 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -1351,8 +1351,6 @@ Internal use only, use `play-sound' instead. */)
1351{ 1351{
1352 Lisp_Object attrs[SOUND_ATTR_SENTINEL]; 1352 Lisp_Object attrs[SOUND_ATTR_SENTINEL];
1353 ptrdiff_t count = SPECPDL_INDEX (); 1353 ptrdiff_t count = SPECPDL_INDEX ();
1354 Lisp_Object file;
1355 Lisp_Object args[2];
1356 struct gcpro gcpro1, gcpro2; 1354 struct gcpro gcpro1, gcpro2;
1357 1355
1358#ifdef WINDOWSNT 1356#ifdef WINDOWSNT
@@ -1364,9 +1362,10 @@ Internal use only, use `play-sound' instead. */)
1364 if (!parse_sound (sound, attrs)) 1362 if (!parse_sound (sound, attrs))
1365 error ("Invalid sound specification"); 1363 error ("Invalid sound specification");
1366 1364
1367#ifndef WINDOWSNT 1365 Lisp_Object file = Qnil;
1368 file = Qnil;
1369 GCPRO2 (sound, file); 1366 GCPRO2 (sound, file);
1367
1368#ifndef WINDOWSNT
1370 current_sound_device = xzalloc (sizeof *current_sound_device); 1369 current_sound_device = xzalloc (sizeof *current_sound_device);
1371 current_sound = xzalloc (sizeof *current_sound); 1370 current_sound = xzalloc (sizeof *current_sound);
1372 record_unwind_protect_void (sound_cleanup); 1371 record_unwind_protect_void (sound_cleanup);
@@ -1407,9 +1406,7 @@ Internal use only, use `play-sound' instead. */)
1407 else if (FLOATP (attrs[SOUND_VOLUME])) 1406 else if (FLOATP (attrs[SOUND_VOLUME]))
1408 current_sound_device->volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100; 1407 current_sound_device->volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
1409 1408
1410 args[0] = Qplay_sound_functions; 1409 CALLN (Frun_hook_with_args, Qplay_sound_functions, sound);
1411 args[1] = sound;
1412 Frun_hook_with_args (2, args);
1413 1410
1414#ifdef HAVE_ALSA 1411#ifdef HAVE_ALSA
1415 if (!alsa_init (current_sound_device)) 1412 if (!alsa_init (current_sound_device))
@@ -1423,9 +1420,6 @@ Internal use only, use `play-sound' instead. */)
1423 /* Play the sound. */ 1420 /* Play the sound. */
1424 current_sound->play (current_sound, current_sound_device); 1421 current_sound->play (current_sound, current_sound_device);
1425 1422
1426 /* Clean up. */
1427 UNGCPRO;
1428
1429#else /* WINDOWSNT */ 1423#else /* WINDOWSNT */
1430 1424
1431 file = Fexpand_file_name (attrs[SOUND_FILE], Vdata_directory); 1425 file = Fexpand_file_name (attrs[SOUND_FILE], Vdata_directory);
@@ -1439,11 +1433,7 @@ Internal use only, use `play-sound' instead. */)
1439 ui_volume_tmp = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100; 1433 ui_volume_tmp = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
1440 } 1434 }
1441 1435
1442 GCPRO2 (sound, file); 1436 CALLN (Frun_hook_with_args, Qplay_sound_functions, sound);
1443
1444 args[0] = Qplay_sound_functions;
1445 args[1] = sound;
1446 Frun_hook_with_args (2, args);
1447 1437
1448 /* 1438 /*
1449 Based on some experiments I have conducted, a value of 100 or less 1439 Based on some experiments I have conducted, a value of 100 or less
@@ -1460,12 +1450,10 @@ Internal use only, use `play-sound' instead. */)
1460 } 1450 }
1461 (void)do_play_sound (SSDATA (file), ui_volume); 1451 (void)do_play_sound (SSDATA (file), ui_volume);
1462 1452
1463 UNGCPRO;
1464
1465#endif /* WINDOWSNT */ 1453#endif /* WINDOWSNT */
1466 1454
1467 unbind_to (count, Qnil); 1455 UNGCPRO;
1468 return Qnil; 1456 return unbind_to (count, Qnil);
1469} 1457}
1470 1458
1471/*********************************************************************** 1459/***********************************************************************
diff --git a/src/term.c b/src/term.c
index d48bf7b6eaf..15d33b4e3ee 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2253,10 +2253,9 @@ A suspended tty may be resumed by calling `resume-tty' on it. */)
2253 /* First run `suspend-tty-functions' and then clean up the tty 2253 /* First run `suspend-tty-functions' and then clean up the tty
2254 state because `suspend-tty-functions' might need to change 2254 state because `suspend-tty-functions' might need to change
2255 the tty state. */ 2255 the tty state. */
2256 Lisp_Object args[2]; 2256 Lisp_Object term;
2257 args[0] = intern ("suspend-tty-functions"); 2257 XSETTERMINAL (term, t);
2258 XSETTERMINAL (args[1], t); 2258 CALLN (Frun_hook_with_args, intern ("suspend-tty-functions"), term);
2259 Frun_hook_with_args (2, args);
2260 2259
2261 reset_sys_modes (t->display_info.tty); 2260 reset_sys_modes (t->display_info.tty);
2262 delete_keyboard_wait_descriptor (fileno (f)); 2261 delete_keyboard_wait_descriptor (fileno (f));
@@ -2353,13 +2352,10 @@ frame's terminal). */)
2353 set_tty_hooks (t); 2352 set_tty_hooks (t);
2354 init_sys_modes (t->display_info.tty); 2353 init_sys_modes (t->display_info.tty);
2355 2354
2356 { 2355 /* Run `resume-tty-functions'. */
2357 /* Run `resume-tty-functions'. */ 2356 Lisp_Object term;
2358 Lisp_Object args[2]; 2357 XSETTERMINAL (term, t);
2359 args[0] = intern ("resume-tty-functions"); 2358 CALLN (Frun_hook_with_args, intern ("resume-tty-functions"), term);
2360 XSETTERMINAL (args[1], t);
2361 Frun_hook_with_args (2, args);
2362 }
2363 } 2359 }
2364 2360
2365 set_tty_hooks (t); 2361 set_tty_hooks (t);
diff --git a/src/window.c b/src/window.c
index d14a0f74fa0..b4230100150 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2429,16 +2429,14 @@ window_list (void)
2429 Vwindow_list = Qnil; 2429 Vwindow_list = Qnil;
2430 FOR_EACH_FRAME (tail, frame) 2430 FOR_EACH_FRAME (tail, frame)
2431 { 2431 {
2432 Lisp_Object args[2]; 2432 Lisp_Object arglist = Qnil;
2433 2433
2434 /* We are visiting windows in canonical order, and add 2434 /* We are visiting windows in canonical order, and add
2435 new windows at the front of args[1], which means we 2435 new windows at the front of args[1], which means we
2436 have to reverse this list at the end. */ 2436 have to reverse this list at the end. */
2437 args[1] = Qnil; 2437 foreach_window (XFRAME (frame), add_window_to_list, &arglist);
2438 foreach_window (XFRAME (frame), add_window_to_list, &args[1]); 2438 arglist = Fnreverse (arglist);
2439 args[0] = Vwindow_list; 2439 Vwindow_list = CALLN (Fnconc, Vwindow_list, arglist);
2440 args[1] = Fnreverse (args[1]);
2441 Vwindow_list = Fnconc (2, args);
2442 } 2440 }
2443 } 2441 }
2444 2442
diff --git a/src/xdisp.c b/src/xdisp.c
index aec6741dbfc..0ced00f9525 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8338,22 +8338,18 @@ next_element_from_buffer (struct it *it)
8338static void 8338static void
8339run_redisplay_end_trigger_hook (struct it *it) 8339run_redisplay_end_trigger_hook (struct it *it)
8340{ 8340{
8341 Lisp_Object args[3];
8342
8343 /* IT->glyph_row should be non-null, i.e. we should be actually 8341 /* IT->glyph_row should be non-null, i.e. we should be actually
8344 displaying something, or otherwise we should not run the hook. */ 8342 displaying something, or otherwise we should not run the hook. */
8345 eassert (it->glyph_row); 8343 eassert (it->glyph_row);
8346 8344
8347 /* Set up hook arguments. */ 8345 ptrdiff_t charpos = it->redisplay_end_trigger_charpos;
8348 args[0] = Qredisplay_end_trigger_functions;
8349 args[1] = it->window;
8350 XSETINT (args[2], it->redisplay_end_trigger_charpos);
8351 it->redisplay_end_trigger_charpos = 0; 8346 it->redisplay_end_trigger_charpos = 0;
8352 8347
8353 /* Since we are *trying* to run these functions, don't try to run 8348 /* Since we are *trying* to run these functions, don't try to run
8354 them again, even if they get an error. */ 8349 them again, even if they get an error. */
8355 wset_redisplay_end_trigger (it->w, Qnil); 8350 wset_redisplay_end_trigger (it->w, Qnil);
8356 Frun_hook_with_args (3, args); 8351 CALLN (Frun_hook_with_args, Qredisplay_end_trigger_functions, it->window,
8352 make_number (charpos));
8357 8353
8358 /* Notice if it changed the face of the character we are on. */ 8354 /* Notice if it changed the face of the character we are on. */
8359 handle_face_prop (it); 8355 handle_face_prop (it);
@@ -9852,7 +9848,6 @@ include the height of both, if present, in the return value. */)
9852void 9848void
9853add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2) 9849add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2)
9854{ 9850{
9855 Lisp_Object args[3];
9856 Lisp_Object msg, fmt; 9851 Lisp_Object msg, fmt;
9857 char *buffer; 9852 char *buffer;
9858 ptrdiff_t len; 9853 ptrdiff_t len;
@@ -9862,10 +9857,8 @@ add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2)
9862 fmt = msg = Qnil; 9857 fmt = msg = Qnil;
9863 GCPRO4 (fmt, msg, arg1, arg2); 9858 GCPRO4 (fmt, msg, arg1, arg2);
9864 9859
9865 args[0] = fmt = build_string (format); 9860 fmt = build_string (format);
9866 args[1] = arg1; 9861 msg = CALLN (Fformat, fmt, arg1, arg2);
9867 args[2] = arg2;
9868 msg = Fformat (3, args);
9869 9862
9870 len = SBYTES (msg) + 1; 9863 len = SBYTES (msg) + 1;
9871 buffer = SAFE_ALLOCA (len); 9864 buffer = SAFE_ALLOCA (len);
@@ -10280,15 +10273,13 @@ message_with_string (const char *m, Lisp_Object string, int log)
10280 initialized yet, just toss it. */ 10273 initialized yet, just toss it. */
10281 if (f->glyphs_initialized_p) 10274 if (f->glyphs_initialized_p)
10282 { 10275 {
10283 Lisp_Object args[2], msg;
10284 struct gcpro gcpro1, gcpro2; 10276 struct gcpro gcpro1, gcpro2;
10285 10277
10286 args[0] = build_string (m); 10278 Lisp_Object fmt = build_string (m);
10287 args[1] = msg = string; 10279 Lisp_Object msg = string;
10288 GCPRO2 (args[0], msg); 10280 GCPRO2 (fmt, msg);
10289 gcpro1.nvars = 2;
10290 10281
10291 msg = Fformat (2, args); 10282 msg = CALLN (Fformat, fmt, msg);
10292 10283
10293 if (log) 10284 if (log)
10294 message3 (msg); 10285 message3 (msg);
diff --git a/src/xfaces.c b/src/xfaces.c
index 85af770c6a2..1ba6b51a5fb 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1580,43 +1580,38 @@ the WIDTH times as wide as FACE on FRAME. */)
1580 avgwidth *= XINT (width); 1580 avgwidth *= XINT (width);
1581 } 1581 }
1582 1582
1583 { 1583 Lisp_Object font_spec = font_spec_from_name (pattern);
1584 Lisp_Object font_spec; 1584 if (!FONTP (font_spec))
1585 Lisp_Object args[2], tail; 1585 signal_error ("Invalid font name", pattern);
1586
1587 font_spec = font_spec_from_name (pattern);
1588 if (!FONTP (font_spec))
1589 signal_error ("Invalid font name", pattern);
1590 1586
1591 if (size) 1587 if (size)
1592 { 1588 {
1593 Ffont_put (font_spec, QCsize, make_number (size)); 1589 Ffont_put (font_spec, QCsize, make_number (size));
1594 Ffont_put (font_spec, QCavgwidth, make_number (avgwidth)); 1590 Ffont_put (font_spec, QCavgwidth, make_number (avgwidth));
1595 } 1591 }
1596 args[0] = Flist_fonts (font_spec, frame, maximum, font_spec); 1592 Lisp_Object fonts = Flist_fonts (font_spec, frame, maximum, font_spec);
1597 for (tail = args[0]; CONSP (tail); tail = XCDR (tail)) 1593 for (Lisp_Object tail = fonts; CONSP (tail); tail = XCDR (tail))
1598 { 1594 {
1599 Lisp_Object font_entity; 1595 Lisp_Object font_entity;
1600 1596
1601 font_entity = XCAR (tail); 1597 font_entity = XCAR (tail);
1602 if ((NILP (AREF (font_entity, FONT_SIZE_INDEX)) 1598 if ((NILP (AREF (font_entity, FONT_SIZE_INDEX))
1603 || XINT (AREF (font_entity, FONT_SIZE_INDEX)) == 0) 1599 || XINT (AREF (font_entity, FONT_SIZE_INDEX)) == 0)
1604 && ! NILP (AREF (font_spec, FONT_SIZE_INDEX))) 1600 && ! NILP (AREF (font_spec, FONT_SIZE_INDEX)))
1605 { 1601 {
1606 /* This is a scalable font. For backward compatibility, 1602 /* This is a scalable font. For backward compatibility,
1607 we set the specified size. */ 1603 we set the specified size. */
1608 font_entity = copy_font_spec (font_entity); 1604 font_entity = copy_font_spec (font_entity);
1609 ASET (font_entity, FONT_SIZE_INDEX, 1605 ASET (font_entity, FONT_SIZE_INDEX,
1610 AREF (font_spec, FONT_SIZE_INDEX)); 1606 AREF (font_spec, FONT_SIZE_INDEX));
1611 } 1607 }
1612 XSETCAR (tail, Ffont_xlfd_name (font_entity, Qnil)); 1608 XSETCAR (tail, Ffont_xlfd_name (font_entity, Qnil));
1613 } 1609 }
1614 if (NILP (frame)) 1610 if (NILP (frame))
1615 /* We don't have to check fontsets. */ 1611 /* We don't have to check fontsets. */
1616 return args[0]; 1612 return fonts;
1617 args[1] = list_fontsets (f, pattern, size); 1613 Lisp_Object fontsets = list_fontsets (f, pattern, size);
1618 return Fnconc (2, args); 1614 return CALLN (Fnconc, fonts, fontsets);
1619 }
1620} 1615}
1621 1616
1622#endif /* HAVE_WINDOW_SYSTEM */ 1617#endif /* HAVE_WINDOW_SYSTEM */
diff --git a/src/xfont.c b/src/xfont.c
index 55053b9a421..3a0f5e39b4e 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -1106,13 +1106,7 @@ void
1106syms_of_xfont (void) 1106syms_of_xfont (void)
1107{ 1107{
1108 staticpro (&xfont_scripts_cache); 1108 staticpro (&xfont_scripts_cache);
1109 { /* Here we rely on the fact that syms_of_xfont (via syms_of_font) 1109 xfont_scripts_cache = CALLN (Fmake_hash_table, QCtest, Qequal);
1110 is called fairly late, when QCtest and Qequal are known to be set. */
1111 Lisp_Object args[2];
1112 args[0] = QCtest;
1113 args[1] = Qequal;
1114 xfont_scripts_cache = Fmake_hash_table (2, args);
1115 }
1116 staticpro (&xfont_scratch_props); 1110 staticpro (&xfont_scratch_props);
1117 xfont_scratch_props = Fmake_vector (make_number (8), Qnil); 1111 xfont_scratch_props = Fmake_vector (make_number (8), Qnil);
1118 xfont_driver.type = Qx; 1112 xfont_driver.type = Qx;
diff --git a/src/xselect.c b/src/xselect.c
index 33ff366b89c..027192dfea2 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -817,14 +817,8 @@ x_handle_selection_request (struct input_event *event)
817 /* Run the `x-sent-selection-functions' abnormal hook. */ 817 /* Run the `x-sent-selection-functions' abnormal hook. */
818 if (!NILP (Vx_sent_selection_functions) 818 if (!NILP (Vx_sent_selection_functions)
819 && !EQ (Vx_sent_selection_functions, Qunbound)) 819 && !EQ (Vx_sent_selection_functions, Qunbound))
820 { 820 CALLN (Frun_hook_with_args, Qx_sent_selection_functions,
821 Lisp_Object args[4]; 821 selection_symbol, target_symbol, success ? Qt : Qnil);
822 args[0] = Qx_sent_selection_functions;
823 args[1] = selection_symbol;
824 args[2] = target_symbol;
825 args[3] = success ? Qt : Qnil;
826 Frun_hook_with_args (4, args);
827 }
828 822
829 unbind_to (count, Qnil); 823 unbind_to (count, Qnil);
830 UNGCPRO; 824 UNGCPRO;
@@ -937,12 +931,7 @@ x_handle_selection_clear (struct input_event *event)
937 tset_selection_alist (dpyinfo->terminal, Vselection_alist); 931 tset_selection_alist (dpyinfo->terminal, Vselection_alist);
938 932
939 /* Run the `x-lost-selection-functions' abnormal hook. */ 933 /* Run the `x-lost-selection-functions' abnormal hook. */
940 { 934 CALLN (Frun_hook_with_args, Qx_lost_selection_functions, selection_symbol);
941 Lisp_Object args[2];
942 args[0] = Qx_lost_selection_functions;
943 args[1] = selection_symbol;
944 Frun_hook_with_args (2, args);
945 }
946 935
947 redisplay_preserve_echo_area (20); 936 redisplay_preserve_echo_area (20);
948} 937}
@@ -978,10 +967,8 @@ x_clear_frame_selections (struct frame *f)
978 && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist))))))) 967 && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist)))))))
979 { 968 {
980 /* Run the `x-lost-selection-functions' abnormal hook. */ 969 /* Run the `x-lost-selection-functions' abnormal hook. */
981 Lisp_Object args[2]; 970 CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
982 args[0] = Qx_lost_selection_functions; 971 Fcar (Fcar (t->Vselection_alist)));
983 args[1] = Fcar (Fcar (t->Vselection_alist));
984 Frun_hook_with_args (2, args);
985 972
986 tset_selection_alist (t, XCDR (t->Vselection_alist)); 973 tset_selection_alist (t, XCDR (t->Vselection_alist));
987 } 974 }
@@ -991,10 +978,8 @@ x_clear_frame_selections (struct frame *f)
991 if (CONSP (XCDR (rest)) 978 if (CONSP (XCDR (rest))
992 && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest)))))))) 979 && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest))))))))
993 { 980 {
994 Lisp_Object args[2]; 981 CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
995 args[0] = Qx_lost_selection_functions; 982 XCAR (XCAR (XCDR (rest))));
996 args[1] = XCAR (XCAR (XCDR (rest)));
997 Frun_hook_with_args (2, args);
998 XSETCDR (rest, XCDR (XCDR (rest))); 983 XSETCDR (rest, XCDR (XCDR (rest)));
999 break; 984 break;
1000 } 985 }
@@ -2138,7 +2123,7 @@ x_clipboard_manager_error_1 (Lisp_Object err)
2138{ 2123{
2139 AUTO_STRING (format, "X clipboard manager error: %s\n\ 2124 AUTO_STRING (format, "X clipboard manager error: %s\n\
2140If the problem persists, set `x-select-enable-clipboard-manager' to nil."); 2125If the problem persists, set `x-select-enable-clipboard-manager' to nil.");
2141 Fmessage (2, (Lisp_Object []) {format, CAR (CDR (err))}); 2126 CALLN (Fmessage, format, CAR (CDR (err)));
2142 return Qnil; 2127 return Qnil;
2143} 2128}
2144 2129