* lisp/progmodes/grep.el (grep-ask-about-save): New variable (bug#96).
(grep, lgrep, rgrep): Use it (bug#96).
* doc/emacs/building.texi (Grep Searching): Document
`grep-save-buffers'.
* lisp/progmodes/grep.el (grep-save-buffers): Rename from
`grep-ask-about-save'.
(grep--save-buffers): New function.
(grep, lgrep, rgrep): Use it.
* lisp/textmodes/flyspell.el (flyspell-sort): New function (bug#2405).
(flyspell-sort-corrections-functionx): New variable.
(flyspell-sort-corrections-alphabetically): New function.
(flyspell-notify-misspell): Use them.
(flyspell-auto-correct-word): Ditto.
(flyspell-emacs-popup): Ditto.
(flyspell-xemacs-popup): Ditto. Suggested by Sebastien Delafond.
* src/w32.c (sys_write): If 'send' returns with WSAENOTCONN, and
this is a non-blocking socket whose connection is in progress, set
errno to EWOULDBLOCK, as expected by GnuTLS and other callers.
Avoid overwriting the errno value from 'send' by 'ioctlsocket'.
Suggested by Alain Schneble <a.s@realize.ch>. (Bug#22789)
* lisp/faces.el (defined-colors-with-face-attributes): New function.
(readable-foreground-color, defined-colors-with-face-attributes)
(readable-foreground-color): Ditto.
(read-color): Use them (bug#5305).
* lisp/vc/vc-git.el (vc-git-expanded-log-entry): When looking
at expanded git logs with `vc-print-root-log' (C-x v L, then
<enter> by default), Emacs was stripping out all leading
whitespace from git logs. I now strip exactly 2 leading
spaces, which retains the indentation in the logs (bug#18110).
* lisp/wdired.el (wdired-create-parent-directories): New
variable (bug#6817).
(wdired-create-parentdirs): New function.
(wdired-do-renames): Use it.
* doc/emacs/dired.texi (Wdired): Mention
`wdired-create-parent-directories'
* src/gnutls.c (emacs_gnutls_read): Set errno to the value
expected by process.c.
(gnutls_try_handshake): Set gnutls_p to true earlier to avoid
possible race condition with the process.c socket polling
functions.
* lisp/image-mode.el (image-toggle-hex-display)
(image-mode-to-text): New functions.
(image-mode-map, image-minor-mode-map): Bind "C-c C-x" to
image-toggle-hex-display.
(image-mode-map): New menu item "Show as Hex".
(image-mode): Update doc string and echo-area message.
(image-toggle-display): Support toggle to hex. (Bug#22453)
* doc/emacs/files.texi (File Conveniences): Document
'image-toggle-hex-display'.
When configuring with --enable-gcc-warnings, also enable
-Wjump-misses-init, as it’s confusing to use a goto to skip over
an initialization. Fix the few places in the code that run afoul
of this warning.
* configure.ac (WERROR_CFLAGS): Add -Wjump-misses-init.
* src/doc.c (Fsubstitute_command_keys):
* src/image.c (svg_load_image):
* src/regex.c (re_match_2_internal):
* src/xdisp.c (redisplay_internal, redisplay_window):
Don’t jump over initialization.
* src/w32fns.c (_WIN32_WINNT): Define to 0x0600, needed for
keyboard hook functionality.
Include w32inevt.h, basetyps.h and unknwn.h.
(VK_ANY, WM_WTSSESSION_CHANGE, WTS_SESSION_LOCK): New macros.
(kbdhook): A new struct definition.
(funhook, setup_w32_kbdhook, remove_w32_kbdhook, hook_w32_key)
(check_w32_winkey_state, reset_w32_kbdhook_state): New functions.
(modifier_set): Call check_w32_winkey_state if a Win key was
pressed and the keyboard hook is active.
(w32_wnd_proc): Don't handle Win key combinations if the keyboard
hook is active. Only register/unregister the hotkeys if the
keyboard hook is not active. When WM_CREATE is received, call
setup_w32_kbdhook. When WM_DESTROY is received, call
reset_w32_kbdhook_state.
(lookup_vk_code): When the keyboard hook is active, map
alphanumeric characters to themselves.
(w32_parse_and_hook_hot_key): Renamed from w32_parse_hot_key. Map
modified keys to VK_ANY if the keyboard hook is active. Register
Alt-x and Win-x combinations.
(Fw32_shell_execute): Update doc string to reflect new
functionality. Bypass the code that posts the
WM_EMACS_REGISTER_HOT_KEY message if the keyboard hook is active.
(Fw32_unregister_hot_key): Bypass the code that posts the
WM_EMACS_UNREGISTER_HOT_KEY message if the keyboard hook is active.
(syms_of_w32fns) <w32-pass-lwindow-to-system>
<w32-pass-rwindow-to-system, w32-phantom-key-code>
<w32-lwindow-modifier, w32-rwindow-modifier>: Update doc strings
to reflect the new functionality.
* src/w32console.c (initialize_w32_display): Install the low-level
keyboard hook.
* src/w32inevt.c (key_event): Handle Win-x combinations only if
the keyboard hook is not active. If the hook is active, use
check_w32_winkey_state instead.
* src/w32term.h (setup_w32_kbdhook, remove_w32_kbdhook)
(check_w32_winkey_state): Add prototypes.
(w32_kbdhook_active): New macro.
* doc/emacs/msdos.texi (Windows Keyboard): Update to reflect the
new functionality.
* src/process.c (struct sockaddr_and_len, conv_sockaddr_to_lisp)
(get_lisp_to_sockaddr_size, Fset_process_datagram_address)
(connect_network_socket):
Use ptrdiff_t, not int, for signed object sizes.
This addresses only a theoretical problem, as in practice these
object sizes are less than 2**31, but we might as well use the
same style here as elsewhere in Emacs.
(string_integer_p): Remove; all uses removed.
(Fmake_network_process): Check that port number is in range.
When converting an integer-string service, rely on strtol
rather than rechecking the string by hand.
* src/process.h, src/w32.c (conv_sockaddr_to_lisp):
Adjust prototypes to match.
* checkdoc.el (checkdoc-this-string-valid-engine): Docstrings for
variables "True...", and functions "Return true...", should usually be
"non-nil" (bug#15506).
* src/process.c (string_integer_p): New function.
(Fmake_network_process): Use it to allow connecting to
services specified as "993" even when getaddrbyname isn't
available.
* lisp/term.el (term-raw-map): Define C-{up,down,left,right}
to send the same escape sequence that xterm sends. This makes
backward-word and forward-word work in readline (bug#16746).
* lisp/find-file.el (ff-buffer-file-name): New function to
allow the feature to work with indirect buffers, too
(bug#16904).
(ff-find-the-other-file): Use it.
(ff-other-file-name): Ditto.
(ff-get-file-name): Ditto.