This makes the code easier to read and the executable a bit smaller.
Do not replace all calls to Fcons that happen to create lists,
just calls that are intended to create lists. For example, when
creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
Similarly for list2 through list5.
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
* bytecode.c (exec_byte_code):
* callint.c (quotify_arg, Fcall_interactively):
* callproc.c (Fcall_process, create_temp_file):
* charset.c (load_charset_map_from_file)
(Fdefine_charset_internal, init_charset):
* coding.c (get_translation_table, detect_coding_system)
(Fcheck_coding_systems_region)
(Fset_terminal_coding_system_internal)
(Fdefine_coding_system_internal, Fdefine_coding_system_alias):
* composite.c (update_compositions, Ffind_composition_internal):
* dired.c (directory_files_internal, file_name_completion)
(Fsystem_users):
* dispnew.c (Fopen_termscript, bitch_at_user, init_display):
* doc.c (Fsnarf_documentation):
* editfns.c (Fmessage_box):
* emacs.c (main):
* eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
(Feval, eval_sub, Ffuncall, apply_lambda):
* fileio.c (make_temp_name, Fcopy_file, Faccess_file)
(Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
(Fset_file_times, Finsert_file_contents)
(Fchoose_write_coding_system, Fwrite_region):
* fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
* font.c (font_registry_charsets, font_parse_fcname)
(font_prepare_cache, font_update_drivers, Flist_fonts):
* fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
* frame.c (make_frame, Fmake_terminal_frame)
(x_set_frame_parameters, x_report_frame_params)
(x_default_parameter, Fx_parse_geometry):
* ftfont.c (syms_of_ftfont):
* image.c (gif_load):
* keyboard.c (command_loop_1):
* keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
(Fcopy_keymap, append_key, Fcurrent_active_maps)
(Fminor_mode_key_binding, accessible_keymaps_1)
(Faccessible_keymaps, Fwhere_is_internal):
* lread.c (read_emacs_mule_char):
* menu.c (find_and_return_menu_selection):
* minibuf.c (get_minibuffer):
* nsfns.m (Fns_perform_service):
* nsfont.m (ns_script_to_charset):
* nsmenu.m (ns_popup_dialog):
* nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
(Fx_own_selection_internal):
* nsterm.m (append2):
* print.c (Fredirect_debugging_output)
(print_prune_string_charset):
* process.c (Fdelete_process, Fprocess_contact)
(Fformat_network_address, set_socket_option)
(read_and_dispose_of_process_output, write_queue_push)
(send_process, exec_sentinel):
* sound.c (Fplay_sound_internal):
* textprop.c (validate_plist, add_properties)
(Fput_text_property, Fadd_face_text_property)
(copy_text_properties, text_property_list, syms_of_textprop):
* unexaix.c (report_error):
* unexcoff.c (report_error):
* unexsol.c (unexec):
* xdisp.c (redisplay_tool_bar, store_mode_line_string)
(Fformat_mode_line, syms_of_xdisp):
* xfaces.c (set_font_frame_param)
(Finternal_lisp_face_attribute_values)
(Finternal_merge_in_global_face, syms_of_xfaces):
* xfns.c (x_default_scroll_bar_color_parameter)
(x_default_font_parameter, x_create_tip_frame):
* xfont.c (xfont_supported_scripts):
* xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
(menu_help_callback, xmenu_show):
* xml.c (make_dom):
* xterm.c (set_wm_state):
Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
and similarly for list2 through list5.
+2013-07-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ Prefer list1 (X) to Fcons (X, Qnil) when building lists.
+ This makes the code easier to read and the executable a bit smaller.
+ Do not replace all calls to Fcons that happen to create lists,
+ just calls that are intended to create lists. For example, when
+ creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
+ rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
+ Similarly for list2 through list5.
+ * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
+ * bytecode.c (exec_byte_code):
+ * callint.c (quotify_arg, Fcall_interactively):
+ * callproc.c (Fcall_process, create_temp_file):
+ * charset.c (load_charset_map_from_file)
+ (Fdefine_charset_internal, init_charset):
+ * coding.c (get_translation_table, detect_coding_system)
+ (Fcheck_coding_systems_region)
+ (Fset_terminal_coding_system_internal)
+ (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
+ * composite.c (update_compositions, Ffind_composition_internal):
+ * dired.c (directory_files_internal, file_name_completion)
+ (Fsystem_users):
+ * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
+ * doc.c (Fsnarf_documentation):
+ * editfns.c (Fmessage_box):
+ * emacs.c (main):
+ * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
+ (Feval, eval_sub, Ffuncall, apply_lambda):
+ * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
+ (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
+ (Fset_file_times, Finsert_file_contents)
+ (Fchoose_write_coding_system, Fwrite_region):
+ * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
+ * font.c (font_registry_charsets, font_parse_fcname)
+ (font_prepare_cache, font_update_drivers, Flist_fonts):
+ * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
+ * frame.c (make_frame, Fmake_terminal_frame)
+ (x_set_frame_parameters, x_report_frame_params)
+ (x_default_parameter, Fx_parse_geometry):
+ * ftfont.c (syms_of_ftfont):
+ * image.c (gif_load):
+ * keyboard.c (command_loop_1):
+ * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
+ (Fcopy_keymap, append_key, Fcurrent_active_maps)
+ (Fminor_mode_key_binding, accessible_keymaps_1)
+ (Faccessible_keymaps, Fwhere_is_internal):
+ * lread.c (read_emacs_mule_char):
+ * menu.c (find_and_return_menu_selection):
+ * minibuf.c (get_minibuffer):
+ * nsfns.m (Fns_perform_service):
+ * nsfont.m (ns_script_to_charset):
+ * nsmenu.m (ns_popup_dialog):
+ * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
+ (Fx_own_selection_internal):
+ * nsterm.m (append2):
+ * print.c (Fredirect_debugging_output)
+ (print_prune_string_charset):
+ * process.c (Fdelete_process, Fprocess_contact)
+ (Fformat_network_address, set_socket_option)
+ (read_and_dispose_of_process_output, write_queue_push)
+ (send_process, exec_sentinel):
+ * sound.c (Fplay_sound_internal):
+ * textprop.c (validate_plist, add_properties)
+ (Fput_text_property, Fadd_face_text_property)
+ (copy_text_properties, text_property_list, syms_of_textprop):
+ * unexaix.c (report_error):
+ * unexcoff.c (report_error):
+ * unexsol.c (unexec):
+ * xdisp.c (redisplay_tool_bar, store_mode_line_string)
+ (Fformat_mode_line, syms_of_xdisp):
+ * xfaces.c (set_font_frame_param)
+ (Finternal_lisp_face_attribute_values)
+ (Finternal_merge_in_global_face, syms_of_xfaces):
+ * xfns.c (x_default_scroll_bar_color_parameter)
+ (x_default_font_parameter, x_create_tip_frame):
+ * xfont.c (xfont_supported_scripts):
+ * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
+ (menu_help_callback, xmenu_show):
+ * xml.c (make_dom):
+ * xterm.c (set_wm_state):
+ Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
+ and similarly for list2 through list5.
+
2013-07-15 Paul Eggert <eggert@cs.ucla.edu>
* callproc.c (Fcall_process_region): Fix minor race and tune.
/* Put this in the alist of all live buffers. */
XSETBUFFER (buffer, b);
- Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buffer), Qnil));
+ Vbuffer_alist = nconc2 (Vbuffer_alist, list1 (Fcons (name, buffer)));
/* And run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
call1 (Vrun_hooks, Qbuffer_list_update_hook);
/* Put this in the alist of all live buffers. */
XSETBUFFER (buf, b);
- Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
+ Vbuffer_alist = nconc2 (Vbuffer_alist, list1 (Fcons (name, buf)));
bset_mark (b, Fmake_marker ());
if (nargs < mandatory)
/* Too few arguments. */
Fsignal (Qwrong_number_of_arguments,
- Fcons (Fcons (make_number (mandatory),
+ list2 (Fcons (make_number (mandatory),
rest ? Qand_rest : make_number (nonrest)),
- Fcons (make_number (nargs), Qnil)));
+ make_number (nargs)));
else
{
for (; i < nonrest; i++)
else
/* Too many arguments. */
Fsignal (Qwrong_number_of_arguments,
- Fcons (Fcons (make_number (mandatory),
- make_number (nonrest)),
- Fcons (make_number (nargs), Qnil)));
+ list2 (Fcons (make_number (mandatory), make_number (nonrest)),
+ make_number (nargs)));
}
else if (! NILP (args_template))
/* We should push some arguments on the stack. */
}
CASE (Blist1):
- TOP = Fcons (TOP, Qnil);
+ TOP = list1 (TOP);
NEXT;
CASE (Blist2):
{
Lisp_Object v1;
v1 = POP;
- TOP = Fcons (TOP, Fcons (v1, Qnil));
+ TOP = list2 (TOP, v1);
NEXT;
}
if (CONSP (exp)
|| (SYMBOLP (exp)
&& !NILP (exp) && !EQ (exp, Qt)))
- return Fcons (Qquote, Fcons (exp, Qnil));
+ return list2 (Qquote, exp);
return exp;
}
for (i = 1; i < nargs; i++)
{
if (varies[i] > 0)
- visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil);
+ visargs[i] = list1 (intern (callint_argfuns[varies[i]]));
else
visargs[i] = quotify_arg (args[i]);
}
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
- Fcons (BVAR (current_buffer, directory), Qnil));
+ list1 (BVAR (current_buffer, directory)));
if (STRING_MULTIBYTE (infile))
infile = ENCODE_FILE (infile);
filefd = emacs_open (SSDATA (infile), O_RDONLY, 0);
if (filefd < 0)
report_file_error ("Opening process input file",
- Fcons (DECODE_FILE (infile), Qnil));
+ list1 (DECODE_FILE (infile)));
if (STRINGP (output_file))
{
int open_errno = errno;
output_file = DECODE_FILE (output_file);
report_file_errno ("Opening process output file",
- Fcons (output_file, Qnil), open_errno);
+ list1 (output_file), open_errno);
}
if (STRINGP (error_file) || NILP (error_file))
output_to_buffer = 0;
int openp_errno = errno;
emacs_close (filefd);
report_file_errno ("Searching for program",
- Fcons (args[0], Qnil), openp_errno);
+ list1 (args[0]), openp_errno);
}
}
int open_errno = errno;
emacs_close (filefd);
report_file_errno ("Opening process output file",
- Fcons (build_string (tempfile), Qnil), open_errno);
+ list1 (build_string (tempfile)), open_errno);
}
}
else
else if (STRINGP (error_file))
error_file = DECODE_FILE (error_file);
report_file_errno ("Cannot redirect stderr",
- Fcons (error_file, Qnil), open_errno);
+ list1 (error_file), open_errno);
}
#ifdef MSDOS /* MW, July 1993 */
unlink (tempfile);
emacs_close (filefd);
report_file_errno ("Cannot re-open temporary file",
- Fcons (build_string (tempfile), Qnil),
- open_errno);
+ list1 (build_string (tempfile)), open_errno);
}
}
else
#endif
if (fd < 0)
report_file_error ("Failed to open temporary file using pattern",
- Fcons (pattern, Qnil));
+ list1 (pattern));
emacs_close (fd);
}
ptrdiff_t count;
USE_SAFE_ALLOCA;
- suffixes = Fcons (build_string (".map"),
- Fcons (build_string (".TXT"), Qnil));
+ suffixes = list2 (build_string (".map"), build_string (".TXT"));
count = SPECPDL_INDEX ();
specbind (Qfile_name_handler_alist, Qnil);
charset.iso_final) = id;
if (new_definition_p)
Viso_2022_charset_list = nconc2 (Viso_2022_charset_list,
- Fcons (make_number (id), Qnil));
+ list1 (make_number (id)));
if (ISO_CHARSET_TABLE (1, 0, 'J') == id)
charset_jisx0201_roman = id;
else if (ISO_CHARSET_TABLE (2, 0, '@') == id)
emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 2;
if (new_definition_p)
Vemacs_mule_charset_list = nconc2 (Vemacs_mule_charset_list,
- Fcons (make_number (id), Qnil));
+ list1 (make_number (id)));
}
if (new_definition_p)
Vcharset_list = Fcons (args[charset_arg_name], Vcharset_list);
if (charset.supplementary_p)
Vcharset_ordered_list = nconc2 (Vcharset_ordered_list,
- Fcons (make_number (id), Qnil));
+ list1 (make_number (id)));
else
{
Lisp_Object tail;
Vcharset_ordered_list);
else if (NILP (tail))
Vcharset_ordered_list = nconc2 (Vcharset_ordered_list,
- Fcons (make_number (id), Qnil));
+ list1 (make_number (id)));
else
{
val = Fcons (XCAR (tail), XCDR (tail));
exit (1);
}
- Vcharset_map_path = Fcons (tempdir, Qnil);
+ Vcharset_map_path = list1 (tempdir);
}
if (CHAR_TABLE_P (standard))
{
if (CONSP (translation_table))
- translation_table = nconc2 (translation_table,
- Fcons (standard, Qnil));
+ translation_table = nconc2 (translation_table, list1 (standard));
else
- translation_table = Fcons (translation_table,
- Fcons (standard, Qnil));
+ translation_table = list2 (translation_table, standard);
}
}
{
detect_info.found = CATEGORY_MASK_RAW_TEXT;
id = CODING_SYSTEM_ID (Qno_conversion);
- val = Fcons (make_number (id), Qnil);
+ val = list1 (make_number (id));
}
else if (! detect_info.rejected && ! detect_info.found)
{
detect_info.found = CATEGORY_MASK_ANY;
id = coding_categories[coding_category_undecided].id;
- val = Fcons (make_number (id), Qnil);
+ val = list1 (make_number (id));
}
else if (highest)
{
if (detect_info.found)
{
detect_info.found = 1 << category;
- val = Fcons (make_number (this->id), Qnil);
+ val = list1 (make_number (this->id));
}
else
for (i = 0; i < coding_category_raw_text; i++)
{
detect_info.found = 1 << coding_priorities[i];
id = coding_categories[coding_priorities[i]].id;
- val = Fcons (make_number (id), Qnil);
+ val = list1 (make_number (id));
break;
}
}
found |= 1 << category;
id = coding_categories[category].id;
if (id >= 0)
- val = Fcons (make_number (id), val);
+ val = list1 (make_number (id));
}
}
for (i = coding_category_raw_text - 1; i >= 0; i--)
this = coding_categories + coding_category_utf_8_sig;
else
this = coding_categories + coding_category_utf_8_nosig;
- val = Fcons (make_number (this->id), Qnil);
+ val = list1 (make_number (this->id));
}
}
else if (base_category == coding_category_utf_16_auto)
this = coding_categories + coding_category_utf_16_be_nosig;
else
this = coding_categories + coding_category_utf_16_le_nosig;
- val = Fcons (make_number (this->id), Qnil);
+ val = list1 (make_number (this->id));
}
}
else
{
detect_info.found = 1 << XINT (CODING_ATTR_CATEGORY (attrs));
- val = Fcons (make_number (coding.id), Qnil);
+ val = list1 (make_number (coding.id));
}
/* Then, detect eol-format if necessary. */
attrs = AREF (CODING_SYSTEM_SPEC (elt), 0);
ASET (attrs, coding_attr_trans_tbl,
get_translation_table (attrs, 1, NULL));
- list = Fcons (Fcons (elt, Fcons (attrs, Qnil)), list);
+ list = Fcons (list2 (elt, attrs), list);
}
if (STRINGP (start))
tset_charset_list
(term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK
? coding_charset_list (terminal_coding)
- : Fcons (make_number (charset_ascii), Qnil)));
+ : list1 (make_number (charset_ascii))));
return Qnil;
}
{
dim2 = CHARSET_DIMENSION (CHARSET_FROM_ID (XFASTINT (tmp)));
if (dim < dim2)
- tmp = Fcons (XCAR (tail), Fcons (tmp, Qnil));
+ tmp = list2 (XCAR (tail), tmp);
else
- tmp = Fcons (tmp, Fcons (XCAR (tail), Qnil));
+ tmp = list2 (tmp, XCAR (tail));
}
else
{
break;
}
if (NILP (tmp2))
- tmp = nconc2 (tmp, Fcons (XCAR (tail), Qnil));
+ tmp = nconc2 (tmp, list1 (XCAR (tail)));
else
{
XSETCDR (tmp2, Fcons (XCAR (tmp2), XCDR (tmp2)));
&& ! EQ (eol_type, Qmac))
error ("Invalid eol-type");
- aliases = Fcons (name, Qnil);
+ aliases = list1 (name);
if (NILP (eol_type))
{
Lisp_Object this_spec, this_name, this_aliases, this_eol_type;
this_name = AREF (eol_type, i);
- this_aliases = Fcons (this_name, Qnil);
+ this_aliases = list1 (this_name);
this_eol_type = (i == 0 ? Qunix : i == 1 ? Qdos : Qmac);
this_spec = make_uninit_vector (3);
ASET (this_spec, 0, attrs);
list. */
while (!NILP (XCDR (aliases)))
aliases = XCDR (aliases);
- XSETCDR (aliases, Fcons (alias, Qnil));
+ XSETCDR (aliases, list1 (alias));
eol_type = AREF (spec, 2);
if (VECTORP (eol_type))
specbind (Qinhibit_point_motion_hooks, Qt);
Fremove_list_of_text_properties (make_number (min_pos),
make_number (max_pos),
- Fcons (Qauto_composed, Qnil), Qnil);
+ list1 (Qauto_composed), Qnil);
unbind_to (count, Qnil);
}
}
return list3 (make_number (s), make_number (e), gstring);
}
if (!COMPOSITION_VALID_P (start, end, prop))
- return Fcons (make_number (start), Fcons (make_number (end),
- Fcons (Qnil, Qnil)));
+ return list3 (make_number (start), make_number (end), Qnil);
if (NILP (detail_p))
- return Fcons (make_number (start), Fcons (make_number (end),
- Fcons (Qt, Qnil)));
+ return list3 (make_number (start), make_number (end), Qt);
if (COMPOSITION_REGISTERD_P (prop))
id = COMPOSITION_ID (prop);
relative_p = (method == COMPOSITION_WITH_RULE_ALTCHARS
? Qnil : Qt);
mod_func = COMPOSITION_MODIFICATION_FUNC (prop);
- tail = Fcons (components,
- Fcons (relative_p,
- Fcons (mod_func,
- Fcons (make_number (width), Qnil))));
+ tail = list4 (components, relative_p, mod_func, make_number (width));
}
else
tail = Qnil;
d = open_directory (SSDATA (dirfilename), &fd);
if (d == NULL)
- report_file_error ("Opening directory", Fcons (directory, Qnil));
+ report_file_error ("Opening directory", list1 (directory));
/* Unfortunately, we can now invoke expand-file-name and
file-attributes on filenames, both of which can throw, so we must
d = open_directory (SSDATA (encoded_dir), &fd);
if (!d)
- report_file_error ("Opening directory", Fcons (dirname, Qnil));
+ report_file_error ("Opening directory", list1 (dirname));
record_unwind_protect (directory_files_internal_unwind,
make_save_pointer (d));
#endif
if (EQ (users, Qnil))
/* At least current user is always known. */
- users = Fcons (Vuser_real_login_name, Qnil);
+ users = list1 (Vuser_real_login_name);
return users;
}
file = Fexpand_file_name (file, Qnil);
tty->termscript = emacs_fopen (SSDATA (file), "w");
if (tty->termscript == 0)
- report_file_error ("Opening termscript", Fcons (file, Qnil));
+ report_file_error ("Opening termscript", list1 (file));
}
return Qnil;
}
{
const char *msg
= "Keyboard macro terminated by a command ringing the bell";
- Fsignal (Quser_error, Fcons (build_string (msg), Qnil));
+ Fsignal (Quser_error, list1 (build_string (msg)));
}
else
ring_bell (XFRAME (selected_frame));
/* Update frame parameters to reflect the new type. */
Fmodify_frame_parameters
- (selected_frame, Fcons (Fcons (Qtty_type,
- Ftty_type (selected_frame)), Qnil));
+ (selected_frame, list1 (Fcons (Qtty_type,
+ Ftty_type (selected_frame))));
if (t->display_info.tty->name)
- Fmodify_frame_parameters (selected_frame,
- Fcons (Fcons (Qtty, build_string (t->display_info.tty->name)),
- Qnil));
+ Fmodify_frame_parameters
+ (selected_frame,
+ list1 (Fcons (Qtty, build_string (t->display_info.tty->name))));
else
- Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil),
- Qnil));
+ Fmodify_frame_parameters (selected_frame, list1 (Fcons (Qtty, Qnil)));
}
{
fd = emacs_open (name, O_RDONLY, 0);
if (fd < 0)
- report_file_error ("Opening doc string file",
- Fcons (build_string (name), Qnil));
+ report_file_error ("Opening doc string file", list1 (build_string (name)));
Vdoc_file_name = filename;
filled = 0;
pos = 0;
{
Lisp_Object pane, menu;
struct gcpro gcpro1;
- pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil);
+ pane = list1 (Fcons (build_string ("OK"), Qt));
GCPRO1 (pane);
menu = Fcons (val, pane);
Fx_popup_dialog (Qt, menu, Qt);
char *file;
/* Handle -l loadup, args passed by Makefile. */
if (argmatch (argv, argc, "-l", "--load", 3, &file, &skip_args))
- Vtop_level = Fcons (intern_c_string ("load"),
- Fcons (build_string (file), Qnil));
+ Vtop_level = list2 (intern_c_string ("load"), build_string (file));
/* Unless next switch is -nl, load "loadup.el" first thing. */
if (! no_loadup)
- Vtop_level = Fcons (intern_c_string ("load"),
- Fcons (build_string ("loadup.el"), Qnil));
+ Vtop_level = list2 (intern_c_string ("load"),
+ build_string ("loadup.el"));
}
if (initialized)
{
debug_on_next_call = 0;
set_backtrace_debug_on_exit (specpdl_ptr - 1, true);
- call_debugger (Fcons (code, Qnil));
+ call_debugger (list1 (code));
}
\f
/* NOTE!!! Every function that can call EVAL must protect its args
}
if (!NILP (hare))
- arg = Fcons (arg, Qnil); /* Make it a list. */
+ arg = list1 (arg);
xsignal (Qerror, Fcons (build_string (s), arg));
}
/* RMS: What's this for? */
&& when_entered_debugger < num_nonmacro_input_events)
{
- call_debugger (Fcons (Qerror, Fcons (combined_data, Qnil)));
+ call_debugger (list2 (Qerror, combined_data));
return 1;
}
{
ptrdiff_t count = SPECPDL_INDEX ();
specbind (Qinternal_interpreter_environment,
- CONSP (lexical) || NILP (lexical) ? lexical : Fcons (Qt, Qnil));
+ CONSP (lexical) || NILP (lexical) ? lexical : list1 (Qt));
return unbind_to (count, eval_sub (form));
}
lisp_eval_depth--;
if (backtrace_debug_on_exit (specpdl_ptr - 1))
- val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
+ val = call_debugger (list2 (Qexit, val));
specpdl_ptr--;
return val;
check_cons_list ();
lisp_eval_depth--;
if (backtrace_debug_on_exit (specpdl_ptr - 1))
- val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
+ val = call_debugger (list2 (Qexit, val));
specpdl_ptr--;
return val;
}
{
/* Don't do it again when we return to eval. */
set_backtrace_debug_on_exit (specpdl_ptr - 1, false);
- tem = call_debugger (Fcons (Qexit, Fcons (tem, Qnil)));
+ tem = call_debugger (list2 (Qexit, tem));
}
SAFE_FREE ();
return tem;
dog-slow, but also useless since eventually nil would
have to be returned anyway. */
report_file_error ("Cannot create temporary name for prefix",
- Fcons (prefix, Qnil));
+ list1 (prefix));
/* not reached */
}
}
{
acl = acl_get_file (SDATA (encoded_file), ACL_TYPE_ACCESS);
if (acl == NULL && acl_errno_valid (errno))
- report_file_error ("Getting ACL", Fcons (file, Qnil));
+ report_file_error ("Getting ACL", list1 (file));
}
if (!CopyFile (SDATA (encoded_file),
SDATA (encoded_newname),
{
/* CopyFile doesn't set errno when it fails. By far the most
"popular" reason is that the target is read-only. */
- report_file_errno ("Copying file", Fcons (file, Fcons (newname, Qnil)),
+ report_file_errno ("Copying file", list2 (file, newname),
GetLastError () == 5 ? EACCES : EPERM);
}
/* CopyFile retains the timestamp by default. */
bool fail =
acl_set_file (SDATA (encoded_newname), ACL_TYPE_ACCESS, acl) != 0;
if (fail && acl_errno_valid (errno))
- report_file_error ("Setting ACL", Fcons (newname, Qnil));
+ report_file_error ("Setting ACL", list1 (newname));
acl_free (acl);
}
immediate_quit = 0;
if (ifd < 0)
- report_file_error ("Opening input file", Fcons (file, Qnil));
+ report_file_error ("Opening input file", list1 (file));
record_unwind_protect (close_file_unwind, make_number (ifd));
if (fstat (ifd, &st) != 0)
- report_file_error ("Input file status", Fcons (file, Qnil));
+ report_file_error ("Input file status", list1 (file));
if (!NILP (preserve_extended_attributes))
{
{
conlength = fgetfilecon (ifd, &con);
if (conlength == -1)
- report_file_error ("Doing fgetfilecon", Fcons (file, Qnil));
+ report_file_error ("Doing fgetfilecon", list1 (file));
}
#endif
}
if (out_st.st_mode != 0
&& st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
report_file_errno ("Input and output files are the same",
- Fcons (file, Fcons (newname, Qnil)), 0);
+ list2 (file, newname), 0);
/* We can copy only regular files. */
if (!S_ISREG (st.st_mode))
- report_file_errno ("Non-regular file", Fcons (file, Qnil),
+ report_file_errno ("Non-regular file", list1 (file),
S_ISDIR (st.st_mode) ? EISDIR : EINVAL);
{
new_mask);
}
if (ofd < 0)
- report_file_error ("Opening output file", Fcons (newname, Qnil));
+ report_file_error ("Opening output file", list1 (newname));
record_unwind_protect (close_file_unwind, make_number (ofd));
QUIT;
while ((n = emacs_read (ifd, buf, sizeof buf)) > 0)
if (emacs_write_sig (ofd, buf, n) != n)
- report_file_error ("I/O error", Fcons (newname, Qnil));
+ report_file_error ("I/O error", list1 (newname));
immediate_quit = 0;
#ifndef MSDOS
bool fail = fsetfilecon (ofd, con) != 0;
/* See http://debbugs.gnu.org/11245 for ENOTSUP. */
if (fail && errno != ENOTSUP)
- report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil));
+ report_file_error ("Doing fsetfilecon", list1 (newname));
freecon (con);
}
}
if (emacs_close (ofd) < 0)
- report_file_error ("I/O error", Fcons (newname, Qnil));
+ report_file_error ("I/O error", list1 (newname));
emacs_close (ifd);
encoded_filename = ENCODE_FILE (absname);
if (faccessat (AT_FDCWD, SSDATA (encoded_filename), R_OK, AT_EACCESS) != 0)
- report_file_error (SSDATA (string), Fcons (filename, Qnil));
+ report_file_error (SSDATA (string), list1 (filename));
return Qnil;
}
!= 0);
/* See http://debbugs.gnu.org/11245 for ENOTSUP. */
if (fail && errno != ENOTSUP)
- report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
+ report_file_error ("Doing lsetfilecon", list1 (absname));
context_free (parsed_con);
freecon (con);
return fail ? Qnil : Qt;
}
else
- report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil));
+ report_file_error ("Doing lgetfilecon", list1 (absname));
}
#endif
acl = acl_from_text (SSDATA (acl_string));
if (acl == NULL)
{
- report_file_error ("Converting ACL", Fcons (absname, Qnil));
+ report_file_error ("Converting ACL", list1 (absname));
return Qnil;
}
acl)
!= 0);
if (fail && acl_errno_valid (errno))
- report_file_error ("Setting ACL", Fcons (absname, Qnil));
+ report_file_error ("Setting ACL", list1 (absname));
acl_free (acl);
return fail ? Qnil : Qt;
encoded_absname = ENCODE_FILE (absname);
if (chmod (SSDATA (encoded_absname), XINT (mode) & 07777) < 0)
- report_file_error ("Doing chmod", Fcons (absname, Qnil));
+ report_file_error ("Doing chmod", list1 (absname));
return Qnil;
}
if (file_directory_p (SSDATA (encoded_absname)))
return Qnil;
#endif
- report_file_error ("Setting file times", Fcons (absname, Qnil));
+ report_file_error ("Setting file times", list1 (absname));
}
}
{
save_errno = errno;
if (NILP (visit))
- report_file_error ("Opening input file", Fcons (orig_filename, Qnil));
+ report_file_error ("Opening input file", list1 (orig_filename));
mtime = time_error_value (save_errno);
st.st_size = -1;
if (!NILP (Vcoding_system_for_read))
record_unwind_protect (close_file_unwind, make_number (fd));
if (fstat (fd, &st) != 0)
- report_file_error ("Input file status", Fcons (orig_filename, Qnil));
+ report_file_error ("Input file status", list1 (orig_filename));
mtime = get_stat_mtime (&st);
/* This code will need to be changed in order to work on named
int ntail;
if (lseek (fd, - (1024 * 3), SEEK_END) < 0)
report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
+ list1 (orig_filename));
ntail = emacs_read (fd, read_buf + nread, 1024 * 3);
nread = ntail < 0 ? ntail : nread + ntail;
}
/* Rewind the file for the actual read done later. */
if (lseek (fd, 0, SEEK_SET) < 0)
report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
+ list1 (orig_filename));
}
}
{
if (lseek (fd, beg_offset, SEEK_SET) < 0)
report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
+ list1 (orig_filename));
}
immediate_quit = 1;
trial = min (curpos, sizeof read_buf);
if (lseek (fd, curpos - trial, SEEK_SET) < 0)
report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
+ list1 (orig_filename));
total_read = nread = 0;
while (total_read < trial)
if (lseek (fd, beg_offset, SEEK_SET) < 0)
report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
+ list1 (orig_filename));
inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */
unprocessed = 0; /* Bytes not processed in previous loop. */
{
if (lseek (fd, beg_offset, SEEK_SET) < 0)
report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
+ list1 (orig_filename));
}
/* In the following loop, HOW_MUCH contains the total bytes read so
&& EMACS_NSECS (current_buffer->modtime) == NONEXISTENT_MODTIME_NSECS)
{
/* If visiting nonexistent file, return nil. */
- report_file_errno ("Opening input file", Fcons (orig_filename, Qnil),
+ report_file_errno ("Opening input file", list1 (orig_filename),
save_errno);
}
&& !NILP (Ffboundp (Vselect_safe_coding_system_function)))
/* Confirm that VAL can surely encode the current region. */
val = call5 (Vselect_safe_coding_system_function,
- start, end, Fcons (Qt, Fcons (val, Qnil)),
+ start, end, list2 (Qt, val),
Qnil, filename);
}
else
record_unwind_protect (build_annotations_unwind,
Vwrite_region_annotation_buffers);
- Vwrite_region_annotation_buffers = Fcons (Fcurrent_buffer (), Qnil);
+ Vwrite_region_annotation_buffers = list1 (Fcurrent_buffer ());
count1 = SPECPDL_INDEX ();
given_buffer = current_buffer;
if (!auto_saving) unlock_file (lockname);
#endif /* CLASH_DETECTION */
UNGCPRO;
- report_file_errno ("Opening output file", Fcons (filename, Qnil),
+ report_file_errno ("Opening output file", list1 (filename),
open_errno);
}
if (!auto_saving) unlock_file (lockname);
#endif /* CLASH_DETECTION */
UNGCPRO;
- report_file_errno ("Lseek error", Fcons (filename, Qnil),
+ report_file_errno ("Lseek error", list1 (filename),
lseek_errno);
}
}
prev = tail;
QUIT;
}
- newcell = Fcons (prop, Fcons (val, Qnil));
+ newcell = list2 (prop, val);
if (NILP (prev))
return newcell;
else
{
Lisp_Object pane, menu, obj;
redisplay_preserve_echo_area (4);
- pane = Fcons (Fcons (build_string ("Yes"), Qt),
- Fcons (Fcons (build_string ("No"), Qnil),
- Qnil));
+ pane = list2 (Fcons (build_string ("Yes"), Qt),
+ Fcons (build_string ("No"), Qnil));
GCPRO1 (pane);
menu = Fcons (prompt, pane);
obj = Fx_popup_dialog (Qt, menu, Qnil);
DEFVAR_LISP ("features", Vfeatures,
doc: /* A list of symbols which are the features of the executing Emacs.
Used by `featurep' and `require', and altered by `provide'. */);
- Vfeatures = Fcons (intern_c_string ("emacs"), Qnil);
+ Vfeatures = list1 (intern_c_string ("emacs"));
DEFSYM (Qsubfeatures, "subfeatures");
DEFSYM (Qfuncall, "funcall");
goto invalid_entry;
val = Fcons (make_number (encoding_id), make_number (repertory_id));
font_charset_alist
- = nconc2 (font_charset_alist, Fcons (Fcons (registry, val), Qnil));
+ = nconc2 (font_charset_alist, list1 (Fcons (registry, val)));
}
if (encoding)
invalid_entry:
font_charset_alist
- = nconc2 (font_charset_alist, Fcons (Fcons (registry, Qnil), Qnil));
+ = nconc2 (font_charset_alist, list1 (Fcons (registry, Qnil)));
return -1;
}
else
{
extra_props = nconc2 (extra_props,
- Fcons (Fcons (key, val), Qnil));
+ list1 (Fcons (key, val)));
}
}
p = q;
val = XCDR (val);
if (NILP (val))
{
- val = Fcons (driver->type, Fcons (make_number (1), Qnil));
+ val = list2 (driver->type, make_number (1));
XSETCDR (cache, Fcons (val, XCDR (cache)));
}
else
for (list = f->font_driver_list; list; list = list->next)
if (list->on)
- active_drivers = nconc2 (active_drivers,
- Fcons (list->driver->type, Qnil));
+ active_drivers = nconc2 (active_drivers, list1 (list->driver->type));
return active_drivers;
}
return Qnil;
if (NILP (XCDR (list))
&& ASIZE (XCAR (list)) == 1)
- return Fcons (AREF (XCAR (list), 0), Qnil);
+ return list1 (AREF (XCAR (list), 0));
if (! NILP (prefer))
vec = font_sort_entities (list, prefer, frame, 0);
{
if (XFASTINT (target) < 0x80)
error ("Can't set a font for partial ASCII range");
- range_list = Fcons (Fcons (target, target), Qnil);
+ range_list = list1 (Fcons (target, target));
}
else if (CONSP (target))
{
error ("Can't set a font for partial ASCII range");
ascii_changed = 1;
}
- range_list = Fcons (target, Qnil);
+ range_list = list1 (target);
}
else if (SYMBOLP (target) && !NILP (target))
{
{
if (EQ (target, Qlatin))
ascii_changed = 1;
- val = Fcons (target, Qnil);
+ val = list1 (target);
map_char_table (accumulate_script_ranges, Qnil, Vchar_script_table,
val);
range_list = Fnreverse (XCDR (val));
SDATA (SYMBOL_NAME (target)));
}
else if (NILP (target))
- range_list = Fcons (Qnil, Qnil);
+ range_list = list1 (Qnil);
else
error ("Invalid target for setting a font");
if (! NILP (font_object))
{
update_auto_fontset_alist (font_object, fontset);
- alist = Fcons (Fcons (Qfont, Fcons (name, font_object)), Qnil);
+ alist = list1 (Fcons (Qfont, Fcons (name, font_object)));
Fmodify_frame_parameters (fr, alist);
}
}
slot = Fassq (RFONT_DEF_SPEC (elt), alist);
name = AREF (font_object, FONT_NAME_INDEX);
if (NILP (Fmember (name, XCDR (slot))))
- nconc2 (slot, Fcons (name, Qnil));
+ nconc2 (slot, list1 (name));
}
}
}
DEFVAR_LISP ("fontset-alias-alist", Vfontset_alias_alist,
doc: /* Alist of fontset names vs the aliases. */);
- Vfontset_alias_alist = Fcons (Fcons (FONTSET_NAME (Vdefault_fontset),
- build_pure_c_string ("fontset-default")),
- Qnil);
+ Vfontset_alias_alist
+ = list1 (Fcons (FONTSET_NAME (Vdefault_fontset),
+ build_pure_c_string ("fontset-default")));
DEFVAR_LISP ("vertical-centering-font-regexp",
Vvertical_centering_font_regexp,
etc. Running Lisp functions at this point surely ends in a
SEGV. */
set_window_buffer (root_window, buf, 0, 0);
- fset_buffer_list (f, Fcons (buf, Qnil));
+ fset_buffer_list (f, list1 (buf));
}
if (mini_p)
calculate_costs (f);
XSETFRAME (frame, f);
Fmodify_frame_parameters (frame, parms);
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
- build_string (t->display_info.tty->type)),
- Qnil));
+ Fmodify_frame_parameters
+ (frame, list1 (Fcons (Qtty_type,
+ build_string (t->display_info.tty->type))));
if (t->display_info.tty->name != NULL)
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty,
- build_string (t->display_info.tty->name)),
- Qnil));
+ Fmodify_frame_parameters
+ (frame, list1 (Fcons (Qtty,
+ build_string (t->display_info.tty->name))));
else
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil));
+ Fmodify_frame_parameters (frame, list1 (Fcons (Qtty, Qnil)));
/* Make the frame face alist be frame-specific, so that each
frame could change its face definitions independently. */
{
left_no_change = 1;
if (f->left_pos < 0)
- left = Fcons (Qplus, Fcons (make_number (f->left_pos), Qnil));
+ left = list2 (Qplus, make_number (f->left_pos));
else
XSETINT (left, f->left_pos);
}
{
top_no_change = 1;
if (f->top_pos < 0)
- top = Fcons (Qplus, Fcons (make_number (f->top_pos), Qnil));
+ top = list2 (Qplus, make_number (f->top_pos));
else
XSETINT (top, f->top_pos);
}
if (f->left_pos >= 0)
store_in_alist (alistptr, Qleft, tem);
else
- store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil)));
+ store_in_alist (alistptr, Qleft, list2 (Qplus, tem));
XSETINT (tem, f->top_pos);
if (f->top_pos >= 0)
store_in_alist (alistptr, Qtop, tem);
else
- store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil)));
+ store_in_alist (alistptr, Qtop, list2 (Qplus, tem));
store_in_alist (alistptr, Qborder_width,
make_number (f->border_width));
tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type);
if (EQ (tem, Qunbound))
tem = deflt;
- x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil));
+ x_set_frame_parameters (f, list1 (Fcons (prop, tem)));
return tem;
}
Lisp_Object element;
if (x >= 0 && (geometry & XNegative))
- element = Fcons (Qleft, Fcons (Qminus, Fcons (make_number (-x), Qnil)));
+ element = list3 (Qleft, Qminus, make_number (-x));
else if (x < 0 && ! (geometry & XNegative))
- element = Fcons (Qleft, Fcons (Qplus, Fcons (make_number (x), Qnil)));
+ element = list3 (Qleft, Qplus, make_number (x));
else
element = Fcons (Qleft, make_number (x));
result = Fcons (element, result);
Lisp_Object element;
if (y >= 0 && (geometry & YNegative))
- element = Fcons (Qtop, Fcons (Qminus, Fcons (make_number (-y), Qnil)));
+ element = list3 (Qtop, Qminus, make_number (-y));
else if (y < 0 && ! (geometry & YNegative))
- element = Fcons (Qtop, Fcons (Qplus, Fcons (make_number (y), Qnil)));
+ element = list3 (Qtop, Qplus, make_number (y));
else
element = Fcons (Qtop, make_number (y));
result = Fcons (element, result);
DEFSYM (Qsans__serif, "sans serif");
staticpro (&freetype_font_cache);
- freetype_font_cache = Fcons (Qt, Qnil);
+ freetype_font_cache = list1 (Qt);
staticpro (&ftfont_generic_family_list);
- ftfont_generic_family_list
- = Fcons (Fcons (Qmonospace, Qt),
- Fcons (Fcons (Qsans_serif, Qt),
- Fcons (Fcons (Qsans, Qt), Qnil)));
+ ftfont_generic_family_list = list3 (Fcons (Qmonospace, Qt),
+ Fcons (Qsans_serif, Qt),
+ Fcons (Qsans, Qt));
staticpro (&ft_face_cache);
ft_face_cache = Qnil;
delay |= ext->Bytes[1];
}
}
- img->lisp_data = Fcons (Qextension_data,
- Fcons (img->lisp_data, Qnil));
+ img->lisp_data = list2 (Qextension_data, img->lisp_data);
if (delay)
img->lisp_data
= Fcons (Qdelay,
if (!NILP (Vquit_flag))
{
Vquit_flag = Qnil;
- Vunread_command_events = Fcons (make_number (quit_char), Qnil);
+ Vunread_command_events = list1 (make_number (quit_char));
}
}
emacs_abort ();
}
if (!CONSP (last))
- kset_kbd_queue (kb, Fcons (c, Qnil));
+ kset_kbd_queue (kb, list1 (c));
else
- XSETCDR (last, Fcons (c, Qnil));
+ XSETCDR (last, list1 (c));
kb->kbd_queue_has_data = 1;
c = Qnil;
if (single_kboard)
emacs_abort ();
}
if (!CONSP (last))
- kset_kbd_queue (kb, Fcons (c, Qnil));
+ kset_kbd_queue (kb, list1 (c));
else
- XSETCDR (last, Fcons (c, Qnil));
+ XSETCDR (last, list1 (c));
kb->kbd_queue_has_data = 1;
current_kboard = kb;
/* This is going to exit from read_char
if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar))
{
/* Change menu-bar to (menu-bar) as the event "position". */
- POSN_SET_POSN (EVENT_START (c), Fcons (posn, Qnil));
+ POSN_SET_POSN (EVENT_START (c), list1 (posn));
also_record = c;
Vunread_command_events = Fcons (c, Vunread_command_events);
if (single_kboard && kb != current_kboard)
{
kset_kbd_queue
- (kb, Fcons (make_lispy_switch_frame (event->frame_or_window),
- Fcons (make_number (c), Qnil)));
+ (kb, list2 (make_lispy_switch_frame (event->frame_or_window),
+ make_number (c)));
kb->kbd_queue_has_data = 1;
for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
{
else if (event->kind == NS_TEXT_EVENT)
{
if (event->code == KEY_NS_PUT_WORKING_TEXT)
- obj = Fcons (intern ("ns-put-working-text"), Qnil);
+ obj = list1 (intern ("ns-put-working-text"));
else
- obj = Fcons (intern ("ns-unput-working-text"), Qnil);
+ obj = list1 (intern ("ns-unput-working-text"));
kbd_fetch_ptr = event + 1;
if (used_mouse_menu)
*used_mouse_menu = 1;
else if (event->kind == DELETE_WINDOW_EVENT)
{
/* Make an event (delete-frame (FRAME)). */
- obj = Fcons (event->frame_or_window, Qnil);
- obj = Fcons (Qdelete_frame, Fcons (obj, Qnil));
+ obj = list2 (Qdelete_frame, list1 (event->frame_or_window));
kbd_fetch_ptr = event + 1;
}
#endif
else if (event->kind == ICONIFY_EVENT)
{
/* Make an event (iconify-frame (FRAME)). */
- obj = Fcons (event->frame_or_window, Qnil);
- obj = Fcons (Qiconify_frame, Fcons (obj, Qnil));
+ obj = list2 (Qiconify_frame, list1 (event->frame_or_window));
kbd_fetch_ptr = event + 1;
}
else if (event->kind == DEICONIFY_EVENT)
{
/* Make an event (make-frame-visible (FRAME)). */
- obj = Fcons (event->frame_or_window, Qnil);
- obj = Fcons (Qmake_frame_visible, Fcons (obj, Qnil));
+ obj = list2 (Qmake_frame_visible, list1 (event->frame_or_window));
kbd_fetch_ptr = event + 1;
}
#endif
#ifdef HAVE_NTGUI
else if (event->kind == LANGUAGE_CHANGE_EVENT)
{
- /* Make an event (language-change (FRAME CODEPAGE LANGUAGE-ID)). */
- obj = Fcons (Qlanguage_change,
- list3 (event->frame_or_window,
- make_number (event->code),
- make_number (event->modifiers)));
+ /* Make an event (language-change FRAME CODEPAGE LANGUAGE-ID). */
+ obj = list4 (Qlanguage_change,
+ event->frame_or_window,
+ make_number (event->code),
+ make_number (event->modifiers));
kbd_fetch_ptr = event + 1;
}
#endif
{
#ifdef HAVE_W32NOTIFY
/* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */
- obj = Fcons (Qfile_notify,
- list2 (list3 (make_number (event->code),
- XCAR (event->arg),
- XCDR (event->arg)),
- event->frame_or_window));
+ obj = list3 (Qfile_notify,
+ list3 (make_number (event->code),
+ XCAR (event->arg),
+ XCDR (event->arg)),
+ event->frame_or_window);
#else
obj = make_lispy_event (event);
#endif
#endif /* USE_FILE_NOTIFY */
else if (event->kind == SAVE_SESSION_EVENT)
{
- obj = Fcons (Qsave_session, Fcons (event->arg, Qnil));
+ obj = list2 (Qsave_session, event->arg);
kbd_fetch_ptr = event + 1;
}
/* Just discard these, by returning nil.
/* ELisp manual 2.4b says (x y) are window relative but
code says they are frame-relative. */
- position
- = Fcons (event->frame_or_window,
- Fcons (Qmenu_bar,
- Fcons (Fcons (event->x, event->y),
- Fcons (make_number (event->timestamp),
- Qnil))));
-
- return Fcons (item, Fcons (position, Qnil));
+ position = list4 (event->frame_or_window,
+ Qmenu_bar,
+ Fcons (event->x, event->y),
+ make_number (event->timestamp));
+
+ return list2 (item, position);
}
#endif /* not USE_X_TOOLKIT && not USE_GTK && not HAVE_NS */
portion_whole = Fcons (event->x, event->y);
part = *scroll_bar_parts[(int) event->part];
- position
- = Fcons (window,
- Fcons (Qvertical_scroll_bar,
- Fcons (portion_whole,
- Fcons (make_number (event->timestamp),
- Fcons (part, Qnil)))));
+ position = list5 (window, Qvertical_scroll_bar,
+ portion_whole, make_number (event->timestamp),
+ part);
}
#endif /* not USE_TOOLKIT_SCROLL_BARS */
&mouse_syms,
ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
- return Fcons (head,
- Fcons (start_pos,
- Fcons (position,
- Qnil)));
+ return list3 (head, start_pos, position);
else if (event->modifiers & (double_modifier | triple_modifier))
- return Fcons (head,
- Fcons (position,
- Fcons (make_number (double_click_count),
- Qnil)));
+ return list3 (head, position, make_number (double_click_count));
else
- return Fcons (head,
- Fcons (position,
- Qnil));
+ return list2 (head, position);
}
}
}
if (event->modifiers & (double_modifier | triple_modifier))
- return Fcons (head,
- Fcons (position,
- Fcons (make_number (double_click_count),
- Qnil)));
+ return list3 (head, position, make_number (double_click_count));
else
- return Fcons (head,
- Fcons (position,
- Qnil));
+ return list2 (head, position);
}
portion_whole = Fcons (event->x, event->y);
part = *scroll_bar_parts[(int) event->part];
- position
- = Fcons (window,
- Fcons (Qvertical_scroll_bar,
- Fcons (portion_whole,
- Fcons (make_number (event->timestamp),
- Fcons (part, Qnil)))));
+ position = list5 (window, Qvertical_scroll_bar, portion_whole,
+ make_number (event->timestamp), part);
/* Always treat scroll bar events as clicks. */
event->modifiers |= click_modifier;
Vlispy_mouse_stem,
NULL, &mouse_syms,
ASIZE (mouse_syms));
- return Fcons (head, Fcons (position, Qnil));
+ return list2 (head, position);
}
#endif /* USE_TOOLKIT_SCROLL_BARS */
Qdrag_n_drop, Qnil,
lispy_drag_n_drop_names,
&drag_n_drop_syms, 1);
- return Fcons (head,
- Fcons (position,
- Fcons (files,
- Qnil)));
+ return list3 (head, position, files);
}
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
/* This is the prefix key. We translate this to
`(menu_bar)' because the code in keyboard.c for menu
events, which we use, relies on this. */
- return Fcons (Qmenu_bar, Qnil);
+ return list1 (Qmenu_bar);
return event->arg;
#endif
case SELECT_WINDOW_EVENT:
/* Make an event (select-window (WINDOW)). */
- return Fcons (Qselect_window,
- Fcons (Fcons (event->frame_or_window, Qnil),
- Qnil));
+ return list2 (Qselect_window, list1 (event->frame_or_window));
case TOOL_BAR_EVENT:
if (EQ (event->arg, event->frame_or_window))
/* This is the prefix key. We translate this to
`(tool_bar)' because the code in keyboard.c for tool bar
events, which we use, relies on this. */
- return Fcons (Qtool_bar, Qnil);
+ return list1 (Qtool_bar);
else if (SYMBOLP (event->arg))
return apply_modifiers (event->modifiers, event->arg);
return event->arg;
#endif /* defined HAVE_GFILENOTIFY || defined HAVE_INOTIFY */
case CONFIG_CHANGED_EVENT:
- return Fcons (Qconfig_changed_event,
- Fcons (event->arg,
- Fcons (event->frame_or_window, Qnil)));
+ return list3 (Qconfig_changed_event,
+ event->arg, event->frame_or_window);
#ifdef HAVE_GPM
case GPM_CLICK_EVENT:
{
ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
- return Fcons (head,
- Fcons (start_pos,
- Fcons (position,
- Qnil)));
+ return list3 (head, start_pos, position);
else if (event->modifiers & double_modifier)
- return Fcons (head,
- Fcons (position,
- Fcons (make_number (2),
- Qnil)));
+ return list3 (head, position, make_number (2));
else if (event->modifiers & triple_modifier)
- return Fcons (head,
- Fcons (position,
- Fcons (make_number (3),
- Qnil)));
+ return list3 (head, position, make_number (3));
else
- return Fcons (head,
- Fcons (position,
- Qnil));
+ return list2 (head, position);
}
#endif /* HAVE_GPM */
Lisp_Object part_sym;
part_sym = *scroll_bar_parts[(int) part];
- return Fcons (Qscroll_bar_movement,
- Fcons (list5 (bar_window,
- Qvertical_scroll_bar,
- Fcons (x, y),
- make_number (t),
- part_sym),
- Qnil));
+ return list2 (Qscroll_bar_movement,
+ list5 (bar_window,
+ Qvertical_scroll_bar,
+ Fcons (x, y),
+ make_number (t),
+ part_sym));
}
/* Or is it an ordinary mouse movement? */
else
static Lisp_Object
make_lispy_switch_frame (Lisp_Object frame)
{
- return Fcons (Qswitch_frame, Fcons (frame, Qnil));
+ return list2 (Qswitch_frame, frame);
}
\f
/* Manipulating modifiers. */
if (modifiers & ~INTMASK)
emacs_abort ();
XSETFASTINT (mask, modifiers);
- elements = Fcons (unmodified, Fcons (mask, Qnil));
+ elements = list2 (unmodified, mask);
/* Cache the parsing results on SYMBOL. */
Fput (symbol, Qevent_symbol_element_mask,
the caches:
XSETFASTINT (idx, modifiers);
Fput (new_symbol, Qevent_symbol_element_mask,
- Fcons (base, Fcons (idx, Qnil)));
+ list2 (base, idx));
Fput (new_symbol, Qevent_symbol_elements,
Fcons (base, lispy_modifier_list (modifiers)));
Sadly, this is only correct if `base' is indeed a base event,
ASET (menu_bar_items_vector, i, key); i++;
ASET (menu_bar_items_vector, i,
AREF (item_properties, ITEM_PROPERTY_NAME)); i++;
- ASET (menu_bar_items_vector, i, Fcons (item, Qnil)); i++;
+ ASET (menu_bar_items_vector, i, list1 (item)); i++;
ASET (menu_bar_items_vector, i, make_number (0)); i++;
menu_bar_items_index = i;
}
/* As an exception, allow old-style menu separators. */
if (STRINGP (XCAR (item)))
- item = Fcons (XCAR (item), Qnil);
+ item = list1 (XCAR (item));
else if (!EQ (XCAR (item), Qmenu_item)
|| (item = XCDR (item), !CONSP (item)))
return 0;
/* Zap the position in key, so we know that we've
expanded it, and don't try to do so again. */
- POSN_SET_POSN (EVENT_START (key),
- Fcons (posn, Qnil));
+ POSN_SET_POSN (EVENT_START (key), list1 (posn));
mock_input = t + 2;
goto replay_sequence;
new_head
= apply_modifiers (modifiers, XCAR (breakdown));
- new_click
- = Fcons (new_head, Fcons (EVENT_START (key), Qnil));
+ new_click = list2 (new_head, EVENT_START (key));
/* Look for a binding for this new key. */
new_binding = follow_key (current_binding, new_click);
file = Fexpand_file_name (file, Qnil);
dribble = emacs_fopen (SSDATA (file), "w");
if (dribble == 0)
- report_file_error ("Opening dribble", Fcons (file, Qnil));
+ report_file_error ("Opening dribble", list1 (file));
}
return Qnil;
}
*p->var = intern_c_string (p->name);
staticpro (p->var);
Fput (*p->var, Qevent_kind, *p->kind);
- Fput (*p->var, Qevent_symbol_elements, Fcons (*p->var, Qnil));
+ Fput (*p->var, Qevent_symbol_elements, list1 (*p->var));
}
}
DEFVAR_LISP ("special-event-map", Vspecial_event_map,
doc: /* Keymap defining bindings for special events to execute at low level. */);
- Vspecial_event_map = Fcons (intern_c_string ("keymap"), Qnil);
+ Vspecial_event_map = list1 (intern_c_string ("keymap"));
DEFVAR_LISP ("track-mouse", do_mouse_tracking,
doc: /* Non-nil means generate motion events for mouse motion. */);
{
Lisp_Object tail;
if (!NILP (string))
- tail = Fcons (string, Qnil);
+ tail = list1 (string);
else
tail = Qnil;
return Fcons (Qkeymap,
{
if (!NILP (Vpurify_flag))
string = Fpurecopy (string);
- return Fcons (Qkeymap, Fcons (string, Qnil));
+ return list2 (Qkeymap, string);
}
- return Fcons (Qkeymap, Qnil);
+ return list1 (Qkeymap);
}
/* This function is used for installing the standard key bindings
retval = val;
else if (CONSP (retval_tail))
{
- XSETCDR (retval_tail, Fcons (val, Qnil));
+ XSETCDR (retval_tail, list1 (val));
retval_tail = XCDR (retval_tail);
}
else
{
- retval_tail = Fcons (val, Qnil);
+ retval_tail = list1 (val);
retval = Fcons (Qkeymap, Fcons (retval, retval_tail));
}
}
is not copied. */)
(Lisp_Object keymap)
{
- register Lisp_Object copy, tail;
+ Lisp_Object copy, tail;
keymap = get_keymap (keymap, 1, 0);
- copy = tail = Fcons (Qkeymap, Qnil);
+ copy = tail = list1 (Qkeymap);
keymap = XCDR (keymap); /* Skip the `keymap' symbol. */
while (CONSP (keymap) && !EQ (XCAR (keymap), Qkeymap))
else
elt = Fcons (XCAR (elt), copy_keymap_item (XCDR (elt)));
}
- XSETCDR (tail, Fcons (elt, Qnil));
+ XSETCDR (tail, list1 (elt));
tail = XCDR (tail);
keymap = XCDR (keymap);
}
Lisp_Object args[2];
args[0] = key_sequence;
-
- args[1] = Fcons (key, Qnil);
+ args[1] = list1 (key);
return Fvconcat (2, args);
}
{
ptrdiff_t count = SPECPDL_INDEX ();
- Lisp_Object keymaps = Fcons (current_global_map, Qnil);
+ Lisp_Object keymaps = list1 (current_global_map);
/* If a mouse click position is given, our variables are based on
the buffer clicked on, not the current buffer. So we may have to
if (KEYMAPP (binding))
maps[j++] = Fcons (modes[i], binding);
else if (j == 0)
- RETURN_UNGCPRO (Fcons (Fcons (modes[i], binding), Qnil));
+ RETURN_UNGCPRO (list1 (Fcons (modes[i], binding)));
}
UNGCPRO;
else
{
tem = append_key (thisseq, key);
- nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil));
+ nconc2 (tail, list1 (Fcons (tem, cmd)));
}
}
}
prefix = copy;
}
- maps = Fcons (Fcons (prefix, tem), Qnil);
+ maps = list1 (Fcons (prefix, tem));
}
else
return Qnil;
}
else
- maps = Fcons (Fcons (zero_vector, get_keymap (keymap, 1, 0)), Qnil);
+ maps = list1 (Fcons (zero_vector, get_keymap (keymap, 1, 0)));
/* For each map in the list maps,
look at any other maps it points to,
if (CONSP (keymap) && KEYMAPP (XCAR (keymap)))
keymaps = keymap;
else if (!NILP (keymap))
- keymaps = Fcons (keymap, Fcons (current_global_map, Qnil));
+ keymaps = list2 (keymap, current_global_map);
else
keymaps = Fcurrent_active_maps (Qnil, Qnil);
c = DECODE_CHAR (charset, code);
if (c < 0)
Fsignal (Qinvalid_read_syntax,
- Fcons (build_string ("invalid multibyte form"), Qnil));
+ list1 (build_string ("invalid multibyte form")));
return c;
}
{
if (error_nonascii)
{
- Vunread_command_events = Fcons (val, Qnil);
+ Vunread_command_events = list1 (val);
error ("Non-character input-event");
}
else
fn = alloca (fn_size = 100 + want_length);
/* Loop over suffixes. */
- for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : suffixes;
+ for (tail = NILP (suffixes) ? list1 (empty_unibyte_string) : suffixes;
CONSP (tail); tail = XCDR (tail))
{
ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail));
lexical environment, otherwise, turn off lexical binding. */
lex_bound = find_symbol_value (Qlexical_binding);
specbind (Qinternal_interpreter_environment,
- NILP (lex_bound) || EQ (lex_bound, Qunbound)
- ? Qnil : Fcons (Qt, Qnil));
+ (NILP (lex_bound) || EQ (lex_bound, Qunbound)
+ ? Qnil : list1 (Qt)));
GCPRO4 (sourcename, readfun, start, end);
if (c == '$')
return Vload_file_name;
if (c == '\'')
- return Fcons (Qfunction, Fcons (read0 (readcharfun), Qnil));
+ return list2 (Qfunction, read0 (readcharfun));
/* #:foo is the uninterned symbol named foo. */
if (c == ':')
{
goto retry;
case '\'':
- {
- return Fcons (Qquote, Fcons (read0 (readcharfun), Qnil));
- }
+ return list2 (Qquote, read0 (readcharfun));
case '`':
{
value = read0 (readcharfun);
new_backquote_flag = saved_new_backquote_flag;
- return Fcons (Qbackquote, Fcons (value, Qnil));
+ return list2 (Qbackquote, value);
}
}
case ',':
}
value = read0 (readcharfun);
- return Fcons (comma_type, Fcons (value, Qnil));
+ return list2 (comma_type, value);
}
else
{
}
invalid_syntax ("] in a list");
}
- tem = Fcons (elt, Qnil);
+ tem = list1 (elt);
if (!NILP (tail))
XSETCDR (tail, tem);
else
points to the eventual installed lisp, leim
directories. We should not use those now, even
if they exist, so start over from a clean slate. */
- Vload_path = Fcons (tem, Qnil);
+ Vload_path = list1 (tem);
}
}
else
This list should not include the empty string.
`load' and related functions try to append these suffixes, in order,
to the specified file name if a Lisp suffix is allowed or required. */);
- Vload_suffixes = Fcons (build_pure_c_string (".elc"),
- Fcons (build_pure_c_string (".el"), Qnil));
+ Vload_suffixes = list2 (build_pure_c_string (".elc"),
+ build_pure_c_string (".el"));
DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes,
doc: /* List of suffixes that indicate representations of \
the same file.
in order to do so. However, if you want to customize which suffixes
the loading functions recognize as compression suffixes, you should
customize `jka-compr-load-suffixes' rather than the present variable. */);
- Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil);
+ Vload_file_rep_suffixes = list1 (empty_unibyte_string);
DEFVAR_BOOL ("load-in-progress", load_in_progress,
doc: /* Non-nil if inside of `load'. */);
{
int j;
- entry = Fcons (entry, Qnil);
+ entry = list1 (entry);
if (!NILP (prefix))
entry = Fcons (prefix, entry);
for (j = submenu_depth - 1; j >= 0; j--)
tail = Fnthcdr (num, Vminibuffer_list);
if (NILP (tail))
{
- tail = Fcons (Qnil, Qnil);
+ tail = list1 (Qnil);
Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
}
buf = Fcar (tail);
else if (EQ (flag, Qlambda))
return Ftest_completion (string, Vbuffer_alist, predicate);
else if (EQ (flag, Qmetadata))
- return Fcons (Qmetadata, Fcons (Fcons (Qcategory, Qbuffer), Qnil));
+ return list2 (Qmetadata, Fcons (Qcategory, Qbuffer));
else
return Qnil;
}
properties. */);
/* We use `intern' here instead of Qread_only to avoid
initialization-order problems. */
- Vminibuffer_prompt_properties
- = Fcons (intern_c_string ("read-only"), Fcons (Qt, Qnil));
+ Vminibuffer_prompt_properties = list2 (intern_c_string ("read-only"), Qt);
defsubr (&Sactive_minibuffer_window);
defsubr (&Sset_minibuffer_window);
ns_string_to_pasteboard (pb, send);
if (NSPerformService (svcName, pb) == NO)
- Fsignal (Qquit, Fcons (build_string ("service not available"), Qnil));
+ Fsignal (Qquit, list1 (build_string ("service not available")));
if ([[pb types] count] == 0)
return build_string ("");
When you miniaturize a Group, Summary or Article frame, Gnus.tiff will
be used as the image of the icon representing the frame. */);
- Vns_icon_type_alist = Fcons (Qt, Qnil);
+ Vns_icon_type_alist = list1 (Qt);
DEFVAR_LISP ("ns-version-string", Vns_version_string,
doc: /* Toolkit version for NS Windowing. */);
{
Lisp_Object ranges, range_list;
- ranges = Fcons (script, Qnil);
+ ranges = list1 (script);
map_char_table (accumulate_script_ranges, Qnil, Vchar_script_table,
ranges);
range_list = Fnreverse (XCDR (ranges));
if (NILP (Fcar (Fcdr (contents))))
/* No buttons specified, add an "Ok" button so users can pop down
the dialog. */
- contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil));
+ contents = list2 (title, Fcons (build_string ("Ok"), Qt));
block_input ();
pool = [[NSAutoreleasePool alloc] init];
return value;
// FIXME: Why `quit' rather than `error'?
- Fsignal (Qquit, Fcons (build_string (
- "invalid data returned by selection-conversion function"),
- Fcons (handler_fn, Fcons (value, Qnil))));
+ Fsignal (Qquit,
+ list3 (build_string ("invalid data returned by"
+ " selection-conversion function"),
+ handler_fn, value));
// FIXME: Beware, `quit' can return!!
return Qnil;
}
if (type == nil)
{
Fsignal (Qquit,
- Fcons (build_string ("empty or unsupported pasteboard type"),
- Qnil));
+ list1 (build_string ("empty or unsupported pasteboard type")));
return Qnil;
}
else
{
Fsignal (Qquit,
- Fcons (build_string ("pasteboard doesn't contain valid data"),
- Qnil));
+ list1 (build_string ("pasteboard doesn't contain"
+ " valid data")));
return Qnil;
}
}
ns_declare_pasteboard (pb);
old_value = assq_no_quit (selection, Vselection_alist);
- new_value = Fcons (selection, Fcons (value, Qnil));
+ new_value = list2 (selection, value);
if (NILP (old_value))
Vselection_alist = Fcons (new_value, Vselection_alist);
{
Lisp_Object array[2];
array[0] = list;
- array[1] = Fcons (item, Qnil);
+ array[1] = list1 (item);
return Fnconc (2, &array[0]);
}
stderr = initial_stderr_stream;
initial_stderr_stream = NULL;
report_file_error ("Cannot open debugging output stream",
- Fcons (file, Qnil));
+ list1 (file));
}
}
return Qnil;
if (print_check_string_result & PRINT_STRING_NON_CHARSET_FOUND)
{
if (NILP (print_prune_charset_plist))
- print_prune_charset_plist = Fcons (Qcharset, Qnil);
+ print_prune_charset_plist = list1 (Qcharset);
Fremove_text_properties (make_number (0),
make_number (SCHARS (string)),
print_prune_charset_plist, string);
p->raw_status_new = 0;
if (NETCONN1_P (p) || SERIALCONN1_P (p))
{
- pset_status (p, Fcons (Qexit, Fcons (make_number (0), Qnil)));
+ pset_status (p, list2 (Qexit, make_number (0)));
p->tick = ++process_tick;
status_notify (p);
redisplay_preserve_echo_area (13);
if ((!NETCONN_P (process) && !SERIALCONN_P (process)) || EQ (key, Qt))
return contact;
if (NILP (key) && NETCONN_P (process))
- return Fcons (Fplist_get (contact, QChost),
- Fcons (Fplist_get (contact, QCservice), Qnil));
+ return list2 (Fplist_get (contact, QChost),
+ Fplist_get (contact, QCservice));
if (NILP (key) && SERIALCONN_P (process))
- return Fcons (Fplist_get (contact, QCport),
- Fcons (Fplist_get (contact, QCspeed), Qnil));
+ return list2 (Fplist_get (contact, QCport),
+ Fplist_get (contact, QCspeed));
return Fplist_get (contact, key);
}
current_dir = expand_and_dir_to_file (current_dir, Qnil);
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
- Fcons (BVAR (current_buffer, directory), Qnil));
+ list1 (BVAR (current_buffer, directory)));
UNGCPRO;
}
openp (Vexec_path, program, Vexec_suffixes, &tem, make_number (X_OK));
UNGCPRO;
if (NILP (tem))
- report_file_error ("Searching for program", Fcons (program, Qnil));
+ report_file_error ("Searching for program", list1 (program));
tem = Fexpand_file_name (tem, Qnil);
}
else
/* Encode the file name and put it in NEW_ARGV.
That's where the child will use it to execute the program. */
- tem = Fcons (ENCODE_FILE (tem), Qnil);
+ tem = list1 (ENCODE_FILE (tem));
/* Here we encode arguments by the coding system used for sending
data to the process. We don't support using different coding
}
if (ret < 0)
- report_file_error ("Cannot set network option",
- Fcons (opt, Fcons (val, Qnil)));
+ report_file_error ("Cannot set network option", list2 (opt, val));
return (1 << sopt->optbit);
}
sometimes it's simply wrong to wrap (e.g. when called from
accept-process-output). */
internal_condition_case_1 (read_process_output_call,
- Fcons (outstream,
- Fcons (make_lisp_proc (p),
- Fcons (text, Qnil))),
+ list3 (outstream, make_lisp_proc (p), text),
!NILP (Vdebug_on_error) ? Qnil : Qerror,
read_process_output_error_handler);
if (front)
pset_write_queue (p, Fcons (entry, p->write_queue));
else
- pset_write_queue (p, nconc2 (p->write_queue, Fcons (entry, Qnil)));
+ pset_write_queue (p, nconc2 (p->write_queue, list1 (entry)));
}
/* Remove the first element in the write_queue of process P, put its
if (rv >= 0)
written = rv;
else if (errno == EMSGSIZE)
- report_file_error ("sending datagram", Fcons (proc, Qnil));
+ report_file_error ("sending datagram", list1 (proc));
}
else
#endif
}
else
/* This is a real error. */
- report_file_error ("writing to process", Fcons (proc, Qnil));
+ report_file_error ("writing to process", list1 (proc));
}
cur_buf += written;
cur_len -= written;
running_asynch_code = 1;
internal_condition_case_1 (read_process_output_call,
- Fcons (sentinel,
- Fcons (proc, Fcons (reason, Qnil))),
+ list3 (sentinel, proc, reason),
!NILP (Vdebug_on_error) ? Qnil : Qerror,
exec_sentinel_error_handler);
if (STRINGP (attrs[SOUND_FILE]))
{
/* Open the sound file. */
- current_sound->fd = openp (Fcons (Vdata_directory, Qnil),
+ current_sound->fd = openp (list1 (Vdata_directory),
attrs[SOUND_FILE], Qnil, &file, Qnil);
if (current_sound->fd < 0)
sound_perror ("Could not open sound file");
return list;
}
- return Fcons (list, Fcons (Qnil, Qnil));
+ return list2 (list, Qnil);
}
/* Return true if interval I has all the properties,
if (set_type == TEXT_PROPERTY_PREPEND)
Fsetcar (this_cdr, Fcons (val1, Fcar (this_cdr)));
else
- nconc2 (Fcar (this_cdr), Fcons (val1, Qnil));
+ nconc2 (Fcar (this_cdr), list1 (val1));
else {
/* The previous value is a single value, so make it
into a list. */
if (set_type == TEXT_PROPERTY_PREPEND)
- Fsetcar (this_cdr,
- Fcons (val1, Fcons (Fcar (this_cdr), Qnil)));
+ Fsetcar (this_cdr, list2 (val1, Fcar (this_cdr)));
else
- Fsetcar (this_cdr,
- Fcons (Fcar (this_cdr), Fcons (val1, Qnil)));
+ Fsetcar (this_cdr, list2 (Fcar (this_cdr), val1));
}
}
changed = 1;
markers). If OBJECT is a string, START and END are 0-based indices into it. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
{
- Fadd_text_properties (start, end,
- Fcons (property, Fcons (value, Qnil)),
- object);
+ Fadd_text_properties (start, end, list2 (property, value), object);
return Qnil;
}
(Lisp_Object start, Lisp_Object end, Lisp_Object face,
Lisp_Object appendp, Lisp_Object object)
{
- add_text_properties_1 (start, end,
- Fcons (Qface, Fcons (face, Qnil)),
- object,
- NILP (appendp)? TEXT_PROPERTY_PREPEND:
- TEXT_PROPERTY_APPEND);
+ add_text_properties_1 (start, end, list2 (Qface, face), object,
+ (NILP (appendp)
+ ? TEXT_PROPERTY_PREPEND
+ : TEXT_PROPERTY_APPEND));
return Qnil;
}
{
if (EQ (Fcar (plist), prop))
{
- plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil));
+ plist = list2 (prop, Fcar (Fcdr (plist)));
break;
}
plist = Fcdr (Fcdr (plist));
{
/* Must defer modifications to the interval tree in case src
and dest refer to the same string or buffer. */
- stuff = Fcons (Fcons (make_number (p),
- Fcons (make_number (p + len),
- Fcons (plist, Qnil))),
- stuff);
+ stuff = Fcons (list3 (make_number (p), make_number (p + len), plist),
+ stuff);
}
i = next_interval (i);
for (; CONSP (plist); plist = Fcdr (XCDR (plist)))
if (EQ (XCAR (plist), prop))
{
- plist = Fcons (prop, Fcons (Fcar (XCDR (plist)), Qnil));
+ plist = list2 (prop, Fcar (XCDR (plist)));
break;
}
if (!NILP (plist))
- result = Fcons (Fcons (make_number (s),
- Fcons (make_number (s + len),
- Fcons (plist, Qnil))),
+ result = Fcons (list3 (make_number (s), make_number (s + len),
+ plist),
result);
i = next_interval (i);
/* Text properties `syntax-table'and `display' should be nonsticky
by default. */
Vtext_property_default_nonsticky
- = Fcons (Fcons (intern_c_string ("syntax-table"), Qt),
- Fcons (Fcons (intern_c_string ("display"), Qt), Qnil));
+ = list2 (Fcons (intern_c_string ("syntax-table"), Qt),
+ Fcons (intern_c_string ("display"), Qt));
staticpro (&interval_insert_behind_hooks);
staticpro (&interval_insert_in_front_hooks);
int err = errno;
if (fd)
emacs_close (fd);
- report_file_errno ("Cannot unexec", Fcons (build_string (file), Qnil), err);
+ report_file_errno ("Cannot unexec", list1 (build_string (file)), err);
}
#define ERROR0(msg) report_error_1 (new, msg)
int err = errno;
if (fd)
emacs_close (fd);
- report_file_errno ("Cannot unexec", Fcons (build_string (file), Qnil), err);
+ report_file_errno ("Cannot unexec", list1 (build_string (file)), err);
}
#define ERROR0(msg) report_error_1 (new, msg, 0, 0); return -1
if (! dldump (0, new_name, RTLD_MEMORY))
return;
- data = Fcons (build_string (new_name), Qnil);
+ data = list1 (build_string (new_name));
synchronize_system_messages_locale ();
errstring = code_convert_string_norecord (build_string (dlerror ()),
Vlocale_coding_system, 0);
XSETFRAME (frame, f);
Fmodify_frame_parameters (frame,
- Fcons (Fcons (Qtool_bar_lines,
- make_number (nlines)),
- Qnil));
+ list1 (Fcons (Qtool_bar_lines,
+ make_number (nlines))));
if (WINDOW_TOTAL_LINES (w) != old_height)
{
clear_glyph_matrix (w->desired_matrix);
{
XSETFRAME (frame, f);
Fmodify_frame_parameters (frame,
- Fcons (Fcons (Qtool_bar_lines,
- make_number (nlines)),
- Qnil));
+ list1 (Fcons (Qtool_bar_lines,
+ make_number (nlines))));
if (WINDOW_TOTAL_LINES (w) != old_height)
{
clear_glyph_matrix (w->desired_matrix);
if (NILP (face))
face = mode_line_string_face;
else
- face = Fcons (face, Fcons (mode_line_string_face, Qnil));
+ face = list2 (face, mode_line_string_face);
props = Fplist_put (props, Qface, face);
}
Fadd_text_properties (make_number (0), make_number (len),
if (NILP (face))
face = mode_line_string_face;
else
- face = Fcons (face, Fcons (mode_line_string_face, Qnil));
- props = Fcons (Qface, Fcons (face, Qnil));
+ face = list2 (face, mode_line_string_face);
+ props = list2 (Qface, face);
if (copy_string)
lisp_string = Fcopy_sequence (lisp_string);
}
mode_line_string_list = Qnil;
mode_line_string_face = face;
mode_line_string_face_prop
- = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil)));
+ = NILP (face) ? Qnil : list2 (Qface, face);
}
push_kboard (FRAME_KBOARD (it.f));
DEFSYM (Qarrow, "arrow");
DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
- list_of_error = Fcons (Fcons (intern_c_string ("error"),
- Fcons (intern_c_string ("void-variable"), Qnil)),
- Qnil);
+ list_of_error = list1 (list2 (intern_c_string ("error"),
+ intern_c_string ("void-variable")));
staticpro (&list_of_error);
DEFSYM (Qlast_arrow_position, "last-arrow-position");
The symbols on this list are examined during redisplay to determine
where to display overlay arrows. */);
Voverlay_arrow_variable_list
- = Fcons (intern_c_string ("overlay-arrow-position"), Qnil);
+ = list1 (intern_c_string ("overlay-arrow-position"));
DEFVAR_INT ("scroll-step", emacs_scroll_step,
doc: /* The number of lines to try scrolling a window by when point moves out.
ASET (lface, LFACE_FONT_INDEX, font);
}
f->default_face_done_p = 0;
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
+ Fmodify_frame_parameters (frame, list1 (Fcons (Qfont, font)));
}
}
CHECK_SYMBOL (attr);
- if (EQ (attr, QCunderline))
- result = Fcons (Qt, Fcons (Qnil, Qnil));
- else if (EQ (attr, QCoverline))
- result = Fcons (Qt, Fcons (Qnil, Qnil));
- else if (EQ (attr, QCstrike_through))
- result = Fcons (Qt, Fcons (Qnil, Qnil));
- else if (EQ (attr, QCinverse_video) || EQ (attr, QCreverse_video))
- result = Fcons (Qt, Fcons (Qnil, Qnil));
+ if (EQ (attr, QCunderline) || EQ (attr, QCoverline)
+ || EQ (attr, QCstrike_through)
+ || EQ (attr, QCinverse_video) || EQ (attr, QCreverse_video))
+ result = list2 (Qt, Qnil);
return result;
}
&& newface->font)
{
Lisp_Object name = newface->font->props[FONT_NAME_INDEX];
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, name),
- Qnil));
+ Fmodify_frame_parameters (frame, list1 (Fcons (Qfont, name)));
}
if (STRINGP (gvec[LFACE_FOREGROUND_INDEX]))
Fmodify_frame_parameters (frame,
- Fcons (Fcons (Qforeground_color,
- gvec[LFACE_FOREGROUND_INDEX]),
- Qnil));
+ list1 (Fcons (Qforeground_color,
+ gvec[LFACE_FOREGROUND_INDEX])));
if (STRINGP (gvec[LFACE_BACKGROUND_INDEX]))
Fmodify_frame_parameters (frame,
- Fcons (Fcons (Qbackground_color,
- gvec[LFACE_BACKGROUND_INDEX]),
- Qnil));
+ list1 (Fcons (Qbackground_color,
+ gvec[LFACE_BACKGROUND_INDEX])));
}
}
DEFSYM (Qtty_color_alist, "tty-color-alist");
DEFSYM (Qscalable_fonts_allowed, "scalable-fonts-allowed");
- Vparam_value_alist = Fcons (Fcons (Qnil, Qnil), Qnil);
+ Vparam_value_alist = list1 (Fcons (Qnil, Qnil));
staticpro (&Vparam_value_alist);
Vface_alternative_font_family_alist = Qnil;
staticpro (&Vface_alternative_font_family_alist);
#endif /* not USE_TOOLKIT_SCROLL_BARS */
}
- x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil));
+ x_set_frame_parameters (f, list1 (Fcons (prop, tem)));
return tem;
}
{
/* Remember the explicit font parameter, so we can re-apply it after
we've applied the `default' face settings. */
- x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font_param), Qnil));
+ x_set_frame_parameters (f, list1 (Fcons (Qfont_param, font_param)));
}
/* This call will make X resources override any system font setting. */
/* Add `tooltip' frame parameter's default value. */
if (NILP (Fframe_parameter (frame, Qtooltip)))
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
+ Fmodify_frame_parameters (frame, list1 (Fcons (Qtooltip, Qt)));
/* FIXME - can this be done in a similar way to normal frames?
http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
disptype = intern ("color");
if (NILP (Fframe_parameter (frame, Qdisplay_type)))
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qdisplay_type, disptype),
- Qnil));
+ Fmodify_frame_parameters (frame, list1 (Fcons (Qdisplay_type, disptype)));
}
/* Set up faces after all frame parameters are known. This call
call2 (Qface_set_after_frame_default, frame, Qnil);
if (!EQ (bg, Fframe_parameter (frame, Qbackground_color)))
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qbackground_color, bg),
- Qnil));
+ Fmodify_frame_parameters (frame, list1 (Fcons (Qbackground_color, bg)));
}
f->no_split = 1;
/* Two special cases to avoid opening rather big fonts. */
if (EQ (AREF (props, 2), Qja))
- return Fcons (intern ("kana"), Fcons (intern ("han"), Qnil));
+ return list2 (intern ("kana"), intern ("han"));
if (EQ (AREF (props, 2), Qko))
- return Fcons (intern ("hangul"), Qnil);
+ return list1 (intern ("hangul"));
scripts = Fgethash (props, xfont_scripts_cache, Qt);
if (EQ (scripts, Qt))
{
XSETFRAME (frame, f);
XSETINT (x, x_pixel_width (f) / 2);
XSETINT (y, x_pixel_height (f) / 2);
- newpos = Fcons (Fcons (x, Fcons (y, Qnil)), Fcons (frame, Qnil));
+ newpos = list2 (list2 (x, y), frame);
return Fx_popup_menu (newpos,
- Fcons (Fcar (contents), Fcons (contents, Qnil)));
+ list2 (Fcar (contents), contents));
}
#else
{
/* No buttons specified, add an "Ok" button so users can pop down
the dialog. Also, the lesstif/motif version crashes if there are
no buttons. */
- contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil));
+ contents = list2 (title, Fcons (build_string ("Ok"), Qt));
- list_of_panes (Fcons (contents, Qnil));
+ list_of_panes (list1 (contents));
/* Display them in a dialog box. */
block_input ();
{
int j;
- entry = Fcons (entry, Qnil);
+ entry = list1 (entry);
if (!NILP (prefix))
entry = Fcons (prefix, entry);
for (j = submenu_depth - 1; j >= 0; j--)
{
if (keymaps != 0)
{
- entry = Fcons (entry, Qnil);
+ entry = list1 (entry);
if (!NILP (prefix))
entry = Fcons (prefix, entry);
}
pane_name = first_item[MENU_ITEMS_ITEM_NAME];
/* (menu-item MENU-NAME PANE-NUMBER) */
- menu_object = Fcons (Qmenu_item,
- Fcons (pane_name,
- Fcons (make_number (pane), Qnil)));
+ menu_object = list3 (Qmenu_item, pane_name, make_number (pane));
show_help_echo (help_string ? build_string (help_string) : Qnil,
Qnil, menu_object, make_number (item));
}
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
if (keymaps)
{
- entry = Fcons (entry, Qnil);
+ entry = list1 (entry);
if (!NILP (pane_prefix))
entry = Fcons (pane_prefix, entry);
}
{
if (node->type == XML_ELEMENT_NODE)
{
- Lisp_Object result = Fcons (intern ((char *) node->name), Qnil);
+ Lisp_Object result = list1 (intern ((char *) node->name));
xmlNode *child;
xmlAttr *property;
Lisp_Object plist = Qnil;
(make_number (add ? 1 : 0),
Fcons
(make_fixnum_or_float (atom),
- value != 0
- ? Fcons (make_fixnum_or_float (value), Qnil)
- : Qnil)));
+ (value != 0
+ ? list1 (make_fixnum_or_float (value))
+ : Qnil))));
}
void