summaryrefslogtreecommitdiff
path: root/src/w32.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix 'expand-file-name' during startup on MS-WindowsEli Zaretskii2016-11-281-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.c (w32_init_file_name_codepage): New function, resets file_name_codepage and w32_ansi_code_page to undo the values recorded during dumping. (codepage_for_filenames): Fix an embarrassing typo. Ignore the cached value of file-name encoding if it is nil, i.e. not initialized yet. Actually cache the last used file-name encoding to avoid calling APIs when not necessary. * src/w32.h (w32_init_file_name_codepage): Add prototype. * src/w32term.c (syms_of_w32term): Set the value of w32_unicode_filenames according to the OS version. This avoids resetting it during startup, which then causes temacs to run with the incorrect value. * src/emacs.c (main): Call w32_init_file_name_codepage early during the startup. * src/fileio.c (Fexpand_file_name) [WINDOWSNT]: Update 'newdir' after converting $HOME to a UTF-8 string, so that 'newdirlim' is consistent with it. (Bug#25038) * lisp/international/mule-cmds.el (set-locale-environment): Set 'default-file-name-coding-system' to the ANSI codepage even in non-interactive sessions. * lisp/files.el (directory-abbrev-alist, abbreviated-home-dir): Doc fix. (abbreviate-file-name): Decode 'abbreviated-home-dir' if it is a unibyte string. * doc/lispref/files.texi (Directory Names): Index 'directory-abbrev-alist'.
* Fixup warning message regarding HOME a bit moreNoam Postavsky2016-06-271-3/+3
| | | | | * src/w32.c (init_environment): The manual section title is "Windows HOME" (Bug #11612). Move newline so warning fits in 80 character lines.
* ; Fix typo in commit before lastNoam Postavsky2016-06-271-2/+2
|
* Give more helpful warning about setting HOMENoam Postavsky2016-06-261-4/+7
| | | | | | | * src/w32.c (init_environment): Improve warning message that pops when Emacs sets HOME according to existence of C:\.emacs (Bug #11612). Co-authored-by: Eli Zaretskii <eliz@gnu.org>
* Rework C source files to avoid ^(Paul Eggert2016-03-101-2/+2
| | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* Disable DebPrint in sys_read on MS-WindowsEli Zaretskii2016-01-301-1/+11
| | | | | * src/w32.c (sys_read): Disable a debugging print that is normal when non-blocking reads are retried.
* Expunge "allow" + infinitive without direct object from source and doc.Alan Mackenzie2016-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do the same for "permit", "enable", and "prevent". * doc/emacs/mule.texi: * doc/lispref/control.texi: * doc/lispref/display.texi: * doc/lispref/frames.texi: * doc/lispref/functions.texi: * doc/lispref/nonascii.texi: * doc/lispref/streams.texi: * doc/lispref/windows.texi: * doc/misc/dbus.texi: * doc/misc/eww.texi: * doc/misc/flymake.texi: * doc/misc/octave-mode.texi: * doc/misc/org.texi: * doc/misc/reftex.texi: * doc/misc/tramp.texi: * doc/misc/wisent.texi: * etc/NEWS: * lisp/autorevert.el: * lisp/cedet/mode-local.el: * lisp/cedet/semantic/senator.el: * lisp/cedet/semantic/wisent.el: * lisp/dos-fns.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/mm-util.el: * lisp/international/characters.el: * lisp/ldefs-boot.el: * lisp/mail/mailclient.el: * lisp/man.el: * lisp/mh-e/mh-search.el: * lisp/net/tramp-cmds.el: * lisp/net/tramp-gvfs.el: * lisp/org/org-crypt.el: * lisp/org/org-element.el: * lisp/org/org-feed.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-icalendar.el: * lisp/org/ox-publish.el: * lisp/org/ox.el: * lisp/play/gamegrid.el: * lisp/play/gomoku.el: * lisp/progmodes/antlr-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/vhdl-mode.el: * lisp/strokes.el: * lisp/textmodes/ispell.el: * lisp/tree-widget.el: * lisp/vc/pcvs.el: * lisp/window.el: * src/lisp.h: * src/w32.c: * src/w32heap.c: * src/w32term.c: * src/window.c: * src/xfaces.c: Replace solecisms like "This allow to do something" with a correct alternative, such as "This allow you to do something", "This allows something to be done" or "This allows the doing of something".
* Fix incompatbilities with MS-Windows 2000 and olderJussi Lahdenniemi2016-01-161-8/+15
| | | | | | | | | | | | | | | | | | | * src/w32.c <multiByteToWideCharFlags>: New global variable. (filename_to_utf16, filename_from_ansi, check_windows_init_file): Use it instead of the literal MB_ERR_INVALID_CHARS. (maybe_load_unicows_dll): Initialize multiByteToWideCharFlags as appropriate for the underlying OS version. For details, see http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00835.html. * src/w32.h: Declare multiByteToWideCharFlags. * src/w32fns.c (Fx_file_dialog, Fw32_shell_execute) (add_tray_notification): Use multiByteToWideCharFlags instead of the literal MB_ERR_INVALID_CHARS. (_resetstkoflw_proc): New typedef. (w32_reset_stack_overflow_guard): Call _resetstkoflw via a pointer, as this function is absent in msvcrt.dll shipped with W2K and older systems. Copyright-paperwork-exempt: yes
* Make 'random' seeds cryptographically secure if possibleEli Zaretskii2016-01-151-0/+32
| | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Check for "/dev/urandom". * src/sysdep.c (init_random) [HAVE_DEV_URANDOM]: Read the stream for the seed from "/dev/urandom". [WINDOWSNT]: Obtain the stream for the seed from w32 APIs. * src/fns.c (Frandom): Update the doc string to indicate that system entropy is used when available. * src/w32.c: Include wincrypt.h. (w32_init_crypt_random, w32_init_random): New functions, use the CryptGenRandom API. (globals_of_w32): Initialize w32_crypto_hprov handle to zero. * src/w32.h (w32_init_random): Add prototype. * doc/lispref/numbers.texi (Random Numbers): Document more details about 't' as the argument to 'random'. * etc/NEWS: Mention that '(random t)' now uses a cryptographically strong seed if possible. (Bug#22202)
* Make piping to subprocesses more robust on MS-WindowsEli Zaretskii2016-01-121-8/+31
| | | | | | | | | | | | | | | * src/w32.c (sys_write): Don't write to a pipe more stuff than its buffer can hold. Don't return -1 if something has been written to the pipe. Zero out 'errno' before calling '_write', to avoid returning a stale value. (Bug#22344) * src/w32proc.c (syms_of_ntproc) <w32-pipe-buffer-size>: New variable. * src/w32.c (pipe2): Use it to request a user-defined size for the pipe being created. * etc/NEWS: Mention 'w32-pipe-buffer-size'. * doc/emacs/msdos.texi (Windows Processes): Document 'w32-pipe-buffer-size'.
* Avoid unnecessary failures of auto-saving after fatal errorEli Zaretskii2016-01-111-1/+2
| | | | | | | | | | * src/w32.c (map_w32_filename): Avoid non-trivial system calls for the benefit of FAT volumes if we are called as part of shutting down due to a fatal error, which probably means we are trying to auto-save the session. * src/lread.c (check_obarray): Don't bother making the obarray valid if we are shutting down due to a fatal error. This avoids interfering with auto-saving the crashed session.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Avoid some compiler warnings in w32.cEli Zaretskii2015-12-301-10/+10
| | | | | | | * src/w32.c (codepage_for_filenames, crlf_to_lf) (ansi_encode_filename, socket_to_fd, sys_write) (check_windows_init_file): Avoid compiler warnings about differences in pointer signedness.
* Fix compiler warnings in w32.cEli Zaretskii2015-11-261-3/+5
| | | | | | | | * src/w32.c (sys_socket): In case of error, use -1 as return value, not INVALID_SOCKET, which causes compiler warnings. (maybe_load_unicows_dll): Cast the return value of GetProcAddress to the appropriate function signature, to avoid compiler errors. Reported by Andy Moreton <andrewjmoreton@gmail.com>. (Bug#21953)
* Improve MS-Windows implementation in dynlib.cEli Zaretskii2015-11-201-0/+5
| | | | | | | | | | | | | | | | | | | | * src/dynlib.c [WINDOWSNT]: Include errno.h, lisp.h, and w32.h. No need to include windows.h, as w32.h already does that. <dynlib_last_err>: New static variable. (dynlib_reset_last_error): New function. (dynlib_open): Convert forward slashes to backslashes. Convert file names from UTF-8 to either UTF-16 or the current ANSI codepage, and call either LoadLibraryW or LoadLibraryA. If the argument is NULL, return a handle to the main module, like 'dlopen' does. Record the error, if any, for use by dynlib_error. (dynlib_sym): Check the handle for validity. Record the error, if any, for use by dynlib_error. (dynlib_error): Call w32_strerror to produce the error string, and zero out the last error code, like dlerror does. (dynlib_close): Check the handle for validity. Record the error, if any, for use by dynlib_error. Don't call FreeLibrary with a handle for the main module. * src/w32.c (globals_of_w32): Call dynlib_reset_last_error.
* Include file cleanup for w32 files in src directoryEli Zaretskii2015-10-221-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32xfns.c: Don't include keyboard.h, window.h, charset.h, fontset.h, blockinput.h. * src/w32uniscribe.c: Don't include dispextern.h, character.h, charset.h, fontset.h. * src/w32term.c: Don't include systty.h, systime.h, charset.h, character.h, ccl.h, dispextern.h, disptab.h, intervals.h, process.h, atimer.h, keymap.h, w32heap.h. Include bitmap/gray.xbm in an ifdef-ed away block. Include fcntl.h for CYGWIN. (set_frame_param): Remove unused function. * src/w32select.c: Don't include charset.h and composite.h. (setup_config, Fw32_get_clipboard_data): Avoid compiler warnings due to pointer signedness mismatches. * src/w32reg.c (w32_get_string_resource): Avoid compiler warnings due to pointer signedness mismatches. * src/w32proc.c: Include unistd.h. Don't include systime.h, process.h, dispextern.h. (sys_spawnve, Fw32_short_file_name, Fw32_long_file_name) (Fw32_application_type): Avoid compiler warnings due to pointer signedness mismatches. * src/w32menu.c: Don't include keymap.h, termhooks.h, window.h, character.h, charset.h, dispextern.h. (simple_dialog_show, add_menu_item): Avoid compiler warnings due to pointer signedness mismatches. * src/w32inevt.c: Don't include dispextern.h, window.h, termhooks.h, w32heap.h. * src/w32font.c: Don't include dispextern.h, character.h, charset.h, fontset.h, font.h. (intern_font_name, add_font_entity_to_list) (registry_to_w32_charset, w32_to_x_charset, fill_in_logfont) (list_all_matching_fonts): Avoid compiler warnings due to pointer signedness mismatches. * src/w32fns.c: Don't include character.h, intervals.h, dispextern.h, epaths.h, charset.h, ccl.h, fontset.h, systime.h, termhooks.h, w32heap.h, bitmap/gray.xbm, font.h, w32font.h. (w32_color_map_lookup, add_system_logical_colors_to_map) (x_decode_color, x_set_name, FPRINTF_WM_CHARS, Fxw_color_defined_p) (Fxw_color_values, x_display_info_for_name, Fset_message_beep) (x_create_tip_frame, Fx_file_dialog, Fsystem_move_file_to_trash) (w32_parse_hot_key, Ffile_system_info, w32_kbd_patch_key): Avoid compiler warnings, mainly due to pointer signedness mismatches. (unwind_create_frame_1): Remove unused function. * src/w32console.c: Don't include character.h, disptab.h, frame.h, window.h, termhooks.h, dispextern.h. (w32con_write_glyphs, w32con_write_glyphs_with_face): Fix pointer signedness mismatch. * src/w32.c: Include c-strcase.h and systty.h. Don't include w32heap.h.
* Fix deletion of symlinks to directories on MS-WindowsEli Zaretskii2015-09-071-4/+29
| | | | | | | * src/w32.c (sys_unlink): If 'unlink' fails, and the argument is a symlink to a directory, try again with 'rmdir'. (is_symlink): If the argument is a symlink to a directory, set a bit in the return value to indicate that fact.
* Fix directory accessibility tests for w32 network volumesEli Zaretskii2015-08-311-1/+20
| | | | | | | * src/w32.c (faccessat): Don't fail with network volumes without a share. (w32_accessible_directory_p): Handle network volumes without a share.
* Fix handling long file names in readdir on MS-WindowsEli Zaretskii2015-08-311-5/+18
| | | | | | * src/w32.c (sys_readdir): Append "\*" to the directory after converting it to UTF-16/ANSI, not before, to avoid overflowing the 260-character limit on file names in filename_to_utf16/ansi.
* Make file-accessible-directory-p reliable on MS-WindowsEli Zaretskii2015-08-311-0/+51
| | | | | | | | | | * src/w32.c (w32_accessible_directory_p): New function. * src/w32.h (w32_accessible_directory_p): Add prototype. * src/fileio.c (file_accessible_directory_p) [WINDOWSNT]: Call w32_accessible_directory_p to test a directory for accessibility by the current user. (Bug#21346) (Ffile_accessible_directory_p): Remove the w32 specific caveat from the doc string.
* Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPSPaul Eggert2015-08-261-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need for GCPRO1 etc. Suggested by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html * doc/lispref/internals.texi (Writing Emacs Primitives): * etc/NEWS: Document the change. * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies) (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live) (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise): * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]: * src/eval.c (gcpro_level) [DEBUG_GCPRO]: * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK) (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS) (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES) (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6) (GCPRO7, UNGCPRO, RETURN_UNGCPRO): Remove. All uses removed. The code now assumes GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. * src/bytecode.c (relocate_byte_stack): Rename from unmark_byte_stack, since it now only relocates. All callers changed. * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2 with GCPROs removed. * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1. * test/automated/finalizer-tests.el (finalizer-basic) (finalizer-circular-reference, finalizer-cross-reference) (finalizer-error): * test/automated/generator-tests.el (cps-test-iter-close-finalizer): Remove tests, as they depend on gc-precise.
* Support long URLs in w32-shell-executeEli Zaretskii2015-07-301-1/+1
| | | | | | | | | | * src/w32fns.c (Fw32_shell_execute): Don't use filename_to_utf16 and filename_to_ansi to convert the DOCUMENT argument, as it could be a URL that is not limited to MAX_PATH characters. Instead, use MultiByteToWideChar directly, and allocate heap storage as required to accommodate the converted string. Likewise with non-Unicode operation. Ensure OPERATION is null-terminated, even if it is longer than 32K bytes. (Bug#21158)
* Add facility to collect stderr of async subprocessDaiki Ueno2015-04-111-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.h (register_aux_fd): New function declaration. * src/w32.c (register_aux_fd): New function. * src/process.h (struct Lisp_Process): New member stderrproc. * src/process.c (PIPECONN_P): New macro. (PIPECONN1_P): New macro. (Fdelete_process, Fprocess_status, Fset_process_buffer) (Fset_process_filter, Fset_process_sentinel, Fstop_process) (Fcontinue_process): Handle pipe process specially. (create_process): Respect p->stderrproc. (Fmake_pipe_process): New function. (Fmake_process): Add new keyword argument :stderr. (wait_reading_process_output): Specially handle a pipe process when it gets an EOF. (syms_of_process): Register Qpipe and Smake_pipe_process. * doc/lispref/processes.texi (Asynchronous Processes): Document `make-pipe-process' and `:stderr' keyword of `make-process'. * lisp/subr.el (start-process): Suggest to use `make-process' handle standard error separately. * test/automated/process-tests.el (process-test-stderr-buffer) (process-test-stderr-filter): New tests. * etc/NEWS: Mention new process type `pipe' and its usage with the `:stderr' keyword of `make-process'.
* Fix blocking connections on MS-Windows (Bug#20159)Eli Zaretskii2015-03-281-1/+1
| | | | | src/w32.c (sys_connect): Fix a mistake in previous commit that broke blocking connections.
* Support non-blocking connect on MS-Windows (Bug#20207)Eli Zaretskii2015-03-271-5/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on ideas from Kim F. Storm <storm@cua.dk>, see http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html. src/w32proc.c (reader_thread): If the FILE_CONNECT flag is set, call '_sys_wait_connect'. If it returns STATUS_CONNECT_FAILED, exit the thread with code 2. (sys_select): Support 'wfds' in addition to 'rfds'. If a descriptor in 'wfds' has its bit set, but the corresponding fd_info member doesn't have its FILE_CONNECT flag set, ignore the descriptor. Otherwise, acknowledge a successful non-blocking connect by resetting the FILE_CONNECT flag and setting cp->status to STATUS_READ_ACKNOWLEDGED. src/w32.h (STATUS_CONNECT_FAILED): New enumeration value. (struct _child_process): New member 'errcode'. (FILE_CONNECT): New flag. (_sys_wait_connect): Add prototype. src/w32.c (pfn_WSAEnumNetworkEvents): New function pointer. (init_winsock): Load WSAEnumNetworkEvents from winsock DLL. (set_errno): Map WSAEWOULDBLOCK and WSAENOTCONN. (sys_connect): Support non-blocking 'connect' calls by setting the FILE_CONNECT flag in the fd_info member and returning EINPROGRESS. (_sys_read_ahead): Add debug message if this function is called for a descriptor that waits for a non-blocking connect to complete. (_sys_wait_connect): New function. (sys_read): Support STATUS_CONNECT_FAILED. Return the error code recorded by _sys_wait_connect when the non-blocking connect failed. Don't call WSAGetLastError before a call to set_errno had a chance to use its value, since WSAGetLastError clears the last error. nt/inc/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Don't define.
* Merge from origin/emacs-24Paul Eggert2015-02-251-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e726f20 Handle "#" operator properly inside macro. Fix coding bug. 618931b Handle dead frame in menu-bar-non-minibuffer-window-p. (Bug#19728) 017a03a Document MS-Windows file-name idiosyncrasies (Bug#19463) f3faf4f Fix description of Customize buffer in Emacs manual. 1c1d0b7 Fix a typo in the Emacs manual's Hungry Delete description. be7fb82 src/dispextern.h (FACE_FOR_CHAR): Fix the commentary. 33c4409 Spelling fixes 6c8231e python.el: Handle tabs in python-indent-dedent-line. 41c3b92 * lisp/progmodes/python.el: Respect user indentation after comment. 868df45 Avoid compiler warnings in decode_env_path. b28c979 Fix XEmacs version typo in comment and ChangeLog 989fb32 Improve solution of bug #19701 6310530 Fix refilling of list of language environments in User Manual c4c447d Restore XEmacs compatibility Conflicts: doc/emacs/ChangeLog lisp/ChangeLog src/ChangeLog test/ChangeLog
| * Improve solution of bug #19701Eli Zaretskii2015-01-291-0/+1
| | | | | | | | | | src/w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not ready") to ENOENT.
* | Merge from origin/emacs-24Paul Eggert2015-01-291-9/+32
|\ \ | |/ | | | | | | | | | | ad588af Improve the fix for bug #19701 Conflicts: src/ChangeLog
| * Improve the fix for bug #19701Eli Zaretskii2015-01-281-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | src/dired.c (directory_files_internal, file_name_completion) [WINDOWSNT]: Signal an error when errno is set non-zero by 'readdir', regardless of its value. src/w32.c (sys_readdir): Set errno to ENOENT when the directory doesn't exist and to EACCES when it's not accessible to the current user. Set errno to zero when FindNextFile exhausts the directory, so that callers don't interpret that as an error and don't signal a file-error. (open_unc_volume): Set errno to ENOENT if WNetOpenEnum fails.
* | Merge from origin/emacs-24Fabián Ezequiel Gallina2015-01-281-1/+16
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | 9664def Signal a file-error from directory-files on MS-Windows (Bug#19701) fd4e65e Added missing test for previous commit 5485e3e5 python.el: New non-global state dependent indentation engine. 3b23e6a Fix the description of --insert command-line option (Bug#19694) 7a7e594 Add a cross-reference in ELisp manual. (Bug#19668) b4f4075 Fixes: debbugs:19660 83b3c31 * test/automated/regexp-tests.el: Require regexp-opt Conflicts: lisp/progmodes/python.el
| * Signal a file-error from directory-files on MS-Windows (Bug#19701)Eli Zaretskii2015-01-271-1/+16
| | | | | | | | | | | | | | | | src/dired.c (directory_files_internal) [WINDOWSNT]: If readdir returns NULL and errno is ENOTDIR, behave as if opendir failed to open the directory. src/w32.c (sys_readdir): If FindFirstFile fails because the directory doesn't exist, set errno to ENOTDIR.
| * Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | | | | | Run admin/update-copyright.
* | MS-Windows followup to previous commitEli Zaretskii2015-01-051-2/+0
| | | | | | | | | | | | | | src/w32proc.c, src/w32.h, src/w32fns.c, src/w32font.c, src/w32menu.c: src/w32notify.c, src/w32proc.c, src/w32select.c, src/w32term.c: src/w32uniscribe.c: Remove declarations of Q* variables that represent symbols.
* | Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | | | | | Run admin/update-copyright.
* | MS-Windows followup to stpcpy changes.Eli Zaretskii2014-12-261-7/+6
| | | | | | | | | | | | | | | | | | | | | | src/w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead of strcat. src/w32menu.c (add_menu_item): Use stpcpy instead of strcat. src/w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of strcat. nt/gnulib.mk (stpcpy, string): Sync with the latest change in lib/gnulib.mk.
* | Replace uses of _W64 with MINGW_W64Oscar Fuentes2014-11-271-1/+1
| | | | | | | | | | | | | | | | | | This is the `master' branch follow-up to the change made previously on the emacs-24 branch (81e0cca7bbc99dbfda898a8aaab740ae121cf045). * src/w32.c: Use MINGW_W64 instead of _W64. * src/w32heap.c: Likewise.
* | Merge branch 'emacs-24'Ted Zlatanov2014-11-261-1/+1
|\ \ | |/ | | | | | | | | | | Conflicts: nt/addsection.c nt/inc/ms-w32.h src/w32.c
| * Define MINGW_W64 and use it instead of _W64Oscar Fuentes2014-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... for detecting MinGW-w64. _W64 is not specific of MinGW-w64, it is defined for compatibility with MS VC++. * nt/inc/ms-w32.h: Define MINGW_W64. * admin/CPP-DEFINES: Mention MINGW_W64. * nt/addpm.c: Use it. * nt/addsection.c: Use it. * nt/preprep.c: Use it. * src/w32.c: Use MINGW_W64 instead of _W64 * src/w32term.c: Likewise.
* | Support playing on MS-Windows non-ASCII sound files using Unicode APIs.Eli Zaretskii2014-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/sound.c [WINDOWSNT]: Include w32common.h and mbstring.h. (SOUND_WARNING) [WINDOWSNT]: Include in do..while and improve the error message format. Use message_with_string to have non-ASCII file names properly displayed. (do_play_sound) [WINDOWSNT]: Use Unicode APIs to play sound files when w32-unicode-filenames is non-nil, but not on Windows 9X, where these APIs are not available even in UNICOWS.DLL. Improve the format of error messages and include the file name in them where appropriate. (Fplay_sound_internal) [WINDOWSNT]: Make the MS-Windows branch call play-sound-functions, per documentation. src/w32.c (w32_get_long_filename, w32_get_short_filename): Constify the input file name arguments. src/w32.h (w32_get_long_filename, w32_get_short_filename): Update prototypes.
* | Merge from emacs-24; up to 2014-07-09T02:04:12Z!rgm@gnu.orgGlenn Morris2014-09-141-8/+48
|\ \ | |/
| * Fix bug #18420 with deadlocks communicating with subprocess on MS-Windows.Eli Zaretskii2014-09-141-8/+46
| | | | | | | | | | | | | | | | | | src/w32.c (fcntl): Support O_NONBLOCK fcntl on the write side of pipes. (sys_write): When a write to a non-blocking pipe returns ENOSPC, set errno to EAGAIN instead, to allow the caller to retry the write after some waiting. Fixes deadlocks when Emacs exchanges a lot of data through the pipe.
| * Fix expansion and encoding of sound file names on MS-Windows.Eli Zaretskii2014-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | src/sound.c (Fplay_sound_internal): Encode the sound file name in the ANSI codepage. Expand it against data-directory, as per docs, not against the current directory. No need to make a local copy of the file name; pass the encoded file name directly to do_play_sound. (Bug#18463) src/w32.c (ansi_encode_filename): If w32_get_short_filename returns NULL, and the file name is not encodable in ANSI codepage, return the string with "?" replacement characters, which will fail the caller. This avoids returning a random value in that case.
* | src/w32.c (sys_write): Use SAFE_NALLOCA for the NL -> CRLF translation buffer.Eli Zaretskii2014-09-101-24/+42
| |
* | Implement locale-sensitive string collation for MS-Windows. (Bug#18051)Eli Zaretskii2014-08-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | src/w32proc.c (get_lcid_callback, get_lcid, w32_compare_strings): New functions. src/w32.h (w32_compare_strings): Add prototype. src/w32.c <g_b_init_compare_string_w>: New global flag. (globals_of_w32): Initialize it. src/sysdep.c (str_collate) [WINDOWSNT]: Implementation for MS-Windows. src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp) [WINDOWSNT]: Call str_collate on MS-Windows. etc/NEWS: Mention that string-collate-* functions are supported on MS-Windows as well.
* | Use binary-io module, O_BINARY, and "b" flag.Paul Eggert2014-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/merge-gnulib (GNULIB_MODULES): Add binary-io. It was already present implicitly; this just makes the dependence explicit. * lib-src/etags.c, lib-src/hexl.c, lib-src/make-docfile.c: Include binary-io.h instead of fcntl.h and/or io.h. (main): Use set_binary_mode or SET_BINARY in place of handcrafted code. * lib-src/etags.c (main) [DOS_NT]: * lib-src/movemail.c (main) [WINDOWSNT]: Don't mess with _fmode. * lib-src/etags.c (main, process_file_name, analyse_regex): Use fopen/popen's "b" flag instead. * lib-src/movemail.c (main, popmail): Use open/lk_open/mkostemp's O_BINARY instead. * src/callproc.c (create_temp_file): Use mkostemp's O_BINARY flag. * src/emacs.c [MSDOS]: * src/emacs.c (main) [DOS_NT]: Don't mess with _fmode. (main) [MSDOS]: Use SET_BINARY instead of setmode. * src/minibuf.c: Include binary-io.h instead of fcntl.h. (read_minibuf_noninteractive): Use set_binary_mode instead of handcrafted code. Don't call emacs_set_tty if emacs_get_tty failed. * src/sysdep.c, src/systty.h (emacs_get_tty): Return int, not void. * src/sysdep.c (emacs_open, emacs_pipe): Use O_BINARY. * src/w32.c (pipe2): Adjust eassert to include O_BINARY. Fixes: debbugs:18006
* | Implement memory-info for MS-Windows.Eli Zaretskii2014-07-101-0/+29
| | | | | | | | | | | | src/w32.c (w32_memory_info): New function. src/w32.h (w32_memory_info): Prototype it. src/alloc.c (Fmemory_info) [WINDOWSNT]: Call it.
* | Merge from emacs-24; up to 2014-06-19T14:03:45Z!monnier@iro.umontreal.caGlenn Morris2014-07-081-0/+1
|\ \ | |/
| * src/w32.c (network_interface_info): Make sure the argument is a Lisp string.Eli Zaretskii2014-07-041-0/+1
| |
* | Minor fixes for MS-Windows MinGW64 build.Eli Zaretskii2014-05-261-3/+5
| | | | | | | | | | | | src/w32.c (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT): Define only if undefined. lib-src/ntlib.h (lseek): Don't redirect to _lseek.
* | Merge from emacs-24; up to 2014-04-07T20:54:16Z!dancol@dancol.orgGlenn Morris2014-04-121-7/+2
|\ \ | |/