Prefer list1 (X) to Fcons (X, Qnil) when building lists.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Jul 2013 06:39:49 +0000 (23:39 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Jul 2013 06:39:49 +0000 (23:39 -0700)
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.

45 files changed:
src/ChangeLog
src/buffer.c
src/bytecode.c
src/callint.c
src/callproc.c
src/charset.c
src/coding.c
src/composite.c
src/dired.c
src/dispnew.c
src/doc.c
src/editfns.c
src/emacs.c
src/eval.c
src/fileio.c
src/fns.c
src/font.c
src/fontset.c
src/frame.c
src/ftfont.c
src/image.c
src/keyboard.c
src/keymap.c
src/lread.c
src/menu.c
src/minibuf.c
src/nsfns.m
src/nsfont.m
src/nsmenu.m
src/nsselect.m
src/nsterm.m
src/print.c
src/process.c
src/sound.c
src/textprop.c
src/unexaix.c
src/unexcoff.c
src/unexsol.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xfont.c
src/xmenu.c
src/xml.c
src/xterm.c

index cd6d188..bc71a48 100644 (file)
@@ -1,3 +1,86 @@
+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.
index 8176884..ae2398c 100644 (file)
@@ -613,7 +613,7 @@ even if it is dead.  The return value is never nil.  */)
 
   /* 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);
@@ -824,7 +824,7 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
 
   /* 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 ());
 
index c790275..be4fab4 100644 (file)
@@ -572,9 +572,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
          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++)
@@ -593,9 +593,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
       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.  */
@@ -1172,14 +1171,14 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
          }
 
        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;
          }
 
index 0651b68..3843122 100644 (file)
@@ -127,7 +127,7 @@ quotify_arg (register Lisp_Object exp)
   if (CONSP (exp)
       || (SYMBOLP (exp)
          && !NILP (exp) && !EQ (exp, Qt)))
-    return Fcons (Qquote, Fcons (exp, Qnil));
+    return list2 (Qquote, exp);
 
   return exp;
 }
@@ -802,7 +802,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
       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]);
        }
index 6d770f8..86d8246 100644 (file)
@@ -392,7 +392,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
 
     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);
@@ -410,7 +410,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
   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))
     {
@@ -422,7 +422,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
          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;
@@ -441,7 +441,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
        int openp_errno = errno;
        emacs_close (filefd);
        report_file_errno ("Searching for program",
-                          Fcons (args[0], Qnil), openp_errno);
+                          list1 (args[0]), openp_errno);
       }
   }
 
@@ -506,7 +506,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
          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
@@ -564,7 +564,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
        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 */
@@ -596,8 +596,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)  *
            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
@@ -1028,7 +1027,7 @@ create_temp_file (ptrdiff_t nargs, Lisp_Object *args)
 #endif
       if (fd < 0)
        report_file_error ("Failed to open temporary file using pattern",
-                          Fcons (pattern, Qnil));
+                          list1 (pattern));
       emacs_close (fd);
     }
 
index fdb8eeb..6b7e81c 100644 (file)
@@ -489,8 +489,7 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int co
   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);
@@ -1178,7 +1177,7 @@ usage: (define-charset-internal ...)  */)
                         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)
@@ -1198,7 +1197,7 @@ usage: (define-charset-internal ...)  */)
        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)
@@ -1206,7 +1205,7 @@ usage: (define-charset-internal ...)  */)
       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;
@@ -1223,7 +1222,7 @@ usage: (define-charset-internal ...)  */)
                                           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));
@@ -2308,7 +2307,7 @@ Please check your installation!\n",
       exit (1);
     }
 
-  Vcharset_map_path = Fcons (tempdir, Qnil);
+  Vcharset_map_path = list1 (tempdir);
 }
 
 
index a1494ad..8dcc401 100644 (file)
@@ -6864,11 +6864,9 @@ get_translation_table (Lisp_Object attrs, bool encodep, int *max_lookup)
       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);
        }
     }
 
@@ -8667,20 +8665,20 @@ detect_coding_system (const unsigned char *src,
        {
          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++)
@@ -8688,7 +8686,7 @@ detect_coding_system (const unsigned char *src,
                {
                  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;
                }
        }
@@ -8705,7 +8703,7 @@ detect_coding_system (const unsigned char *src,
                  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--)
@@ -8730,7 +8728,7 @@ detect_coding_system (const unsigned char *src,
            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)
@@ -8747,13 +8745,13 @@ detect_coding_system (const unsigned char *src,
            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.  */
@@ -9224,7 +9222,7 @@ is nil.  */)
       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))
@@ -9635,7 +9633,7 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern
   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;
 }
 
@@ -10080,9 +10078,9 @@ usage: (define-coding-system-internal ...)  */)
                {
                  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
                {
@@ -10093,7 +10091,7 @@ usage: (define-coding-system-internal ...)  */)
                        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)));
@@ -10411,7 +10409,7 @@ usage: (define-coding-system-internal ...)  */)
       && ! EQ (eol_type, Qmac))
     error ("Invalid eol-type");
 
-  aliases = Fcons (name, Qnil);
+  aliases = list1 (name);
 
   if (NILP (eol_type))
     {
@@ -10421,7 +10419,7 @@ usage: (define-coding-system-internal ...)  */)
          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);
@@ -10536,7 +10534,7 @@ DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias,
      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))
index 8b1f017..99b5da2 100644 (file)
@@ -595,7 +595,7 @@ update_compositions (ptrdiff_t from, ptrdiff_t to, int check_mask)
       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);
     }
 }
@@ -1873,11 +1873,9 @@ See `find-composition' for more details.  */)
        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);
@@ -1899,10 +1897,7 @@ See `find-composition' for more details.  */)
       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;
index b3348b0..ecce47a 100644 (file)
@@ -185,7 +185,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
 
   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
@@ -488,7 +488,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
 
   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));
@@ -1017,7 +1017,7 @@ return a list with one element, taken from `user-real-login-name'.  */)
 #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;
 }
 
index 1eb097f..8949630 100644 (file)
@@ -5619,7 +5619,7 @@ FILE = nil means just close any termscript file currently open.  */)
       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;
 }
@@ -5699,7 +5699,7 @@ bitch_at_user (void)
     {
       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));
@@ -6127,15 +6127,14 @@ init_display (void)
 
     /* 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)));
   }
 
   {
index 3c5a682..04af741 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -609,8 +609,7 @@ the same file name is found in the `doc-directory'.  */)
 
   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;
index cc6b4cf..1627ebd 100644 (file)
@@ -3492,7 +3492,7 @@ usage: (message-box FORMAT-STRING &rest ARGS)  */)
       {
        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);
index 2d55cfa..7ad9739 100644 (file)
@@ -1502,12 +1502,11 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
       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)
index 0e231bd..25cfc54 100644 (file)
@@ -338,7 +338,7 @@ do_debug_on_call (Lisp_Object code)
 {
   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
@@ -1611,7 +1611,7 @@ signal_error (const char *s, Lisp_Object arg)
     }
 
   if (!NILP (hare))
-    arg = Fcons (arg, Qnil);   /* Make it a list.  */
+    arg = list1 (arg);
 
   xsignal (Qerror, Fcons (build_string (s), arg));
 }
@@ -1703,7 +1703,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data)
       /* 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;
     }
 
@@ -1992,7 +1992,7 @@ If LEXICAL is t, evaluate using lexical scoping.  */)
 {
   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));
 }
 
@@ -2257,7 +2257,7 @@ eval_sub (Lisp_Object 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;
@@ -2878,7 +2878,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS)  */)
   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;
 }
@@ -2920,7 +2920,7 @@ apply_lambda (Lisp_Object fun, Lisp_Object args)
     {
       /* 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;
index c356639..b87455d 100644 (file)
@@ -749,7 +749,7 @@ make_temp_name (Lisp_Object prefix, bool base64_p)
               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 */
        }
     }
@@ -2019,7 +2019,7 @@ entries (depending on how Emacs was built).  */)
     {
       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),
@@ -2027,7 +2027,7 @@ entries (depending on how Emacs was built).  */)
     {
       /* 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.  */
@@ -2058,7 +2058,7 @@ entries (depending on how Emacs was built).  */)
       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);
     }
@@ -2068,12 +2068,12 @@ entries (depending on how Emacs was built).  */)
   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))
     {
@@ -2082,7 +2082,7 @@ entries (depending on how Emacs was built).  */)
        {
          conlength = fgetfilecon (ifd, &con);
          if (conlength == -1)
-           report_file_error ("Doing fgetfilecon", Fcons (file, Qnil));
+           report_file_error ("Doing fgetfilecon", list1 (file));
        }
 #endif
     }
@@ -2090,11 +2090,11 @@ entries (depending on how Emacs was built).  */)
   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);
 
   {
@@ -2109,7 +2109,7 @@ entries (depending on how Emacs was built).  */)
                      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));
 
@@ -2117,7 +2117,7 @@ entries (depending on how Emacs was built).  */)
   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
@@ -2158,7 +2158,7 @@ entries (depending on how Emacs was built).  */)
       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);
     }
@@ -2174,7 +2174,7 @@ entries (depending on how Emacs was built).  */)
     }
 
   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);
 
@@ -2719,7 +2719,7 @@ If there is no error, returns nil.  */)
   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;
 }
@@ -3054,14 +3054,14 @@ or if Emacs was not compiled with SELinux support.  */)
                  != 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
 
@@ -3151,7 +3151,7 @@ support.  */)
       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;
        }
 
@@ -3161,7 +3161,7 @@ support.  */)
                            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;
@@ -3221,7 +3221,7 @@ symbolic notation, like the `chmod' command from GNU Coreutils.  */)
   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;
 }
@@ -3287,7 +3287,7 @@ Use the current time if TIMESTAMP is nil.  TIMESTAMP is in the format of
         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));
       }
   }
 
@@ -3553,7 +3553,7 @@ by calling `format-decode', which see.  */)
     {
       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))
@@ -3568,7 +3568,7 @@ by calling `format-decode', which see.  */)
   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
@@ -3682,7 +3682,7 @@ by calling `format-decode', which see.  */)
                      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;
                    }
@@ -3727,7 +3727,7 @@ by calling `format-decode', which see.  */)
                  /* 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));
                }
            }
 
@@ -3794,7 +3794,7 @@ by calling `format-decode', which see.  */)
        {
          if (lseek (fd, beg_offset, SEEK_SET) < 0)
            report_file_error ("Setting file position",
-                              Fcons (orig_filename, Qnil));
+                              list1 (orig_filename));
        }
 
       immediate_quit = 1;
@@ -3867,7 +3867,7 @@ by calling `format-decode', which see.  */)
          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)
@@ -3988,7 +3988,7 @@ by calling `format-decode', which see.  */)
 
       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.  */
@@ -4169,7 +4169,7 @@ by calling `format-decode', which see.  */)
     {
       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
@@ -4574,7 +4574,7 @@ by calling `format-decode', which see.  */)
       && 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);
     }
 
@@ -4631,7 +4631,7 @@ This function is for internal use only.  It may prompt the user.  */ )
          && !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
@@ -4834,7 +4834,7 @@ This calls `write-region-annotate-functions' at the start, and
 
   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;
@@ -4901,7 +4901,7 @@ This calls `write-region-annotate-functions' at the start, and
       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);
     }
 
@@ -4917,7 +4917,7 @@ This calls `write-region-annotate-functions' at the start, and
          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);
        }
     }
index 49bd847..b056ece 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -1962,7 +1962,7 @@ The PLIST is modified by side effects.  */)
       prev = tail;
       QUIT;
     }
-  newcell = Fcons (prop, Fcons (val, Qnil));
+  newcell = list2 (prop, val);
   if (NILP (prev))
     return newcell;
   else
@@ -2455,9 +2455,8 @@ is nil, and `use-dialog-box' is non-nil.  */)
     {
       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);
@@ -4915,7 +4914,7 @@ syms_of_fns (void)
   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");
 
index 231df2e..80b4b76 100644 (file)
@@ -472,7 +472,7 @@ font_registry_charsets (Lisp_Object registry, struct charset **encoding, struct
        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)
@@ -483,7 +483,7 @@ font_registry_charsets (Lisp_Object registry, struct charset **encoding, struct
 
  invalid_entry:
   font_charset_alist
-    = nconc2 (font_charset_alist, Fcons (Fcons (registry, Qnil), Qnil));
+    = nconc2 (font_charset_alist, list1 (Fcons (registry, Qnil)));
   return -1;
 }
 
@@ -1453,7 +1453,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
                  else
                     {
                       extra_props = nconc2 (extra_props,
-                                            Fcons (Fcons (key, val), Qnil));
+                                            list1 (Fcons (key, val)));
                     }
                }
              p = q;
@@ -2519,7 +2519,7 @@ font_prepare_cache (FRAME_PTR f, struct font_driver *driver)
     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
@@ -3517,8 +3517,7 @@ font_update_drivers (FRAME_PTR f, Lisp_Object new_drivers)
 
   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;
 }
 
@@ -4133,7 +4132,7 @@ how close they are to PREFER.  */)
     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);
index 2f6313c..6a6a434 100644 (file)
@@ -1523,7 +1523,7 @@ appended.  By default, FONT-SPEC overrides the previous settings.  */)
     {
       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))
     {
@@ -1539,7 +1539,7 @@ appended.  By default, FONT-SPEC overrides the previous settings.  */)
            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))
     {
@@ -1552,7 +1552,7 @@ appended.  By default, FONT-SPEC overrides the previous settings.  */)
        {
          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));
@@ -1568,7 +1568,7 @@ appended.  By default, FONT-SPEC overrides the previous settings.  */)
               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");
 
@@ -1628,7 +1628,7 @@ appended.  By default, FONT-SPEC overrides the previous settings.  */)
          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);
            }
        }
@@ -1999,7 +1999,7 @@ format is the same as above.  */)
                          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));
                        }
                    }
                }
@@ -2238,9 +2238,9 @@ alternate fontnames (if any) are tried instead.  */);
 
   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,
index 648687a..f2cbfaa 100644 (file)
@@ -389,7 +389,7 @@ make_frame (int mini_p)
        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)
@@ -726,15 +726,15 @@ affects all frames on the same terminal device.  */)
   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.  */
@@ -2731,7 +2731,7 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist)
     {
       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);
     }
@@ -2739,7 +2739,7 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist)
     {
       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);
     }
@@ -2874,13 +2874,13 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
   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));
@@ -3739,7 +3739,7 @@ x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
   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;
 }
 
@@ -3871,9 +3871,9 @@ On Nextstep, this just calls `ns-parse-geometry'.  */)
       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);
@@ -3884,9 +3884,9 @@ On Nextstep, this just calls `ns-parse-geometry'.  */)
       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);
index 0ad173a..7c9534d 100644 (file)
@@ -2703,13 +2703,12 @@ syms_of_ftfont (void)
   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;
index c085e6e..95d385d 100644 (file)
@@ -7581,8 +7581,7 @@ gif_load (struct frame *f, struct image *img)
              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,
index b6eb9e6..f6bc7f3 100644 (file)
@@ -1427,7 +1427,7 @@ command_loop_1 (void)
          if (!NILP (Vquit_flag))
            {
              Vquit_flag = Qnil;
-             Vunread_command_events = Fcons (make_number (quit_char), Qnil);
+             Vunread_command_events = list1 (make_number (quit_char));
            }
        }
 
@@ -2255,9 +2255,9 @@ read_event_from_main_queue (EMACS_TIME *end_time,
        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)
@@ -2679,9 +2679,9 @@ read_char (int commandflag, Lisp_Object map,
                  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
@@ -2999,7 +2999,7 @@ read_char (int commandflag, Lisp_Object map,
       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);
@@ -3582,8 +3582,8 @@ kbd_buffer_store_event_hold (register struct input_event *event,
          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++)
                {
@@ -3946,9 +3946,9 @@ kbd_buffer_get_event (KBOARD **kbp,
       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;
@@ -3960,8 +3960,7 @@ kbd_buffer_get_event (KBOARD **kbp,
       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
@@ -3970,15 +3969,13 @@ kbd_buffer_get_event (KBOARD **kbp,
       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
@@ -4001,11 +3998,11 @@ kbd_buffer_get_event (KBOARD **kbp,
 #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
@@ -4014,11 +4011,11 @@ kbd_buffer_get_event (KBOARD **kbp,
        {
 #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
@@ -4027,7 +4024,7 @@ kbd_buffer_get_event (KBOARD **kbp,
 #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.
@@ -5555,14 +5552,12 @@ make_lispy_event (struct input_event *event)
 
                /* 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 */
 
@@ -5581,12 +5576,9 @@ make_lispy_event (struct input_event *event)
            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 */
 
@@ -5734,19 +5726,11 @@ make_lispy_event (struct input_event *event)
                                      &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);
        }
       }
 
@@ -5845,14 +5829,9 @@ make_lispy_event (struct input_event *event)
        }
 
        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);
       }
 
 
@@ -5883,12 +5862,8 @@ make_lispy_event (struct input_event *event)
        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;
@@ -5906,7 +5881,7 @@ make_lispy_event (struct input_event *event)
                                    Vlispy_mouse_stem,
                                    NULL, &mouse_syms,
                                    ASIZE (mouse_syms));
-       return Fcons (head, Fcons (position, Qnil));
+       return list2 (head, position);
       }
 
 #endif /* USE_TOOLKIT_SCROLL_BARS */
@@ -5932,10 +5907,7 @@ make_lispy_event (struct input_event *event)
                                    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) \
@@ -5945,22 +5917,20 @@ make_lispy_event (struct input_event *event)
        /* 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;
@@ -5992,9 +5962,8 @@ make_lispy_event (struct input_event *event)
 #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:
       {
@@ -6035,24 +6004,13 @@ make_lispy_event (struct input_event *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 */
 
@@ -6072,13 +6030,12 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
       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
@@ -6093,7 +6050,7 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
 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.  */
@@ -6326,7 +6283,7 @@ parse_modifiers (Lisp_Object symbol)
       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,
@@ -6399,7 +6356,7 @@ apply_modifiers (int modifiers, Lisp_Object base)
         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,
@@ -7551,7 +7508,7 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
       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;
     }
@@ -8106,7 +8063,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
 
   /* 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;
@@ -9338,8 +9295,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
 
                  /* 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;
@@ -9494,8 +9450,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
 
                      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);
@@ -10131,7 +10086,7 @@ The file will be closed when Emacs exits.  */)
       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;
 }
@@ -11079,7 +11034,7 @@ syms_of_keyboard (void)
        *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));
       }
   }
 
@@ -11474,7 +11429,7 @@ and the minor mode maps regardless of `overriding-local-map'.  */);
 
   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.  */);
index d29d563..e1268c8 100644 (file)
@@ -129,7 +129,7 @@ in case you use it as a menu with `x-popup-menu'.  */)
 {
   Lisp_Object tail;
   if (!NILP (string))
-    tail = Fcons (string, Qnil);
+    tail = list1 (string);
   else
     tail = Qnil;
   return Fcons (Qkeymap,
@@ -151,9 +151,9 @@ in case you use it as a menu with `x-popup-menu'.  */)
     {
       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
@@ -534,12 +534,12 @@ access_keymap_1 (Lisp_Object map, Lisp_Object idx,
              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));
              }
          }
@@ -1045,9 +1045,9 @@ However, a key definition which is a symbol whose definition is a keymap
 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))
@@ -1073,7 +1073,7 @@ is not copied.  */)
          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);
     }
@@ -1341,8 +1341,7 @@ append_key (Lisp_Object key_sequence, Lisp_Object key)
   Lisp_Object args[2];
 
   args[0] = key_sequence;
-
-  args[1] = Fcons (key, Qnil);
+  args[1] = list1 (key);
   return Fvconcat (2, args);
 }
 
@@ -1549,7 +1548,7 @@ like in the respective argument of `key-binding'.  */)
 {
   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
@@ -1809,7 +1808,7 @@ bindings; see the description of `lookup-key' for more details about this.  */)
        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;
@@ -1951,7 +1950,7 @@ accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void *
   else
     {
       tem = append_key (thisseq, key);
-      nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil));
+      nconc2 (tail, list1 (Fcons (tem, cmd)));
     }
 }
 
@@ -2005,13 +2004,13 @@ then the value includes only maps for prefixes that start with PREFIX.  */)
                }
              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,
@@ -2619,7 +2618,7 @@ The optional 5th arg NO-REMAP alters how command remapping is handled:
   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);
 
index f0423f1..a6c5b9c 100644 (file)
@@ -562,7 +562,7 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
   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;
 }
 
@@ -672,7 +672,7 @@ read_filtered_event (bool no_switch_frame, bool ascii_required,
        {
          if (error_nonascii)
            {
-             Vunread_command_events = Fcons (val, Qnil);
+             Vunread_command_events = list1 (val);
              error ("Non-character input-event");
            }
          else
@@ -1494,7 +1494,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
        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));
@@ -1764,8 +1764,8 @@ readevalloop (Lisp_Object readcharfun,
      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);
 
@@ -2724,7 +2724,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
       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 == ':')
        {
@@ -2819,9 +2819,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
       goto retry;
 
     case '\'':
-      {
-       return Fcons (Qquote, Fcons (read0 (readcharfun), Qnil));
-      }
+      return list2 (Qquote, read0 (readcharfun));
 
     case '`':
       {
@@ -2851,7 +2849,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
            value = read0 (readcharfun);
            new_backquote_flag = saved_new_backquote_flag;
 
-           return Fcons (Qbackquote, Fcons (value, Qnil));
+           return list2 (Qbackquote, value);
          }
       }
     case ',':
@@ -2889,7 +2887,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
              }
 
            value = read0 (readcharfun);
-           return Fcons (comma_type, Fcons (value, Qnil));
+           return list2 (comma_type, value);
          }
        else
          {
@@ -3665,7 +3663,7 @@ read_list (bool flag, Lisp_Object readcharfun)
            }
          invalid_syntax ("] in a list");
        }
-      tem = Fcons (elt, Qnil);
+      tem = list1 (elt);
       if (!NILP (tail))
        XSETCDR (tail, tem);
       else
@@ -4232,7 +4230,7 @@ init_lread (void)
                          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
@@ -4459,8 +4457,8 @@ otherwise to default specified by file `epaths.h' when Emacs was built.  */);
 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.
@@ -4474,7 +4472,7 @@ and, if so, which suffixes they should try to append to the file name
 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'.  */);
index 58558d5..f546132 100644 (file)
@@ -1004,7 +1004,7 @@ find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data)
                 {
                   int j;
 
-                  entry = Fcons (entry, Qnil);
+                  entry = list1 (entry);
                   if (!NILP (prefix))
                     entry = Fcons (prefix, entry);
                   for (j = submenu_depth - 1; j >= 0; j--)
index b69a16e..c51941a 100644 (file)
@@ -786,7 +786,7 @@ get_minibuffer (EMACS_INT depth)
   tail = Fnthcdr (num, Vminibuffer_list);
   if (NILP (tail))
     {
-      tail = Fcons (Qnil, Qnil);
+      tail = list1 (Qnil);
       Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
     }
   buf = Fcar (tail);
@@ -1862,7 +1862,7 @@ If FLAG is nil, invoke `try-completion'; if it is t, invoke
   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;
 }
@@ -2106,8 +2106,7 @@ These are in addition to the basic `field' property, and stickiness
 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);
index 6eebb4d..291ab20 100644 (file)
@@ -2022,7 +2022,7 @@ there was no result.  */)
   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 ("");
@@ -2878,7 +2878,7 @@ Example: Install an icon Gnus.tiff and execute the following code
 
 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.  */);
index a657d01..df7ef0b 100644 (file)
@@ -446,7 +446,7 @@ static NSCharacterSet
       {
        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));
index 22635dc..c070411 100644 (file)
@@ -1492,7 +1492,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
   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];
index 6053ee9..d95ff79 100644 (file)
@@ -219,9 +219,10 @@ ns_get_local_selection (Lisp_Object selection_name,
     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;
 }
@@ -256,8 +257,7 @@ ns_string_from_pasteboard (id pb)
   if (type == nil)
     {
       Fsignal (Qquit,
-              Fcons (build_string ("empty or unsupported pasteboard type"),
-                    Qnil));
+              list1 (build_string ("empty or unsupported pasteboard type")));
     return Qnil;
     }
 
@@ -275,8 +275,8 @@ ns_string_from_pasteboard (id pb)
       else
         {
           Fsignal (Qquit,
-                  Fcons (build_string ("pasteboard doesn't contain valid data"),
-                        Qnil));
+                  list1 (build_string ("pasteboard doesn't contain"
+                                       " valid data")));
           return Qnil;
         }
     }
@@ -362,7 +362,7 @@ On Nextstep, FRAME is unused.  */)
 
   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);
index d7cea5c..5cbddd2 100644 (file)
@@ -362,7 +362,7 @@ append2 (Lisp_Object list, Lisp_Object item)
 {
   Lisp_Object array[2];
   array[0] = list;
-  array[1] = Fcons (item, Qnil);
+  array[1] = list1 (item);
   return Fnconc (2, &array[0]);
 }
 
index 8ea76d9..464fd45 100644 (file)
@@ -771,7 +771,7 @@ append to existing target file.  */)
          stderr = initial_stderr_stream;
          initial_stderr_stream = NULL;
          report_file_error ("Cannot open debugging output stream",
-                            Fcons (file, Qnil));
+                            list1 (file));
        }
     }
   return Qnil;
@@ -1301,7 +1301,7 @@ print_prune_string_charset (Lisp_Object string)
       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);
index 8589aca..94ffc37 100644 (file)
@@ -841,7 +841,7 @@ nil, indicating the current buffer's process.  */)
   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);
@@ -1206,11 +1206,11 @@ list of keywords.  */)
   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);
 }
 
@@ -1397,7 +1397,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
     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;
   }
@@ -1519,7 +1519,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
          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
@@ -1542,7 +1542,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
 
        /* 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
@@ -2323,8 +2323,7 @@ set_socket_option (int s, Lisp_Object opt, Lisp_Object val)
     }
 
   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);
 }
 
@@ -5124,9 +5123,7 @@ read_and_dispose_of_process_output (struct Lisp_Process *p, char *chars,
        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);
 
@@ -5296,7 +5293,7 @@ write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj,
   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
@@ -5469,7 +5466,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
              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
@@ -5546,7 +5543,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
                }
              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;
@@ -6272,8 +6269,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
   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);
 
index 5ce185e..c476b30 100644 (file)
@@ -1352,7 +1352,7 @@ Internal use only, use `play-sound' instead.  */)
   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");
index e5d4fe0..282ae11 100644 (file)
@@ -226,7 +226,7 @@ validate_plist (Lisp_Object list)
       return list;
     }
 
-  return Fcons (list, Fcons (Qnil, Qnil));
+  return list2 (list, Qnil);
 }
 
 /* Return true if interval I has all the properties,
@@ -436,16 +436,14 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object,
                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;
@@ -1308,9 +1306,7 @@ the current buffer), START and END are buffer positions (integers or
 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;
 }
 
@@ -1344,11 +1340,10 @@ into it.  */)
   (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;
 }
 
@@ -1929,7 +1924,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
          {
            if (EQ (Fcar (plist), prop))
              {
-               plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil));
+               plist = list2 (prop, Fcar (Fcdr (plist)));
                break;
              }
            plist = Fcdr (Fcdr (plist));
@@ -1938,10 +1933,8 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
        {
          /* 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);
@@ -2007,14 +2000,13 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
            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);
@@ -2343,8 +2335,8 @@ inherits it if NONSTICKINESS is nil.  The `front-sticky' and
   /* 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);
index 757ba6f..f97de45 100644 (file)
@@ -97,7 +97,7 @@ report_error (const char *file, int fd)
   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)
index c467e59..0b45d72 100644 (file)
@@ -130,7 +130,7 @@ report_error (const char *file, int fd)
   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
index 470206d..cfd515f 100644 (file)
@@ -20,7 +20,7 @@ unexec (const char *new_name, const char *old_name)
   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);
index 12b294e..9f3b026 100644 (file)
@@ -11999,9 +11999,8 @@ redisplay_tool_bar (struct frame *f)
 
          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);
@@ -12100,9 +12099,8 @@ redisplay_tool_bar (struct frame *f)
            {
              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);
@@ -21345,7 +21343,7 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_st
          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),
@@ -21369,8 +21367,8 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_st
          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);
        }
@@ -21484,7 +21482,7 @@ are the selected window and the WINDOW's buffer).  */)
       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));
@@ -29234,9 +29232,8 @@ syms_of_xdisp (void)
   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");
@@ -29340,7 +29337,7 @@ See also `overlay-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.
index 4b42cb7..d358512 100644 (file)
@@ -3388,7 +3388,7 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
          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)));
     }
 }
 
@@ -3709,14 +3709,10 @@ Value is nil if ATTR doesn't have a discrete set of valid values.  */)
 
   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;
 }
@@ -3779,21 +3775,18 @@ Default face attributes override any local face attributes.  */)
              && 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])));
        }
     }
 
@@ -6483,7 +6476,7 @@ syms_of_xfaces (void)
   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);
index a1c709a..30f58ba 100644 (file)
@@ -1715,7 +1715,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
 #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;
 }
 
@@ -2948,7 +2948,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms)
     {
       /* 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.  */
@@ -5238,7 +5238,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
 
   /* 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 */
@@ -5256,8 +5256,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
       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
@@ -5276,8 +5275,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
     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;
index 9978aba..9647a51 100644 (file)
@@ -295,9 +295,9 @@ xfont_supported_scripts (Display *display, char *fontname, Lisp_Object props,
 
   /* 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))
     {
index 48ab351..8349b0d 100644 (file)
@@ -296,10 +296,10 @@ for instance using the window manager, then this produces a quit and
     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
   {
@@ -317,9 +317,9 @@ for instance using the window manager, then this produces a quit and
       /* 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 ();
@@ -1871,7 +1871,7 @@ xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
                    {
                      int j;
 
-                     entry = Fcons (entry, Qnil);
+                     entry = list1 (entry);
                      if (!NILP (prefix))
                        entry = Fcons (prefix, entry);
                      for (j = submenu_depth - 1; j >= 0; j--)
@@ -2172,7 +2172,7 @@ xdialog_show (FRAME_PTR f,
                {
                  if (keymaps != 0)
                    {
-                     entry = Fcons (entry, Qnil);
+                     entry = list1 (entry);
                      if (!NILP (prefix))
                        entry = Fcons (prefix, entry);
                    }
@@ -2223,9 +2223,7 @@ menu_help_callback (char const *help_string, int pane, int item)
     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));
 }
@@ -2515,7 +2513,7 @@ xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
                        = 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);
                        }
index 4b466dc..c330dce 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -124,7 +124,7 @@ make_dom (xmlNode *node)
 {
   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;
index 818b69c..f1a18d3 100644 (file)
@@ -8372,9 +8372,9 @@ set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value)
                        (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