Paul Eggert [Tue, 23 Feb 2016 23:25:43 +0000 (15:25 -0800)]
Port to --enable-gcc-warnings sans getaddrinfo_a
* src/process.c (Fmake_network_process): Add ATTRIBUTE_UNUSED
to a local unused when getaddrinfo_a is missing.
Resize portbuf to size needed. Do cheap test first.
Move local to block where it’s needed.
Paul Eggert [Tue, 23 Feb 2016 17:42:05 +0000 (09:42 -0800)]
Minor cleanups for async DNS etc.
* src/frame.h (FRAME_WINDOW_CONFIGURATION_CHANGED):
Omit unnecessary parens.
* src/gnutls.c (gnutls_try_handshake, emacs_gnutls_deinit)
(gnutls_verify_boot):
Use bool for boolean.
(ATTRIBUTE_FORMAT_PRINTF): Add printf attribute.
* src/process.c (free_dns_request, Fmake_network_process):
Allocate and free async request control block all in one go.
(set_network_socket_coding_system, finish_after_tls_connection)
(connect_network_socket):
Now static.
(conv_numerical_to_lisp): 2nd arg is now int, not unsigned.
(Fmake_network_process): Use list1 for brevity.
(wait_for_socket_fds): 2nd arg is now const ptr.
* src/process.h (struct Lisp_Process.dns_request):
Now struct gaicb *, not struct gaicb **, since there was always
exactly one. All uses changed.
* src/window.c, src/window.h (run_window_configuration_change_hook):
Now static.
Martin Rudalics [Tue, 23 Feb 2016 11:08:55 +0000 (12:08 +0100)]
Fix `window-configuration-change-hook' and `window-size-change-functions'
(1) Run `window-configuration-change-hook' if and only if at least
one window was deleted or created or shows another buffer since
last redisplay.
(2) Run `window-size-change-functions' if and only if at least
one window changed its size since last redisplay (in a few cases
`window-size-change-functions' will also run when no window
changed its size).
(3) Provide two functions `window-pixel-height-before-size-change'
and `window-pixel-width-before-size-change' that allow to easily
detect which window changed size.
* src/frame.h (struct frame): New boolean member
window_configuration_changed.
(FRAME_WINDOW_SIZES_CHANGED): Remove macro.
(FRAME_WINDOW_CONFIGURATION_CHANGED): New macro.
* src/frame.c (adjust_frame_size): Don't run
`window-configuration-change-hook'.
* src/window.h (struct window): New fields
pixel_width_before_size_change and pixel_height_before_size_change.
(WINDOW_INTERNAL_P): New macro.
* src/window.c (Fwindow_pixel_width_before_size_change)
(Fwindow_pixel_height_before_size_change): New functions.
(Fdelete_other_windows_internal, Fwindow_resize_apply)
(resize_frame_windows, Fsplit_window_internal)
(Fdelete_window_internal, grow_mini_window)
(shrink_mini_window, Fresize_mini_window_internal): Don't call
FRAME_WINDOW_SIZES_CHANGED.
(window_size_changed, window_set_before_size_change_sizes)
(run_window_size_change_functions): New functions.
(make_window): Initialize pixel_width_before_size_change and
pixel_height_before_size_change.
(Fdelete_window_internal): Don't call
run_window_configuration_change_hook.
(struct saved_window): Add pixel_height_before_size_change and
pixel_width_before_size_change.
(Fset_window_configuration): Try to identify window configuration
changes correctly so run_window_configuration_change_hook and
run_window_size_change_functions run only if configuration and size
really changed.
(save_window_save): Set the pixel_height_before_size_change and
pixel_width_before_size_change fields.
(Vwindow_size_change_functions): Move here definiton from xdisp.c.
* src/xdisp.c (prepare_menu_bars, redisplay_internal): Call
run_window_size_change_functions.
(Vwindow_size_change_functions): Move definition to window.c.
* src/xfns.c (x_set_menu_bar_lines): Don't call
run_window_configuration_change_hook.
* doc/lispref/windows.texi (Window Sizes): Document new
functions `window-pixel-height-before-size-change' and
`window-pixel-width-before-size-change'.
(Window Configurations): Mention that this may trigger
execution of `window-size-change-functions' although no window
changed size.
(Window Hooks): Update descriptions of `window-size-change-functions'
and `window-configuration-change-hook'.
* lisp/emacs-lisp/lisp-mode.el (lisp-prettify-symbols-alist):
Rename from `lisp--prettify-symbols-alist' since we're going
to use it in Scheme mode, too.
(lisp-mode-variables): Use it.
* lisp/gnus/message.el (message-strip-subject-trailing-was): Refactor
the function replacing sequence of `if' calls with a mixture of `or'
and `and' calls instead. This makes it shorter and containing less
internal state thus easier to follow.
* lisp/emacs-lisp/ert-x.el (ert-with-function-mocked): New macro which
allows evaluating code while particular function is replaced with
a mock. The original definition of said function is restored once the
macro finishes.
John Wiegley [Mon, 22 Feb 2016 19:33:54 +0000 (11:33 -0800)]
Merge from origin/emacs-25
a9c48d5 Additional fixes for file notification 6bd9d69 Fix documentation of 'global-disable-point-adjustment' 8c22ac9 ; Spelling fix 2975784 Set file modes of pinentry socket for extra safety 2667b3e Clarify GnuPG version compatibility chapter 5e34c36 Revert "Change the default socket location for pinentry" e19c1c3 Kill off xref--display-history 5698947 Keep the xref buffer visible until the user quits it explicitly e34fbde Change the default socket location for pinentry 5f89658 Mention how to enable pinentry feature db51224 Sync with gnulib aa5a794 Remove `semanticdb-save-all-db-idle' from `auto-save-hook' 2d8b2fd Restore point when writing semantic table to disk 27d3430 Mention pinentry.el in epa manual 5baa001 Fix Bug#22736 7261355 Grammar fix in doc string d0f3b18 Naming fix for consistency 74ec92d Prefer customized value for GnuPG executable ea0b604 Fix memory reservation on MS-Windows c5f72aa Update NextStep readme and add wish list. 6de26a7 Report also result in `file-notify--test-event-handler' 5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir 1cb1268 Fix todo-mode item date editing bugs 1e996cf Fix "[:upper:]" for non-ASCII characters 896f993 Allow customising the article mode cursor behavior 24c1c1d Use pop-to-buffer-same-window in woman.el 2a75f64 New filenotify test for bug#22736 c9bccf7 Report critical battery errors d675db9 Make eww message toggling message clearer 5e0bb40 * lisp/calc/calc-units.el (math-standard-units): Update to 2014 CODATA adjustment. fa8fd65 ; Improve character-folding entries in NEWS 3722a69 Fix bugs in window resizing code 289d5c6 Fix decoding DOS EOL in a unibyte buffer 2abcb06 Correct c-parse-state cache manipulation error. 14aec91 Take advantage of new GnuPG version check function e80c2a7 Make GnuPG version check robuster 15a9464 Fix x-load-color-file pointer signedness 132dbf0 * lisp/time-stamp.el (time-stamp-time-zone): Fix doc string punct. 78ab6f1 Follow convention for greek letter constants. 106b5bb Add Stefan-Boltzmann constant to calc units table. b96baa8 * lisp/calc/calc-units.el (math-build-units-table-buffer): Use special-mode. 5f91cf9 Avoid loading cl-lib for term/xterm.elc, eg in -Q -nw. (Bug#22669) 2d40f7d Fix soffice UserInstallation-URL for Windows b1a3ebe Fix display of <pre> elements 57d0e3d ; * lisp/help-fns.el: Remove outdated comment. 7a0628d ; * admin/make-tarball.txt: Mention cleaning.
Michael Albinus [Mon, 22 Feb 2016 17:52:37 +0000 (18:52 +0100)]
Additional fixes for file notification
* lisp/filenotify.el (top): Require 'cl when compiling.
(file-notify--event-watched-file): New defun.
(file-notify--rm-descriptor, file-notify-callback):
Handle case of several monitors running in parallel.
* test/automated/file-notify-tests.el
(file-notify--test-event-test): Simplify test.
(file-notify--test-with-events): Get rid of outer definition.
Check also results of tests performed in callbacks.
(file-notify-test02-events): No wrapping when calling
`file-notify-rm-watch'. No special checking for callback tests.
(file-notify-test07-backup): Adapt expected events for gfilenotify.
(file-notify-test08-watched-file-in-watched-dir): Improve.
Daiki Ueno [Mon, 22 Feb 2016 02:28:11 +0000 (11:28 +0900)]
Set file modes of pinentry socket for extra safety
* lisp/net/pinentry.el: Require 'cl-lib for `cl-letf'.
(pinentry-start): Change the file modes of the socket file to 0700.
This is just for extra safety since the parent directory is already
protected with `server-ensure-safe-dir'.
Mention in the doc strings that process functions may block
(Fprocess_contact, Fprocess_datagram_address)
(Fset_process_datagram_address, Fset_network_process_option)
(Fprocess_send_region, Fprocess_send_string): Mention that the
functions may block.
(Fset_process_coding_system): Ditto.
* doc/lispref/display.texi (Defining Images): Document the
renamed `image-get/set-property' functions.
* lisp/image.el (image--set-property): Rename from
image-set-property.
(image-property): Declare a setf form.
(image-property): Rename from `image-get-property'.
Dmitry Gutov [Sun, 21 Feb 2016 22:40:53 +0000 (00:40 +0200)]
Kill off xref--display-history
Now that the core workflow keeps the xref window visible, there's
less value in storing this history. And it never was
comprehensive enough to undo scrolling changes.
* lisp/progmodes/xref.el (xref--display-history)
(xref--save-to-history, xref-quit): Remove.
(xref--show-pos-in-buf): Update accordingly.
(xref--xref-buffer-mode-map): Remove xref-quit binding.
Dmitry Gutov [Sun, 21 Feb 2016 22:26:24 +0000 (00:26 +0200)]
Keep the xref buffer visible until the user quits it explicitly
* lisp/progmodes/xref.el (xref--pop-to-location):
Rename WINDOW argument to ACTION.
(xref--with-dedicated-window): New macro.
(xref--show-pos-in-buf): Rename from `xref--display-position'.
Add and handle new argument, SELECTED. Use the above macro.
(xref--show-location): Add SELECTED argument.
(xref-show-location-at-point): Make an effort to avoid the
original window when showing the location.
(xref-goto-xref): Don't quit the xref window (bug#20487 and
http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01133.html).
(xref--query-replace-1): Use xref--with-dedicated-window as well.
(xref--next-error-function): Call xref--show-location instead of
xref--pop-to-location.
(xref--show-xrefs): Rename WINDOW argument to DISPLAY-ACTION.
Only pass that value to xref--pop-to-location. Pass the current
selected window to xref-show-xrefs-function as the `window'
property.
(xref--find-xrefs, xref--find-definitions): Rename WINDOW argument
to DISPLAY-ACTION as well.
Daiki Ueno [Sun, 21 Feb 2016 21:06:50 +0000 (06:06 +0900)]
Change the default socket location for pinentry
* lisp/net/pinentry.el: Require 'cl-lib for `cl-letf'.
(pinentry--socket-dir): Change the default from /tmp/emacsXXX to
~/.emacs.d/pinentry.
(pinentry-start): Change the file modes of the socket file to 0700.
This is just for extra safety since the parent directory is already
protected with `server-ensure-safe-dir'.
David Engster [Sun, 21 Feb 2016 16:16:45 +0000 (17:16 +0100)]
Remove `semanticdb-save-all-db-idle' from `auto-save-hook'
* lisp/cedet/semantic/db-mode.el (semanticdb-hooks): Do not put
`semanticdb-save-all-db-idle' into `auto-save-hook'. The latter is
not an idle hook, so it's not appropriate to call it there. It will
already be called in the `semantic-idle-work-core-handler', which
runs when Emacs is actually idle.
David Engster [Sun, 21 Feb 2016 16:11:01 +0000 (17:11 +0100)]
Restore point when writing semantic table to disk
* lisp/cedet/semantic/db-file.el (object-write): Wrap call to
`semantic-fetch-tags' in `save-excursion', since it might move point
in current buffer. (Bug #22287)
Daiki Ueno [Sun, 21 Feb 2016 09:20:40 +0000 (18:20 +0900)]
Mention pinentry.el in epa manual
* doc/misc/epa.texi (GnuPG version compatibility): New chapter,
describing the differences between three GnuPG branches, and how
to enable pinentry.el.
(Caching Passphrases): Add xref to the compatibility chapter.
Alain Schneble [Sun, 21 Feb 2016 02:36:25 +0000 (13:36 +1100)]
Respect DNS timeouts
* src/process.c (check_for_dns): If the async DNS request
failed and the associated process is still in "connect" state,
deactivate the process and set status to "failed".
Eli Zaretskii [Sat, 20 Feb 2016 16:59:14 +0000 (18:59 +0200)]
Fix memory reservation on MS-Windows
* src/w32heap.c (mmap_alloc): Reserve memory in 64KB granular
units. This avoids leaving gaps in reserved memory regions that
no one can use, since memory reservation must produce 64KB-aligned
addresses. (Bug#22526)
Anders Lindgren [Sat, 20 Feb 2016 15:24:40 +0000 (16:24 +0100)]
Update NextStep readme and add wish list.
* nextstep/README: Rewritten from scratch. New sections on
"History", "Overview of Cocoa and Objective-C", "Guidelines",
"Tracing Support", and "GNUStep". Expanded the "See Also" section.
* nextstep/WISHLIST: New file containing list of issues and ideas
associated with the NS port of Emacs.
* test/automated/file-notify-tests.el (file-notify--test-desc2):
New variable.
(file-notify--test-cleanup): Use it.
(file-notify--test-event-handler): Enable trace.
(file-notify-test08-watched-file-in-watched-dir): Tag it as
:expensive-test. Rewrite callbacks to use
`file-notify--test-event-handler'. Read events in loop. Check
`file-notify--test-results'.
(file-notify-test08-watched-file-in-watched-dir): Fix docstring.
Stephen Berman [Sat, 20 Feb 2016 12:44:47 +0000 (13:44 +0100)]
Fix todo-mode item date editing bugs
* lisp/calendar/todo-mode.el (todo-edit-item--header): Prevent out of
range error by making sure the value of the numerical month date
component cannot be nil. Prevent wrong type error on trying to edit
day number in February by making sure numerical instead of string
value of the year component is passed to todo-read-date.
(todo-read-date): When using the numerical month date component make
sure to use `*' for an arbitrary month instead of its numerical value.
Ari Roponen [Sat, 20 Feb 2016 07:57:44 +0000 (18:57 +1100)]
Use pop-to-buffer-same-window in woman.el
* lisp/woman.el (woman-really-find-file): Work around going to
the wrong buffer by using `pop-to-buffer-same-window' (bug#22332).
(WoMan-find-buffer): Ditto.
Use placeholder images in shr to avoid text moving around
* lisp/net/shr.el (shr-rescale-image): Pass in width/height
from the HTML.
(shr-tag-img): Ditto.
(shr-string-number): New function.
(shr-make-placeholder-image): Make placeholder images.
(shr-tag-img): Insert them if we have SVG support.
Alan Mackenzie [Fri, 19 Feb 2016 17:10:57 +0000 (17:10 +0000)]
Await the final mouse event in C-h c and C-h k.
* lisp/help.el (describe-key-briefly, describe-key): On receiving a mouse
event, keep reading further events until a timeout occurs, to ensure we have
the complete mouse event from the user.
Martin Rudalics [Thu, 18 Feb 2016 10:25:07 +0000 (11:25 +0100)]
Fix bugs in window resizing code
* lisp/window.el (adjust-window-trailing-edge): Fix mismatched
parenthesis.
(shrink-window, enlarge-window): Fix bug#22723 where windows
with preserved size would not get resized. Also now signal an
error when the window cannot be shrunk or enlarged as requested.
Daiki Ueno [Wed, 17 Feb 2016 07:32:25 +0000 (16:32 +0900)]
Make GnuPG version check robuster
We changed the default gpg program to "gpg2" from "gpg" in the commit f93d669a16bd3cb3f43f0c8cfd22fe18b627a6a1. However, there are two
maintained branches (2.0 and 2.1) and Emacs doesn't work well with 2.0
series. Check the actual version of "gpg2" at run time, and properly
divert to "gpg" if necessary.
* lisp/epg-config.el: Require 'cl-lib for `cl-destructuring-bind'.
(epg-config--program-alist): New variable.
(epg--configurations): New variable.
(epg-configuration-find): New function.
(epg-config--make-gpg-configuration): New function.
(epg-config--make-gpgsm-configuration): New function.
(epg-configuration): Mark as obsolete.
* lisp/epg.el (epg-context): Use `epg-configuration-find'.