1. 23 May, 2020 1 commit
  2. 19 Apr, 2020 1 commit
    • Eli Zaretskii's avatar
      Don't use Gnulib's explicit_bzero on MS-Windows · 3f8b771d
      Eli Zaretskii authored
      This is a preventive change, since Gnulib was recently changed
      its explicit_bzero to call SecureZeroMemory on MS-Windows,
      disregarding systems older than XP, which didn't have it.
      
      * src/w32.c (explicit_bzero): New function.
      
      * nt/mingw-cfg.site (ac_cv_func_explicit_bzero): Avoid using the
      Gnulib replacement for explicit_bzero.
      * nt/inc/ms-w32.h (explicit_bzero): Add prototype.
      3f8b771d
  3. 16 Apr, 2020 1 commit
    • Eli Zaretskii's avatar
      File-handling cleanup in w32image.c · 490f279c
      Eli Zaretskii authored
      * src/w32image.c (w32_load_image): Encode the image file name and
      convert it via 'map_w32_filename'.  No need to do anything special
      when 'w32_unicode_filenames' is zero, since file names are in
      UTF-8 internally, and this code will never run on Windows 9X.
      * src/w32.h (map_w32_filename): Add prototype; removed prototypes
      from all *.c files.
      490f279c
  4. 14 Apr, 2020 2 commits
    • Eli Zaretskii's avatar
      Make use of MS-Windows native image API be selectable at run time · e94206aa
      Eli Zaretskii authored
      * configure.ac: Minor cleanup in how w32image.o is added to the
      build when native image APIs are requested.
      
      * src/w32gui.h (w32_load_image, w32_can_use_native_image_api)
      (w32_gdiplus_shutdown): Move prototypes from w32term.h here, since
      w32.c doesn't include w32term.h.
      * src/image.c (struct image_type): No need to pass TYPE to the
      'valid_p' method.  All callers changed.
      (initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
      'image_can_use_native_api' before trying image-specific methods.
      (image_can_use_native_api): New function.
      (image_types): Remove the native_image_type parts.
      (syms_of_image): New symbol 'native-image'.
      (parse_image_spec): Accept native-image "type" for any image type.
      * src/w32term.c (syms_of_w32term): New variable
      'w32-use-native-image-API'.
      * src/w32image.c: (w32_can_use_native_image_api): New function.
      (gdiplus_init): Rename from w32_gdiplus_startup. Simplify code.
      Move the call to GdiplusStartup to a separate function.  Use
      ordinal number for SHCreateMemStream if cannot load it by name.
      (w32_load_image): Ignore Win32Error status from
      w32_select_active_frame.
      Move DEFSYMs from here...
      * src/image.c (syms_of_image) [HAVE_NATIVE_IMAGE_API]: ...to here.
      
      * etc/NEWS: Update the entry about native image API use.
      e94206aa
    • Juan José García-Ripoll's avatar
      Initial version of native image API support for MS-Windows · df254a74
      Juan José García-Ripoll authored
      * src/w32image.c: New file.
      * src/w32term.h: Add prototypes of 'w32_load_image',
      'w32_gdiplus_startup', 'w32_gdiplus_shutdown', and
      'w32_query_frame_background_color'.
      * src/w32term.c (w32_query_frame_background_color): No longer
      static.
      * src/w32.c (term_ntproc) [HAVE_GDIPLUS]: Call
      'w32_gdiplus_shutdown'.
      * src/image.c (struct image_type) <valid_p>: Accept an additional
      argument, the image type.  All implementations changed.
      (init_native_image_functions, native_image_p, native_image_load)
      [HAVE_NATIVE_IMAGE_API]: New methods for "native image type".
      (initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
      'init_native_image_functions'.
      (image_types) [HAVE_NATIVE_IMAGE_API]: Add settings for native
      image API.
      (lookup_image_type) [HAVE_NATIVE_IMAGE_API]: Initialize native
      functions if needed.
      
      * lisp/term/w32-win.el (dynamic-library-alist): Add gdiplus and
      shlwapi.
      
      * etc/NEWS: Announce the new feature.
      
      * configure.ac (native-image-api): New option, OFF by default.
      (HAVE_NATIVE_IMAGE_API): If native-image-api is selected, add
      w32image.o to W32_OBJ.
      df254a74
  5. 08 Mar, 2020 1 commit
    • Eli Zaretskii's avatar
      Fix the MinGW build as followup to recent "nofollow" changes · 66bc47d1
      Eli Zaretskii authored
      * src/w32.c (fdutimens): Call utimensat instead of utime.
      (set_file_times): Function deleted.
      (convert_from_timespec): Renamed from convert_from_time_t and
      modified to accept 'struct timespec' argument instead of 'time_t'.
      (utimensat): Renamed from utime and modified to accept 'struct
      timespec [2]' argument and an additional argument FLAG.  Emulate
      Posix 'utimensat'.  Call 'convert_from_timespec'.
      (w32_copy_file): Call 'utimensat' instead of 'set_file_times'.
      * src/fileio.c (Fcopy_file) [WINDOWSNT]: Make the error message be
      identical to that on Posix platforms.
      
      * nt/inc/sys/stat.h (utimensat): Provide prototype.
      * nt/mingw-cfg.site (ac_cv_func_futimens)
      (gl_cv_func_futimens_works, ac_cv_func_utimensat)
      (gl_cv_func_utimensat_works): Override Gnulib tests.
      * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_futimens)
      (OMIT_GNULIB_MODULE_utimensat): Disable these Gnulib modules.
      66bc47d1
  6. 07 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Add ‘nofollow’ flag to set-file-times · 5d4cf1fe
      Paul Eggert authored
      This is a companion to the recent set-file-modes patch.
      It adds support for a ‘nofollow’ flag to set-file-times (Bug#39773).
      Like the set-file-modes patch, it needs work in the w32 port.
      * admin/merge-gnulib (GNULIB_MODULES): Add futimens, utimensat.
      Remove utimens.
      * doc/lispref/files.texi (Changing Files):
      * etc/NEWS: Mention the change.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lisp/files.el (copy-directory):
      * lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file):
      * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file):
      * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file):
      * lisp/tar-mode.el (tar-copy):
      * test/lisp/filenotify-tests.el (file-notify-test03-events):
      * test/lisp/files-tests.el:
      (files-tests-file-name-non-special-set-file-times):
      * test/lisp/net/tramp-tests.el (tramp-test22-file-times):
      When setting file times, avoid following symbolic links
      when the file is not supposed to be a symbolic link.
      * lib/futimens.c, lib/utimensat.c, m4/futimens.m4, m4/utimensat.m4:
      New files, copied from Gnulib.
      * lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file):
      When creating a file that is not supposed to exist already,
      use the excl flag to check this.
      * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
      * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-times):
      Accept an optional FLAG arg that is currently ignored,
      and add a FIXME comment for it.
      * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-times):
      * src/fileio.c (Fset_file_times):
      Support an optional FLAG arg.
      * src/fileio.c (Fcopy_file): Use futimens instead of set_file_times,
      as it’s simpler and is a POSIX API.
      * src/sysdep.c (set_file_times): Move from here ...
      * src/w32.c (set_file_times): ... to here, and make it static,
      since it is now used only in w32.c.  Presumably w32.c should also
      add support for futimens and utimensat (the POSIX APIs, which
      Emacs now uses) and it can remove fdutimens (the Gnulib API,
      which Emacs no longer uses).
      5d4cf1fe
  7. 24 Feb, 2020 1 commit
    • Eli Zaretskii's avatar
      Adapt the MS-Windows build to 'nofollow' changes · 7dfe90a6
      Eli Zaretskii authored
      * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_fchmodat)
      (OMIT_GNULIB_MODULE_lchmod): Set to true to omit building these
      modules on MS-Windows.
      * nt/mingw-cfg.site (ac_cv_func_fchmodat)
      (gl_cv_func_fchmodat_works, ac_cv_func_lchmod): Disable tests on
      MS-Windows.
      
      * src/w32.c (chmod_worker, lchmod, fchmodat): New functions.
      (sys_chmod): Move most of the code to chmod_worker.
      * src/w32.h (fchmodat, lchmod): Add prototypes.
      7dfe90a6
  8. 20 Jan, 2020 1 commit
  9. 01 Jan, 2020 1 commit
  10. 28 Nov, 2019 1 commit
  11. 27 Nov, 2019 1 commit
  12. 26 Nov, 2019 2 commits
    • Eli Zaretskii's avatar
      Fix MS-Windows build with mingw.org's MinGW · 094eb04c
      Eli Zaretskii authored
      mingw.org's MinGW by default targets Windows 9X, so
      _WIN32_WINNT is set to a value that bypasses declarations
      in system headers we need to compile network_interface_list.
      Also, the code needed a workaround for Windows XP, where
      some functionality is missing from the GetAdaptersAddresses
      API.
      
      * src/w32.c (_WIN32_WINNT): Define to 0x0501, if the value is
      lower, temporarily while processing iphlpapi.h.
      (address_prefix_match): New helper function.
      (network_interface_list): Work around the fact that the
      OnLinkPrefixLength member of IP_ADAPTER_UNICAST_ADDRESS is not
      available when _WIN32_WINNT < 0x0600.  On Windows XP use
      special code that calls address_prefix_match to compute the
      network prefix length.
      094eb04c
    • Robert Pluim's avatar
      Extend network-interface-list to return IPv6 and network info · 650a514e
      Robert Pluim authored
      Bug#38218
      
      * src/process.c (Fnetwork_interface_list): Extend argument list to
      allow requesting full network info and/or IPv4/IPv6 info.
      (network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve
      interface IP addresses.
      
      * src/process.h: Update prototype of network_interface_list.
      
      * src/w32.c (g_b_init_get_adapters_addresses): New init flag.
      (globals_of_w32): Initialize it.
      (GetAdaptersAddresses_Proc): New function typedef.
      (get_adapters_addresses): New wrapper function.
      (init_winsock): Load htonl and ntohl.
      (sys_htonl, sys_ntohl): New wrapper functions.
      (network_interface_list): Implement in terms of
      get_adapters_addresses.
      
      * nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes.
      
      * etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list.
      
      * doc/lispref/processes.texi (Misc Network): Document updated arglist
      and return values for network-interface-list.
      650a514e
  13. 09 Oct, 2019 1 commit
  14. 02 Oct, 2019 1 commit
  15. 16 Sep, 2019 1 commit
  16. 23 Aug, 2019 1 commit
  17. 07 Aug, 2019 1 commit
  18. 26 Jun, 2019 1 commit
    • Eli Zaretskii's avatar
      Support invoking Emacs via a symlink on MS-Windows · e35708b4
      Eli Zaretskii authored
      * src/w32.c (w32_my_exename): Resolve symlinks in the
      executable name, to support searching for the pdumper file
      when the executable is found via a symlink.
      * src/emacs.c (load_pdump): Add a comment about symlink
      resolution on Windows.
      e35708b4
  19. 24 Jun, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix MS-Windows build as followup to pdumper executable lookup · 9f5f5ae6
      Eli Zaretskii authored
      * src/w32.c (w32_my_exename): New function.
      * src/w32.h (w32_my_exename): Add prototype.
      * src/emacs.c (load_pdump_find_executable) [WINDOWSNT]: Find
      the actual file name of the program without looking along
      PATH, by calling w32_my_exename.
      
      * nt/mingw-cfg.site (ac_cv_func_canonicalize_file_name)
      (ac_cv_func_realpath, gl_cv_func_realpath_works): Disable
      testing.
      * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_canonicalize-lgpl): Set
      to true.
      9f5f5ae6
  20. 07 May, 2019 1 commit
  21. 29 Apr, 2019 1 commit
  22. 22 Mar, 2019 1 commit
    • Stefan Monnier's avatar
      Fix misuses of NULL when talking about the NUL character · 76fea1eb
      Stefan Monnier authored
      * lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias.
      
      * src/coding.c (setup_coding_system): Use new name.
      (detect_coding): Rename null_byte_found => nul_byte_found.
      (detect_coding_system): Use new name.
      Rename null_byte_found => nul_byte_found.
      (Fdefine_coding_system_internal): Use new name.
      (syms_of_coding): Rename inhibit-null-byte-detection to
      inhibit-nul-byte-detection.
      * src/w16select.c (get_clipboard_data): null_char => nul_char.
      * src/json.c (check_string_without_embedded_nuls): Rename from
      check_string_without_embedded_nulls.
      (Fjson_parse_string): Adjust accordingly.
      * src/coding.h (enum define_coding_undecided_arg_index)
      (enum coding_attr_index): ...null_byte... => ...nul_byte....
      * lisp/info.el (info-insert-file-contents, Info-insert-dir):
      * lisp/international/mule.el (define-coding-system):
      * lisp/vc/vc-git.el (vc-git--call):
      * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
      76fea1eb
  23. 04 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Simplify list creation in C code · 5c2563a5
      Paul Eggert authored
      The main new thing here is that C code can now say
      ‘list (a, b, c, d, e, f)’ instead of
      ‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’,
      thus relieving callers of the responsibility of counting
      arguments (plus, the code feels more like Lisp).  The old
      list1 ... list5 functions remain, as they’re probably a bit
      faster for small lists.
      * src/alloc.c (cons_listn, pure_listn): New functions.
      (listn): Omit enum argument.
      All callers changed to use either new ‘list’ or ‘pure_list’ macros.
      * src/charset.c (Fdefine_charset_internal):
      * src/coding.c (detect_coding_system)
      (Fset_terminal_coding_system_internal):
      * src/frame.c (frame_size_history_add, adjust_frame_size):
      * src/gtkutil.c (xg_frame_set_char_size):
      * src/keyboard.c (command_loop_1):
      * src/nsfns.m (frame_geometry):
      * src/widget.c (set_frame_size):
      * src/xfaces.c (Fcolor_distance):
      * src/xfns.c (frame_geometry):
      * src/xterm.c (x_set_window_size_1):
      * src/xwidget.c (Fxwidget_size_request):
      Prefer list1i, list2i, etc. to open-coding them.
      * src/charset.c (Fset_charset_priority):
      * src/nsterm.m (append2):
      * src/window.c (window_list):
      * src/xfaces.c (Fx_list_fonts):
      Use nconc2 instead of open-coding it.
      * src/eval.c (eval_sub, backtrace_frame_apply):
      * src/kqueue.c (kqueue_generate_event):
      * src/nsterm.m (performDragOperation:):
      * src/pdumper.c (Fpdumper_stats):
      * src/w32.c (init_environment):
      Prefer list1, list2, etc. to open-coding them.
      * src/font.c (font_list_entities):
      Parenthesize to avoid expanding new ‘list’ macro.
      * src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP
      to get lines to fit.  Move outside the ‘list’ call, since it’s
      now a macro.
      * src/keymap.c (Fmake_keymap): Simplify.
      * src/lisp.h (list, pure_list): New macros.
      (list1i): New function.
      5c2563a5
  24. 15 Feb, 2019 1 commit
  25. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  26. 01 Jan, 2019 1 commit
  27. 07 Dec, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix the value of default-directory upon startup on MS-Windows · e4a8f6eb
      Eli Zaretskii authored
      * src/w32.c (w32_get_current_directory): New function.
      (GetCachedVolumeInformation, init_environment): Use it.
      (w32_init_current_directory): New function.
      * src/w32.h (w32_init_current_directory): Add prototype.
      * src/emacs.c (main) [WINDOWSNT]: Use w32_init_current_directory
      to get the accurate value of cwd.  This is needed to record
      the correct directory in emacs_wd, which is now initialized
      way earlier in the startup process, when init_environment was
      not yet called.  For details, see the problems reported in
      http://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00068.html.
      Reported by Angelo Graziosi <angelo.g0@libero.it>.
      e4a8f6eb
  28. 10 Nov, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix last change · d6b7b60c
      Eli Zaretskii authored
      * src/editfns.c (Fgroup_name): Fix the doc string.  Move
      closer to the "group" functions.
      * src/w32.c (getgrgid): Return NULL if GID is not the group ID
      of the user of this Emacs session
      
      * test/src/editfns-tests.el (test-group-name): Rename from
      'group-name'.  Add tests for non-Posix hosts.  Test error when
      the argument to group-name is invalid.
      
      * etc/NEWS: Fix wording of last added entry.
      d6b7b60c
  29. 06 Nov, 2018 1 commit
  30. 07 Oct, 2018 1 commit
    • Paul Eggert's avatar
      Move timestamp-related stuff to timefns.c · b5d08da1
      Paul Eggert authored
      This does not change behavior; it’s just long-overdue
      refactoring (Bug#32902).
      * src/emacs.c (main): Call init_timefns, syms_of_timefns.
      * src/timefns.c: New file, containing timestamp-related stuff
      from editfns.c and sysdep.c.
      * src/Makefile.in (base_obj): Add timefns.o.
      * src/editfns.c: Simplify by moving a big chunk to timefns.c.
      Do not include systime.h, sys/resource.h, sys/param.h,
      strftime.h, coding.h.
      (HAVE_TZALLOC_BUG, TM_YEAR_BASE, HAVE_TM_GMTOFF, tzeqlen)
      (local_tz, utc_tz, emacs_localtime_rz, emacs_mktime_z)
      (invalid_time_zone_specification, xtzfree, tzlookup)
      (TIME_T_MIN, TIME_T_MAX, time_overflow, invalid_time)
      (check_time_validity, hi_time, lo_time, Fcurrent_time)
      (time_add, time_subtract, time_arith, Ftime_add)
      (Ftime_subtract, Ftime_less_p, Fget_internal_run_time)
      (make_lisp_time, disassemble_lisp_time, decode_float_time)
      (lisp_to_timespec, lisp_time_struct, lisp_time_argument)
      (lisp_seconds_argument, Ffloat_time, emacs_nmemftime)
      (Fformat_time_string, format_time_string, Fdecode_time)
      (check_tm_member, Fencode_time, Fcurrent_time_string)
      (tm_gmtoff, Fcurrent_time_zone, Fset_time_zone_rule)
      (emacs_getenv_TZ, emacs_setenv_TZ): Move to timefns.c.
      * src/emacs.c (main): Adjust to initialization changes.
      * src/sysdep.c: Include <sys/resource.h> if it's present.
      Regularize includes a bit.
      (Fget_internal_run_time): Move here from editfns.c.
      (init_timefns, syms_of_timefns): New functions.
      * src/w32.h (w32_get_internal_run_time): Move decl here
      so that it need not be cloned.
      * test/src/editfns-tests.el:
      * test/src/editfns-tests.el (format-time-string-with-zone)
      (format-time-string-with-outlandish-zone)
      (editfns-tests--have-leap-seconds)
      (format-time-string-with-bignum-on-32-bit):
      Move to ...
      * test/src/timefns-tests.el: ... this new file.
      b5d08da1
  31. 28 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Improve bignum support for system types · d77d01d2
      Paul Eggert authored
      Use bignums when Emacs converts to and from system types like
      off_t for file sizes whose values can exceed fixnum range.
      Formerly, Emacs sometimes generted floats and sometimes ad-hoc
      conses of integers.  Emacs still accepts floats and conses for
      these system types, in case some stray Lisp code is generating
      them, though this usage is obsolescent.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/hash.texi (Defining Hash):
      * doc/lispref/nonascii.texi (Character Sets):
      * doc/lispref/os.texi (User Identification):
      * doc/lispref/processes.texi (System Processes):
      * etc/NEWS:
      Document changes.
      * src/bignum.c (mpz_set_uintmax, make_biguint)
      (mpz_set_uintmax_slow, bignum_to_intmax, bignum_to_uintmax):
      New functions.
      (mpz_set_intmax_slow): Implement via mpz_limbs_write,
      to avoid the need for an extra pass through a negative number.
      * src/charset.c (Fencode_char):
      * src/composite.h (LGLYPH_SET_CODE):
      * src/dired.c (file_attributes):
      * src/dosfns.c, src/w32.c (list_system_processes)
      (system_process_attributes):
      * src/editfns.c (init_editfns, Fuser_uid, Fuser_real_uid)
      (Fgroup_gid, Fgroup_real_gid, Femacs_pid):
      * src/emacs-module.c (check_vec_index):
      * src/fns.c (Fsafe_length):
      * src/process.c (record_deleted_pid, Fprocess_id):
      * src/sysdep.c (list_system_processes, system_process_attributes):
      * src/xselect.c (x_own_selection, selection_data_to_lisp_data):
      * src/xterm.c (set_wm_state):
      * src/inotify.c (inotifyevent_to_event, add_watch)
      (inotify_callback):
      If an integer is out of fixnum range, use a bignum
      instead of converting it to a float or a cons of integers.
      * src/coding.c (Fdefine_coding_system_internal):
      * src/frame.c (frame_windows_min_size)
      (x_set_frame_parameters):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/nsterm.m (mouseDown:):
      * src/syntax.c (find_defun_start):
      * src/w32fns.c (x_set_undecorated, w32_createwindow)
      (w32_wnd_proc, Fx_create_frame, Fx_show_tip)
      (w32_console_toggle_lock_key):
      * src/w32inevt.c (key_event):
      * src/w32proc.c (Fw32_get_locale_info):
      Do not mishandle floats by treating their addresses as their
      values.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_error_fatalp, Fgnutls_error_string):
      * src/keyboard.c (command_loop_1, make_lispy_event):
      * src/lread.c (read_filtered_event, read1)
      (substitute_object_recurse):
      * src/window.c (Fcoordinates_in_window_p, Fwindow_at)
      (window_resize_apply, Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height)
      (calc_line_height_property, on_hot_spot_p):
      * src/xfaces.c (check_lface_attrs):
      * src/xselect.c (x_get_local_selection, cons_to_x_long)
      (lisp_data_to_selection_data, clean_local_selection_data)
      (x_check_property_data, x_fill_property_data):
      (x_send_client_event):
      Do not reject bignums.
      * src/data.c (INTBIG_TO_LISP, intbig_to_lisp)
      (uintbig_to_lisp):
      Remove.  All uses removed.
      * src/data.c (cons_to_unsigned, cons_to_signed):
      * src/dbusbind.c (xd_signature, xd_extract_signed)
      (xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/dosfns.c, src/w32.c (system_process_attributes):
      * src/editfns.c (Fuser_full_name):
      * src/fileio.c (file_offset):
      * src/fileio.c (write_region):
      * src/font.c (font_unparse_xlfd, font_open_for_lface, Fopen_font):
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL, FRAME_PIXEL_X_FROM_CANON_X)
      (FRAME_PIXEL_Y_FROM_CANON_Y):
      * src/image.c (parse_image_spec, x_edge_detection)
      (compute_image_size):
      * src/json.c (json_to_lisp):
      * src/lcms.c (PARSE_LAB_LIST_FIELD, Flcms_cie_de2000)
      (PARSE_XYZ_LIST_FIELD, PARSE_JCH_LIST_FIELD)
      (PARSE_JAB_LIST_FIELD, PARSE_VIEW_CONDITION_FLOAT)
      (Flcms_temp_to_white_point):
      * src/nsimage.m (ns_load_image, setSizeFromSpec):
      * src/process.c (Fsignal_process, handle_child_signal):
      * src/sysdep.c (system_process_attributes):
      * src/xdisp.c (calc_line_height_property):
      Handle bignums.
      * src/data.c (Fnumber_to_string): Use proper predicate name in
      signal if the argument is not a number.
      * src/lisp.h (make_uint): New function.
      (INT_TO_INTEGER): New macro.
      (FIXED_OR_FLOATP, CHECK_FIXNUM_OR_FLOAT)
      (CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER, INTEGER_TO_CONS)
      (make_fixnum_or_float): Remove; no longer used.
      * src/nsfns.m, src/w32fns.c, src/xfns.c (Fx_create_frame):
      Reject floating-point min-width or min-height.
      * src/process.c (handle_child_signal): Do not worry
      about floating-point pids, as they are no longer generated.
      d77d01d2
  32. 17 Aug, 2018 1 commit
    • Andy Moreton's avatar
      Pacify -Wcast-function-type warnings in GCC 8.1 · cc5325b0
      Andy Moreton authored
      * src/image.c: Move attributes into DEF_DLL_FN call.
      * src/dynlib.c (dynlib_addr): Use get_proc_addr.
      * src/w32.h: (get_proc_addr): New function.
      (LOAD_DLL_FN): Use it.
      (DEF_DLL_FN): Allow function attributes after argument
      list.  Add function pointer type used by LOAD_DLL_FN.
      * src/w32.c (open_process_token, get_token_information)
      (lookup_account_sid, get_sid_sub_authority)
      (get_sid_sub_authority_count, get_security_info)
      (get_file_security, set_file_security)
      (set_named_security_info)
      (get_security_descriptor_owner, get_security_descriptor_group)
      (get_security_descriptor_dacl, is_valid_sid, equal_sid)
      (get_length_sid, copy_sid, get_native_system_info)
      (get_system_times, create_symbolic_link)
      (is_valid_security_descriptor, convert_sd_to_sddl)
      (convert_sddl_to_sd, get_adapters_info, reg_open_key_ex_w)
      (reg_query_value_ex_w, expand_environment_strings_w)
      (init_environment, create_toolhelp32_snapshot)
      (process32_first, process32_next, open_thread_token)
      (impersonate_self, revert_to_self, get_process_memory_info)
      (get_process_working_set_size, global_memory_status)
      (global_memory_status_ex, init_winsock)
      (maybe_load_unicows_dll, globals_of_w32): Use get_proc_addr.
      * src/w32fns.c (setup_w32_kbdhook, Ffile_system_info)
      (get_dll_version, w32_reset_stack_overflow_guard)
      (w32_backtrace, globals_of_w32fns): Use get_proc_addr.
      * src/w32font.c (get_outline_metrics_w, get_text_metrics_w)
      (get_glyph_outline_w, get_char_width_32_w): Use get_proc_addr.
      * src/w32heap.c (init_heap): Use get_proc_addr.
      * src/w32menu.c (globals_of_w32menu): Use get_proc_addr.
      * src/w32proc.c (init_timers, sys_kill, w32_compare_strings):
      Use get_proc_addr.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Use get_proc_addr.
      cc5325b0
  33. 12 Aug, 2018 1 commit
    • Eli Zaretskii's avatar
      ; Avoid compilation warnings under -Og · d9806a55
      Eli Zaretskii authored
      * src/w32.c (w32_read_registry):
      * src/font.c (font_parse_fcname):
      * src/fns.c (Fnconc):
      * src/editfns.c (tzlookup):
      * src/frame.c (x_set_frame_parameters): Avoid compiler warnings
      about maybe-uninitialized variables.
      d9806a55
  34. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  35. 16 Jul, 2018 1 commit
    • Robert Pluim's avatar
      Implement hostname->ip lookup function · e89c06e8
      Robert Pluim authored
      * src/process.c (conv_sockaddr_to_lisp): Add include_port
      argument.  Don't put a port in the result if this is false.
      (conv_addrinfo_to_lisp, Fprocess_datagram_address)
      (connect_network_socket, network_interface_list)
      (network_interface_info, server_accept_connection)
      (init_process_emacs): Update callers.
      (Fnetwork_lookup_address_info): New function.  Performs hostname to
      ip address lookups.
      
      * src/w32.c (network_interface_get_info): Update callers of
        conv_sockaddr_to_lisp
      
      * etc/NEWS : mention addition of 'network-lookup-address-info'
      e89c06e8
  36. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  37. 30 Jun, 2018 1 commit
  38. 29 May, 2018 1 commit
    • Eli Zaretskii's avatar
      Allow access to MS-Windows Registry from Lisp programs · 5be83e34
      Eli Zaretskii authored
      * src/w32.c (g_b_init_reg_open_key_ex_w)
      (g_b_init_reg_query_value_ex_w)
      (g_b_init_expand_environment_strings_w): New init flags.
      (globals_of_w32): Initialize them at startup.
      (RegOpenKeyExW_Proc, RegQueryValueExW_Proc)
      (ExpandEnvironmentStringsW_Proc): New function typedefs.
      (reg_open_key_ex_w, reg_query_value_ex_w)
      (expand_environment_strings_w): New wrapper function.
      (w32_read_registry): New function.
      * src/w32fns.c (Fw32_read_registry) [WINDOWSNT]: New primitive.
      (syms_of_w32fns) [WINDOWSNT]: Defsubr it.  DEFSYM "HKLM", "HKCU",
      etc. root keys.
      
      * etc/NEWS: Mention the new primitive.
      5be83e34