summaryrefslogtreecommitdiff
path: root/src/w32.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid crashes on MS-Windows due to invalid UNC file namesEli Zaretskii2024-05-221-1/+1
| | | | | | | * src/w32.c (parse_root): Avoid crashes due to invalid (too short) UNC names, such as "\\". (Bug#70914) * test/src/fileio-tests.el (fileio-tests-invalid-UNC): New test.
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Fix broken links to gmane.orgStefan Kangas2023-10-241-1/+1
|
* Fix compilation of w32.c with old MinGW system headersEli Zaretskii2023-04-131-1/+8
| | | | | | * src/w32.c (CONSOLE_FONT_INFO): Make sure the definition is not visible for MinGW versions whose w32api's version is before 5.2.0. (Bug#52792)
* ; Fix last change (bug#60556).Eli Zaretskii2023-01-221-12/+13
|
* Avoid crashes in batch Emacs sub-processes on MS-WindowsEli Zaretskii2023-01-221-13/+31
| | | | | | | | * src/w32.c (shutdown_handler): When run in a separate thread, don't call functions that only the main (a.k.a. "Lisp") thread can call; instead, arrange for maybe_quit to kill Emacs. * src/w32fns.c (emacs_abort): Don't show GUI Abort dialogs in non-interactive sessions. (Bug#60556)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Don't follow symlinks in w32notify file watchesEli Zaretskii2022-09-071-0/+11
| | | | | | | * src/w32notify.c (add_watch): On filesystems that support symlinks, don't follow symlinks. (Bug#57536) * src/w32.c (symlinks_supported): New function. * src/w32.h (symlinks_supported): Add prototype.
* Allow symlink creation on MS-Windows without Administrator privilegesKien Nguyen2022-08-251-2/+12
| | | | | | * src/w32.c (symlink): Use the SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag when available. (Bug#57386)
* Fix leaking of file descriptors due to pipe processes on MS-WindowsEli Zaretskii2022-07-171-5/+18
| | | | | | | | | * src/w32proc.c (reader_thread): Wait for 'sys_close' to finish processing the pipe read descriptor, before trying to close it. * src/w32.c (sys_close): Attempt to detect when the reader thread already exited, so that it would be possible to close descriptors open by pipe processes for reading from the pipe. (Bug#56606)
* Fix some missed Fplist_put adjustments in src/w32.cLars Ingebrigtsen2022-06-271-6/+6
| | | | * src/w32.c (serial_configure): Adjust some missed Fplist_put renames.
* Allow plist-get/plist-put/plist-member to take a comparison functionLars Ingebrigtsen2022-06-271-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/lists.texi (Plist Access): Document it. * lisp/filesets.el (filesets-reset-fileset) (filesets-ingroup-cache-get): (filesets-ingroup-cache-put): (filesets-build-menu-now): Don't use lax-plist functions. * lisp/simple.el (lax-plist-put, lax-plist-get): Moved here from fns.c and make obsolete. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Don't mark plist functions as side-effect-free or pure. * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Adjust type. * lisp/emacs-lisp/shortdoc.el (list): Don't document deprecated functions. * src/xdisp.c (build_desired_tool_bar_string): (display_mode_element): (store_mode_line_string): (display_string): (produce_stretch_glyph): (note_mode_line_or_margin_highlight): (note_mouse_highlight): * src/w32.c (serial_configure): * src/sysdep.c (serial_configure): * src/sound.c (parse_sound): * src/process.c (Fset_process_buffer): (Fset_process_sentinel): (Fprocess_contact): (Fmake_process): (Fmake_pipe_process): (Fset_network_process_option): (Fserial_process_configure): (Fmake_serial_process): (set_network_socket_coding_system): (finish_after_tls_connection): (connect_network_socket): (Fmake_network_process): (server_accept_connection): * src/lread.c (ADDPARAM): (hash_table_from_plist): * src/keyboard.c (make_lispy_position): * src/indent.c (check_display_width): * src/image.c (postprocess_image): * src/gnutls.c (gnutls_verify_boot): (Fgnutls_boot): (gnutls_symmetric): (Fgnutls_hash_mac): (Fgnutls_hash_digest): * src/dired.c (filter): * src/data.c (add_to_function_history): * src/coding.c (Fcoding_system_put): Adjust callers from Fplist_put (etc) to plist_put. * src/fns.c (plist_get): (plist_put): (plist_member): New functions (without optional third parameter) to be used in C code. * src/fns.c (Fplist_get, Fplist_put, Fplist_member): Take an optional predicate parameter (bug#47425). * src/lisp.h: Declare new plist_put, plist_get and plist_member functions. * test/lisp/json-tests.el (test-json-add-to-plist): Use plist-get. * test/src/fns-tests.el (test-cycle-lax-plist-get): (test-cycle-lax-plist-put): (lax-plist-get/odd-number-of-elements): (test-plist): Remove lax-plist tests, since semantics have changed (they no longer error out on cycles).
* Adjust more prin1-to-string callersLars Ingebrigtsen2022-05-151-1/+2
| | | | | | | | | | * src/w32.c (check_windows_init_file): * src/comp.c (Lisp_Object): (emit_lisp_obj_reloc_lval): (emit_lisp_obj_rval): (emit_mvar_rval): (emit_limple_insn): (emit_static_object): Adjust prin1-to-string callers.
* Emulate 'clock' for MS-WindowsEli Zaretskii2022-04-271-0/+29
| | | | | * src/w32.c (sys_clock): New function. (Bug#44674) * nt/inc/ms-w32.h (clock): Redirect to sys_clock.
* Unbreak build with MinGW64.Eli Zaretskii2022-04-211-0/+4
| | | | | | * src/w32.c (CONSOLE_FONT_INFO): Define only when _WIN32_WINNT is less than _WIN32_WINNT_WINXP, i.e. for building with mingw.org's MinGW.
* Fix dimensions of console window of restarted Emacs on MS-WindowsEli Zaretskii2022-04-191-4/+68
| | | | | | | * src/w32.c (get_console_font_size): New function. (w32_reexec_emacs): Call 'get_console_font_size' to set up the dimensions of the restarted Emacs's console window to the same values as that of the original Emacs.
* Minor improvements in 'restart-emacs' on MS-WindowsEli Zaretskii2022-04-181-23/+28
| | | | | | | | * src/w32.c (w32_reexec_emacs): Explicitly request a new console for the restarted Emacs -nw, and specify its dimensions. Specify NULL instead of security attributes, per examples on the Internet. * src/w32console.c (initialize_w32_display): Check errors in call to GetConsoleCursorInfo.
* Fix 'restart-emacs' in -nw mode on MS-WindowsEli Zaretskii2022-04-181-7/+21
| | | | | | * src/w32.c (openat): #ifdef away: not used. (w32_reexec_emacs): Kludgey solution for restarting Emacs in the "-nw" mode.
* ; Minor fix for 'restart-emacs' on MS-WindowsEli Zaretskii2022-04-171-0/+6
| | | | | * src/w32.c (w32_reexec_emacs): Fail if in -nw session. * src/emacs.c (Fkill_emacs): Fix a typo.
* Fix 'restart-emacs' on MS-WindowsEli Zaretskii2022-04-171-0/+43
| | | | | | | | | | * src/w32.c (w32_reexec_emacs): New function, emulation of 'execvp' on Posix systems. * src/w32.h (w32_reexec_emacs): Add prototype. * src/emacs.c (main) [WINDOWSNT]: Save the original command line and working directory. (Fkill_emacs) [WINDOWSNT]: Call 'w32_reexec_emacs' instead of 'execvp'. (Bug#17036)
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Fix hang when deleting a pipe processEli Zaretskii2021-12-111-5/+23
| | | | | | | | | | | | | | | | | | | | | | * src/w32.h (FILE_DONT_CLOSE): New flag. * src/w32.c (sys_close): Don't close descriptors used to read from the pipe process. Leave the FILE_DONT_CLOSE flag set in the descriptor's info. (register_aux_fd): Set the FILE_DONT_CLOSE flag in the descriptor's info. * src/w32proc.c (reader_thread): When exiting normally, close the file descriptor used to read from a pipe process. (Bug#52414)
* | Merge from origin/emacs-28Stefan Kangas2021-11-121-5/+7
|\| | | | | | | | | | | a6905e90cc Fix problem with temp buffer killing in package-install-file 144ad77fda Fix Lisp Intro markup error 24b86cb4f7 Fix ACL errors with WebDAV volumes on MS-Windows
| * Fix ACL errors with WebDAV volumes on MS-WindowsEli Zaretskii2021-11-111-5/+7
| | | | | | | | | | | | * src/w32.c (acl_get_file): Handle ERROR_INVALID_FUNCTION from WebDAV. Patch from Ioannis Kappas <ioannis.kappas@gmail.com>. (Bug#51773)
* | A better fix for bug#51583Eli Zaretskii2021-11-031-54/+0
| | | | | | | | | | | | | | | | * src/w32.c (w32_get_resource): Move from here... * src/w32fns.c (w32_get_resource): ...to here. (w32_applytheme): No longer a no-op for Cygwin w32 builds. (globals_of_w32fns): Do attempt to load dwmapi.dll and uxtheme.dll in the Cygwin w32 build.
* | Support system dark mode on Windows 10 version 1809 and higherVince Salvino2021-10-301-8/+15
|/ | | | | | | | | | | | | | | | * src/w32fns.c (DARK_MODE_APP_NAME) (DWMWA_USE_IMMERSIVE_DARK_MODE_OLD) (DWMWA_USE_IMMERSIVE_DARK_MODE): Define. (w32_applytheme): New function. (w32_createvscrollbar, w32_createhscrollbar, w32_createwindow): Call 'w32_applytheme'. (globals_of_w32fns): Load 'DwmSetWindowAttribute' and 'SetWindowTheme' from their DLLs, and initialize 'w32_darkmode'. * src/w32.c (w32_get_resource): Accept an additional argument instead of hard-coding REG_ROOT; callers changed. (Bug#51404) * etc/NEWS: * doc/emacs/msdos.texi (Windows Misc): Document the new feature.
* Adapt the recent 'num_processors' change to MS-WindowsEli Zaretskii2021-10-111-0/+11
| | | | | | | * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_nproc): Omit nproc. * src/w32.c (num_processors): New function. * src/w32proc.c (Fw32_get_nproc): Remove.
* * src/w32.c (_sys_read_ahead): Pacify a silly compiler warning.Eli Zaretskii2021-08-141-1/+1
|
* Fix 'random' on MS-Windows when integers are wider than 30 bitsEli Zaretskii2021-08-141-1/+6
| | | | | * src/w32.c (random): Provide more random bits for MS-Windows builds with EMACS_INT that is wider than 32 bits. (Bug#32605)
* Fix resolution of symlinks during dumpingEli Zaretskii2021-05-271-0/+39
| | | | | | | | | | | | | * src/comp.c (Fcomp_el_to_eln_rel_filename): Don't use 'file-truename', as it is only available once files.el is loaded, which doesn't work during dumping, until loadup loads files.el. Instead, use 'realpath'. (Bug#48578) * src/w32.c (realpath): New function. * src/w32.h (realpath): Add prototype. * nt/mingw-cfg.site (ac_cv_func_realpath) (gl_cv_func_realpath_works): Define to "yes", as this function is now implemented in w32.c.
* Merge from origin/emacs-27Glenn Morris2021-05-131-2/+2
|\ | | | | | | | | | | | | | | | | | | | | bcd92b5708 (origin/emacs-27) Improve documentation of Hexl mode c233f4eccd ; * etc/NEWS: Fix decoded-time-set-defaults typo. 4c3abb3dd1 Fix compilation errors with latest w32 API headers 127f1f330b Improve doc strings in log-edit.el e36183ff46 ; * etc/TODO (etc/DOC): Update the todo entries. # Conflicts: # etc/NEWS
| * Fix compilation errors with latest w32 API headersEli Zaretskii2021-05-091-2/+2
| | | | | | | | | | | | * src/w32common.h: Rename OS_* to OS_SUBTYPE__*, as w32 API headers started defining OS_NT, which breaks the use of the enumeration. All users changed. (Bug#48303)
* | Do not load native code when `load' is explicitly called on a .elc fileAndrea Corallo2021-03-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/lread.c (Fload): Do not load native code when `load' is explicitly called on a .elc file. (Flocate_file_internal): Update 'openp' call sites. (maybe_swap_for_eln): Add new 'no_native' parameter. (openp): Likewise + update 'maybe_swap_for_eln' and 'openp' call sites. * src/lisp.h: Update 'openp' signature. * src/w32proc.c (sys_spawnve): Update 'openp' call sites. * src/w32.c (check_windows_init_file): Likewise. * src/sound.c (Fplay_sound_internal): Likewise. * src/process.c (Fmake_process): Likewise. * src/image.c (image_create_bitmap_from_file) (image_find_image_fd): Likewise. * src/emacs.c (set_invocation_vars): Likewise. * src/charset.c (load_charset_map_from_file): Likewise. * src/callproc.c (call_process): Likewise.
* | Avoid aborts in native-comp subprocesses when exiting Emacs on WindowsEli Zaretskii2021-03-071-0/+7
| | | | | | | | | | | | | | * src/w32.c (shutdown_handler): Clear the message stack when being shut down in noninteractive mode, to avoid aborting in shut_down_emacs when a native-compilation subprocess is killed because the parent Emacs exits.
* | Use MS-Windows system APIs to get number of processorsEli Zaretskii2021-03-071-3/+11
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el: Use 'w32-get-nproc' instead of the environment variable NUMBER_OF_PROCESSORS. * src/w32proc.c (Fw32_get_nproc): New primitive. * src/w32.c (w32_get_nproc): New function. (sample_system_load): Call w32_get_nproc to initialize the number of processors on this system. * src/w32.h (w32_get_nproc): Add prototype.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-02-211-0/+51
|\ \
| * | Merge from origin/emacs-27Glenn Morris2021-02-191-0/+51
| |\| | | | | | | | | | | | | | | | 4712c75ab8 Clarify when activate-mark-hook is run abedf3a865 Fix language-environment and font selection on MS-Windows 8b8708eadd Fix example in Sequence Functions node in the manual
| | * Fix language-environment and font selection on MS-WindowsEli Zaretskii2021-02-071-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes improve setting the language-environment and font selection when MS-Windows returns useless "ZZZ" as the "language name", which then disrupts all the setup of the locale-dependent stuff, and in particular font selection. * lisp/w32-fns.el (w32-charset-info-alist): Add an element for "iso8859-5", in case LANG is set to something unusable, like "ZZZ". This allows fonts capable of displaying Cyrillic characters to be used even when language preferences are screwed. * src/w32.c (init_environment): If GetLocaleInfo returns "ZZZ" as the "language name" for LOCALE_USER_DEFAULT, try again with locale ID based on what GetUserDefaultUILanguage returns. (Bug#39286)
| | * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-01-021-1/+6
|\| |
| * | Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | | | | | Run "TZ=UTC0 admin/update-copyright".
| * | A better fix for process-tests on MS-WindowsEli Zaretskii2020-12-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.c (pipe2): When forcibly closing pipe handles due to overflow of FD_SETSIZE, set the handles to -1, to avoid assertion violations in emacs_close. * test/src/process-tests.el (process-tests/fd-setsize-no-crash): No need to skip this test anymore.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-10-101-6/+6
|\| |
| * | Use the full name of the null byte/character, not its abbreviationAndreas Schwab2020-10-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/subr.el (inhibit-nul-byte-detection): Make it an obsolete alias. * src/coding.c (setup_coding_system): Use original name. (detect_coding): Rename nul_byte_found => null_byte_found. (detect_coding_system): Use original name. Rename nul_byte_found => null_byte_found. (Fdefine_coding_system_internal): Use original name. (syms_of_coding): Rename inhibit-nul-byte-detection to inhibit-null-byte-detection. * src/w16select.c (get_clipboard_data): Rename nul_char to null_char. * src/json.c (check_string_without_embedded_nulls): Rename from check_string_without_embedded_nuls. (Fjson_parse_string): Adjust accordingly. * src/coding.h (enum define_coding_undecided_arg_index) (enum coding_attr_index): Rename ...nul_byte... to ...null_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 original name.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-10-041-2/+7
|\| |
| * | Merge from origin/emacs-27Glenn Morris2020-10-021-2/+7
| |\| | | | | | | | | | | | | | | | | | | | | | 2af6b3147d Clarification in Tramp manual 8fbaca7d41 Check Emacs version used for Tramp compilation 90e5549f02 Don't signal an error when saving files on WdebDAV volumes 6f73cc3579 ; * lisp/net/eww.el (eww-search-words): Doc fix. ce0842a165 * lisp/hi-lock.el (hi-lock-find-patterns): Autoload it. (...
| | * Don't signal an error when saving files on WdebDAV volumesEli Zaretskii2020-09-291-2/+7
| | | | | | | | | | | | | | | * src/w32.c (acl_get_file): If get_file_security raises the ERROR_ACCESS_DENIED error, treat that like unsupported ACLs.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-05-241-1/+11
|\| |
| * | Merge from origin/emacs-27Glenn Morris2020-05-231-1/+11
| |\| | | | | | | | | | | | | | | | | | | | | | | | | d6a0b66a0c (origin/emacs-27) * lisp/subr.el (save-match-data): Clarif... 1a6d59eeba Improve the documentation of setting up fontsets c7737d40f2 ; * etc/TODO (Ligatures): Update the entry based on recent... fb2e34cd21 ; * etc/TODO (Ligatures): Update the entry based on recent... 13b6dfd4f7 * doc/emacs/killing.texi (Rectangles): Improve indexing. a10254dd46 Fix accessing files on networked drives on MS-Windows