Paul Eggert [Sat, 21 Nov 2015 18:38:19 +0000 (10:38 -0800)]
Add a few safety checks when ENABLE_CHECKING
This was motivated by the recent addition of module code,
which added some ENABLE_CHECKING-enabled checks that are
useful elsewhere too.
* src/alloc.c (compact_font_cache_entry):
* src/fns.c (sweep_weak_table):
* src/lread.c (oblookup):
Use gc_asize rather than doing it by hand.
* src/emacs-module.c (module_make_global_ref)
(module_free_global_ref, module_vec_size):
Omit assertions that lisp.h now checks.
* src/lisp.h (XFASTINT, ASIZE): In functional implementations,
check that the result is nonnegative. Use eassume, as this
info can help a bit when optimizing production code.
(XSYMBOL) [!USE_LSB_TAG]: Assert that argument is a symbol,
to be consistent with the USE_LSB_TAG case.
(gc_asize): New function, when ASIZE is needed in the gc.
(gc_aset): Use it.
(HASH_TABLE_P): Move definition up, so that it can be used ...
(XHASH_TABLE): ... here, to assert that the arg is a hash table.
Eli Zaretskii [Sat, 21 Nov 2015 17:44:02 +0000 (19:44 +0200)]
Simplify recording of main thread's ID on MS-Windows
* src/w32term.c (w32_initialize):
* src/w32console.c (initialize_w32_display):
* src/w32fns.c (globals_of_w32fns): Don't record the main thread
ID independently for each type of session (GUI, TTY, batch).
* src/w32term.c (w32_init_main_thread): New function, records the
main thread's thread ID.
* src/w32term.h: Add prototype for w32_init_main_thread.
* src/emacs.c (main) [WINDOWSNT]: Call w32_init_main_thread.
* src/emacs-module.c [WINDOWSNT]: Rename main_thread_id to
main_thread, for consistency with other threading libraries. All
users changed. Include w32term.h.
(check_main_thread) [WINDOWSNT]: Simplify the test: no need to
make sure the main thread is alive, as we hold a handle on it
opened by w32_init_main_thread.
(module_init) [WINDOWSNT]: Reuse the thread ID recorded by
w32_init_main_thread, instead of calling the requisite APIs once
more.
Eli Zaretskii [Sat, 21 Nov 2015 11:30:30 +0000 (13:30 +0200)]
Call 'window-size-change-functions' for mini-windows
* src/window.c (grow_mini_window, shrink_mini_window): Set the
frame's 'window_sizes_changed' flag.
* src/xdisp.c (redisplay_internal): Call the hooks on
'window-size-change-functions' if the call to 'echo_area_display'
sets the frame's 'window_sizes_changed' flag.
(syms_of_xdisp) <window-size-change-functions>:
Update doc string to indicate the mini-window resizes trigger a
call to the hooks, and don't promise that will happen "before
redisplay". (Bug#19576, Bug#21333)
* doc/lispref/windows.texi (Window Hooks): Update the description
of 'window-size-change-functions'.
Eli Zaretskii [Sat, 21 Nov 2015 10:49:57 +0000 (12:49 +0200)]
Improve documentation of dynamic modules
* src/fns.c (Frequire): Doc fix to include the dynamic module
support.
* src/lread.c (Fload, Vload_suffixes): Doc fixes to include the
dynamic module support.
(Fload): Treat the module suffix the same as '*.el' and '*.elc'
wrt the MUST-SUFFIX argument.
* etc/NEWS: Expand documentation of dynamically loaded modules.
Paul Eggert [Fri, 20 Nov 2015 21:48:54 +0000 (13:48 -0800)]
Fix double-decrement bug when freeing global refs
* src/emacs-module.c (module_free_global_ref): Add a FIXME
comment about error reporting. Fix a recently-introduced typo
that double-decremented the refcount.
Paul Eggert [Fri, 20 Nov 2015 20:20:26 +0000 (12:20 -0800)]
Declare emacs_module_init in the module API
* src/emacs-module.h (emacs_module_init): New decl.
Without it, GCC might complain about a module that defines
emacs_module_init without using it. This also checks the
API better.
Paul Eggert [Fri, 20 Nov 2015 20:15:22 +0000 (12:15 -0800)]
Fix reindent-introduced typo in module code
* src/emacs-module.c (MODULE_SETJMP_1): Fix typo that I
introduced while reindenting the code earlier, and add a
comment explaining the unusual use of do-while here.
Anders Lindgren [Fri, 20 Nov 2015 20:07:29 +0000 (21:07 +0100)]
Fixed bug#19576: `write-file' saves wrong buffer.
If a function on the hook `window-size-change-functions' doesn't
restore the current buffer, functions that save and restore the
current window configuration (like `y-or-no-p') could silently
change the current buffer. When `write-file' asked the user
confirmation to overwrite a file, `y-or-no-p' changed the current
buffer, and the wrong buffer was saved to the file.
* lisp/follow.el (follow-windows-start-end): Call `select-frame'
using the `norecord' parameter.
(follow-window-size-change): Restore current buffer. Call
`select-frame' using the `norecord' parameter. Cleanup.
Paul Eggert [Fri, 20 Nov 2015 16:51:13 +0000 (08:51 -0800)]
Module function arg counts are ptrdiff_t, not int
* src/emacs-module.c (struct module_fun_env)
(module_make_function, module_funcall, Fmodule_call):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
Use ptrdiff_t, not int, for arg counts.
* src/emacs-module.c (module_make_function): Don’t bother
checking arity against MOST_POSITIVE_FIXNUM, as that’s
unnecessary here. Make the checking clearer by negating it.
(module_make_function, Fmodule_call): No need to use xzalloc
since the storage doesn’t need to be cleared.
(module_funcall): Don’t use VLA, since C11 doesn’t guarantee support
for it, and many implementations are buggy with large VLAs anyway.
Use SAFE_ALLOCA_LISP instead.
(module_vec_set): Don’t crash if i < 0.
(module_vec_get): Don’t crash if i < MOST_NEGATIVE_FIXNUM.
(module_vec_set, module_vec_get): Do fixnum checks only when
i is out of array bounds, for efficiency in the usual case.
(Fmodule_load): Simplify fixnum range check.
(Fmodule_call): Simplify arity check. Use xnmalloc to detect
integer overflow in array allocation size.
Eli Zaretskii [Fri, 20 Nov 2015 11:37:25 +0000 (13:37 +0200)]
Minor improvements in module test
* modules/mod-test/mod-test.c: Include stdlib.h, to avoid warnings
about missing prototype of malloc.
* modules/mod-test/Makefile (CFLAGS): Add -std=gnu99, to avoid
compiler warnings.
Eli Zaretskii [Fri, 20 Nov 2015 11:34:15 +0000 (13:34 +0200)]
Improve MS-Windows implementation in dynlib.c
* 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.
Paul Eggert [Fri, 20 Nov 2015 08:40:45 +0000 (00:40 -0800)]
Include-file tweaks for modules
* src/dynlib.c, src/emacs-module.c: Include <config.h> first.
* src/dynlib.h: Do not include config.h.
It’s every .c file’s responsibility to include config.h first.
* src/emacs-module.c: Include emacs-module.h immediately after
config.h, to test that emacs-module.h doesn’t depend on
include files other than config.h.
Paul Eggert [Fri, 20 Nov 2015 04:09:11 +0000 (20:09 -0800)]
Simplify push_handler and profile its malloc
* src/lisp.h (PUSH_HANDLER): Remove.
All callers changed to use push_handler directly.
* src/eval.c (internal_condition_case)
(internal_condition_case_1, internal_condition_case_2)
(internal_condition_case_n):
Use same pattern as for other invokers of push_handler.
(push_handler, push_handler_nosignal): Use call-by-value
instead of call-by-reference. All uses changed.
(push_handler): Simplify by rewriting in terms of
push_handler_nosignal.
(push_handler_nosignal): Profile any newly allocated memory.
Discover repository version in linked worktrees (bug#21930)
* lisp/version.el (emacs-repository--version-git-1): Do not assume
HEAD is at .git/HEAD, it can also be at .git/worktrees/<branch>/HEAD.
(emacs-repository-get-version): Grok linked worktrees when EXTERNAL
is nil too.
Juri Linkov [Fri, 20 Nov 2015 00:00:48 +0000 (02:00 +0200)]
* lisp/replace.el (occur-regexp-descr): New function.
(occur-1, occur-engine): Use it.
* lisp/isearch.el (isearch-occur): Propertize regexp with
isearch-string and isearch-regexp-function-descr for
occur-regexp-descr to display the correct description
message in the header (bug#21176, bug#21180).
This partly reverts Artur Malabarba's change that added electric
indent sensitivity to `open-line' (Oct 24 22:26:27 2015 +0100, git
commit bd4f04f86), and adjusts a new test he added right afterwards
(Sat Oct 24 23:43:06 2015 +0100, git commit 207f235e3) accordingly.
However, the new INTERACTIVE argument to `open-line', which he also
added in the first commit, is not reverted here.
See the thread "Questioning the new behavior of `open-line'." on the
Emacs Devel mailing list, and in particular this message:
From: Artur Malabarba
Subject: Re: Questioning the new behavior of `open-line'.
To: Karl Fogel Cc: David Kastrup, Pierpaolo Bernardi, emacs-devel
Date: Wed, 18 Nov 2015 21:03:58 +0000
Message-ID: \
<CAAdUY-KN06pvCMy5bt3+Buk3yeKjf6n9iB2FaSTTOPpCqPwyhA@mail.gmail.com>
Paul Eggert [Thu, 19 Nov 2015 23:01:26 +0000 (15:01 -0800)]
Prefer signed integer types in module code
Generally speaking, at the C level the Emacs source code prefers
signed types like ‘ptrdiff_t’ to unsigned types like ‘size_t’,
partly to avoid the usual signedness confusion when comparing values.
Change the module API to follow this convention.
Use ‘int’ for small values that can’t exceed INT_MAX.
* modules/mod-test/mod-test.c (Fmod_test_globref_make)
(Fmod_test_string_a_to_b, Fmod_test_vector_fill)
(Fmod_test_vector_eq):
* src/emacs-module.c (struct emacs_value_frame)
(module_make_global_ref, module_free_global_ref)
(module_copy_string_contents, module_make_string)
(module_vec_set, module_vec_get, module_vec_size):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
* src/lread.c (suffix_p):
Prefer signed to unsigned integer types.
Paul Eggert [Thu, 19 Nov 2015 22:24:50 +0000 (14:24 -0800)]
Omit ‘const’ on locals
Remove ‘const’ qualifier from locals that were newly added.
We don’t normally bother declaring locals with ‘const’ even
though they are not modified, for the same reason we don’t
bother declaring them with ‘register’ even though their
addresses are not taken; the advantage in compile-time
checking isn’t worth the loss of readability.
* modules/mod-test/mod-test.c (Fmod_test_non_local_exit_funcall)
(Fmod_test_vector_fill, Fmod_test_vector_eq):
* src/emacs-module.c (MODULE_SETJMP_1)
(module_make_global_ref, module_free_global_ref)
(module_non_local_exit_get, module_make_function)
(module_extract_integer, module_extract_float)
(module_get_user_ptr, module_set_user_ptr)
(module_get_user_finalizer, module_set_user_finalizer)
(module_vec_get, Fmodule_call)
(module_non_local_exit_signal_1)
(module_non_local_exit_throw_1, lisp_to_value)
(finalize_storage, allocate_emacs_value, mark_modules)
(module_handle_signal, module_handle_throw)
(module_format_fun_env):
* src/eval.c (push_handler, push_handler_nosignal)
(init_handler):
* src/lread.c (suffix_p):
Omit unnecessary ‘const’.
Paul Eggert [Thu, 19 Nov 2015 22:03:29 +0000 (14:03 -0800)]
Prefer intmax_t to int64_t in module code
* modules/mod-test/mod-test.c (sum, Fmod_test_sum):
* src/emacs-module.c (module_extract_integer)
(module_make_integer):
* src/emacs-module.h (struct emacs_env_25):
Prefer intmax_t to int64_t. This doesn’t change the generated
code on any of the machines Emacs currently ports to, but it’s
at least in theory more future-proof as C99 doesn’t guarantee
that int64_t exists.
Paul Eggert [Thu, 19 Nov 2015 19:49:27 +0000 (11:49 -0800)]
Fix minor module problems found by static checking
* src/dynlib.c (dynlib_close): #ifdef out for now, as it’s not used.
* src/eval.c, src/lisp.h (lisp_eval_depth): Now static.
* src/module.c (Fmodule_load): Fix pointer signedness bug.
(Fmodule_call): Tell GCC that the default case is unreachable.
Paul Eggert [Thu, 19 Nov 2015 19:31:45 +0000 (11:31 -0800)]
Style fixes for indenting etc. in module code
This is mostly indenting and spacing changes. Also, remove
some unnecessary static decls instead of bothering to reindent them.
* src/module.h (EMACS_EXTERN_C_BEGIN): Remove, and do this inline,
as most other Emacs files do for this sort of thing.
Eli Zaretskii [Wed, 18 Nov 2015 20:09:08 +0000 (22:09 +0200)]
Fix MS-Windows build --with-modules
* src/module.c: Reformat copyright commentary.
(module_vec_get): Use explicit cast to size_t to avoid compiler
warning in 32-bit builds.
(check_main_thread) [WINDOWSNT]: Fix letter-case in Windows APIs.
Compare thread IDs directly, as GetThreadId is not available
before Windows Vista.
(check_main_thread) [WINDOWSNT]: Duplicate the thread handle
without using APIs and constants not available on XP and older
systems. Obtain and store the thread ID as well.
Aurélien Aptel [Mon, 16 Nov 2015 00:00:25 +0000 (01:00 +0100)]
Add dynamic module test and helper script
Add 'modhelp.py' script (python2) to automate module testing and
module generation.
To build and test all modules in the modules/ dir
$ ./modhelp.py test
To generate a module from template code (good starting point)
$ ./modhelp init mynewtestmodule
See the script -h option for more documentation.
* modules/modhelp.py: New module helper script.
* modules/mod-test/Makefile: New file. Makefile for the test module.
* modules/mod-test/mod-test.c: New file. Test module source file.
* modules/mod-test/test.el: New file. ert test suite for the test module.
* modules/.gitignore: New file. Local .gitignore file.
Co-authored-by: Philipp Stephani <phst@google.com>
Aurélien Aptel [Sun, 15 Nov 2015 23:53:15 +0000 (00:53 +0100)]
Make 'Fload' look for modules
'Fload' can now load dynamic modules. This also makes 'require' work.
* src/lread.c:
(suffix_p): New function.
(Fload): Use 'suffix_p'. Call 'Fmodule_load' when we try to load a file
with a module suffix.
(syms_of_lread): Append module suffix to 'Vload_suffixes'.
Aurélien Aptel [Sun, 15 Nov 2015 23:47:04 +0000 (00:47 +0100)]
Add dynamic module module support
* configure.ac: Add '--with-modules' option. Conditionally add
dynlib.o and module.o to the list of objects. Add any system
specific flags to the linker flags to support dynamic libraries.
* m4/ax_gcc_var_attribute.m4: Add autoconf extension to test gcc
attributes.
* src/Makefile.in: Conditionally add module objects and linker flags.
* src/alloc.c (garbage_collect_1): protect module local values from
GC.
* src/lisp.h: Add 'module_init' and 'syms_of_module' prototypes.
* src/emacs_module.h: New header file included by modules. Public
module API.
* src/module.c: New module implementation file.
Co-authored-by: Philipp Stephani <phst@google.com>
Aurélien Aptel [Sun, 15 Nov 2015 23:42:14 +0000 (00:42 +0100)]
Add new User Pointer (User_Ptr) type
* src/lisp.h: Add new Lisp_Misc_User_Ptr type.
(XUSER_PTR): New User_Ptr accessor.
* src/alloc.c (make_user_ptr): New function.
(mark_object, sweep_misc): Handle Lisp_Misc_User_Ptr.
* src/data.c (Ftype_of): Return 'user-ptr' for user pointer.
(Fuser-ptrp): New user pointer type predicate function.
(syms_of_data): New 'user-ptrp', 'user-ptr' symbol. New 'user-ptrp'
subr.
* src/print.c (print_object): Add printer for User_Ptr type.
Paul Eggert [Wed, 18 Nov 2015 17:17:20 +0000 (09:17 -0800)]
Quote symbols in docstrings using `'
Be more systematic about quoting symbols `like-this' rather than
`like-this or 'like-this' in docstrings. This follows up Artur
Malabarba's email in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01647.html
Xue Fuqiao [Sat, 14 Nov 2015 04:49:17 +0000 (12:49 +0800)]
Backport: Mention CONTRIBUTE in README
Mention CONTRIBUTE in README, since it was moved from etc/ to root.
* etc/TODO: Remove the reference to `etc/CONTRIBUTE'.
* README: Mention CONTRIBUTE.
Paul Eggert [Tue, 17 Nov 2015 23:28:50 +0000 (15:28 -0800)]
Fix docstring quoting problems with ‘ '’
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes. The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.
Paul Eggert [Tue, 17 Nov 2015 07:08:54 +0000 (23:08 -0800)]
eval_sub followed dangling pointer when debugging
Problem reported by Pip Cet (Bug#21245).
This bug could occur in eval_sub if the C compiler reused
storage associated with the ‘argvals’ local after ‘argvals’
went out of scope, and if the Elisp debugger stopped on Elisp
function exit and accessed ‘argvals’. It could also occur if
a variadic function was called with so many arguments (over
2048 args on x86-64) that SAFE_ALLOCA_LISP called malloc, then
SAFE_FREE freed the arguments, then the memory manager used
the storage for other purposes, then the debugger accessed the
arguments.
* src/eval.c (eval_sub): Declare ‘argvals’ at top level of
function body. Simplify local decls.
When allocating args via SAFE_ALLOCA, call
debugger before invoking SAFE_FREE, as the debugger needs
access to the args.
(eval_sub, apply_lambda): Rework to avoid need for
set_backtrace_debug_on_exit hack. This is cleaner,
and should work better with buggy custom debuggers.
Paul Eggert [Tue, 17 Nov 2015 01:48:08 +0000 (17:48 -0800)]
ELF unexec: align section header
This ports the recent unexelf.c changes to Fedora x86-64
when configured with GCC’s -fsanitize=undefined option.
* src/unexelf.c (unexec): Align new_data2_size to a multiple
of ElfW (Shdr)’s alignment, so that NEW_SECTION_H returns a
pointer aligned appropriately for its type.
Paul Eggert [Mon, 16 Nov 2015 21:09:46 +0000 (13:09 -0800)]
Improve fix for regex reentrancy abort
Suggested by Stefan Monnier (Bug#21688).
* src/syntax.c (update_syntax_table_forward):
Remove recently-added PROPERTIZE arg, and assume it is true.
All callers changed.
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
Invoke update_syntax_table directly.
Alan Mackenzie [Sun, 15 Nov 2015 21:59:40 +0000 (21:59 +0000)]
De-pessimize detection of C++ member initialization lists.
list/progmodes/cc-engine.el (c-back-over-list-of-member-inits): New macro.
(c-back-over-member-initializers): Reformulate such that c-at-toplevel-p
is only called when a construct "looks right" rather than continually.
(c-guess-basic-syntax, CASE 5R): Add a check for the mode being C++ Mode.
Artur Malabarba [Sun, 15 Nov 2015 21:28:37 +0000 (21:28 +0000)]
Backport: * lisp/emacs-lisp/package.el: Fix a decoding issue.
* lisp/url/url-handlers.el (url-insert-file-contents): Move some code to
`url-insert-buffer-contents'.
(url-insert-buffer-contents): New function
(package--with-response-buffer): Use `url-insert-buffer-contents'.
The previous code had some issues with decoding. Refactoring that
function allows us to use the decoding from url-handlers while still
treating both sync and async requests the same.
Anders Lindgren [Sun, 15 Nov 2015 19:19:34 +0000 (20:19 +0100)]
Enhance NSTRACE (trace output for NextStep).
Trace can be disabled for groups of functions. By default, event
functions and functions that generate lots of output are disabled.
Trace output of Objective-C functions now use the "[ClassName
parameter:]" form.
* src/nsterm.h (NSTRACE_ALL_GROUPS, NSTRACE_GROUP_EVENTS)
(NSTRACE_GROUP_UPDATES, NSTRACE_GROUP_FRINGE, NSTRACE_GROUP_COLOR)
(NSTRACE_GROUP_GLYPHS, NSTRACE_GROUP_FOCUS): New macros,
controlling in which function groups trace should be active.
(NSTRACE_WHEN): Support for silencing a function, this also
silencing all called functions.
(NSTRACE_UNSILENCE): New macro, used to re-enable trace.
(NSTRACE_FMT_FSTYPE, NSTRACE_ARG_FSTYPE): New macros, used to
print the full screen state in NSTRACE functions.
* src/nsterm.m (nstrace_depth, nstrace_num): Made volatile as they
can be accessed from multiple threads.
(nstrace_enabled_global): New variable, when FALSE, trace is
silenced.
(nstrace_restore_global_trace_state): New function, used to
restore `nstrace_enabled_global' at end of block.
([EmacsView setFrame:], [EmacsWindow setFrame:display:])
([EmacsWindow setFrame:display:animation:])
([EmacsWindow setFrameTopLeftPoint:]): New functions, print trace
and call corresponding super function.
(Many functions): Add or enhance trace output.
Anders Lindgren [Sun, 15 Nov 2015 18:17:53 +0000 (19:17 +0100)]
Fixed a toolbar related issue on OS X.
Earlier, when toggling the tool-bar in a maximized frame, the
frame size didn't match the number of text lines, leaving an
unused area at the bottom of the frame.
* nsfns.m (x_set_tool_bar_lines): Exit maximized and full height
fullscreen modes when tool bar is disabled.
Anders Lindgren [Sun, 15 Nov 2015 17:46:04 +0000 (18:46 +0100)]
Fixed OS X 10.6.8 build issue (bug#21862).
* src/nsterm.h (EmacsView): Add missing declarations.
* src/nsterm.m ([EmacsView windowDidBecomeKey]): New method, like
the standard method but without the notification parameter.
Intended to be used for direct calls.
([EmacsView windowDidEnterFullScreen]): Call the non-notification
version of `windowDidBecomeKey'. Made the notification method call
the non-notification method instead of the vice versa.
(NSWindowDidEnterFullScreenNotification): Deleted, no longer
needed.
Paul Eggert [Sun, 15 Nov 2015 09:14:39 +0000 (01:14 -0800)]
Fix regex abort when it tries to reenter itself
Problem reported by Ken Raeburn.
Solution suggested by Stefan Monnier (Bug#21688).
* src/regex.c (re_match_2_internal):
Use new _FAST functions to avoid regex code reentering itself.
* src/syntax.c (update_syntax_table_forward): New arg PROPERTIZE.
All callers changed.
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST)
(UPDATE_SYNTAX_TABLE_FAST): New inline functions.
Dmitry Gutov [Sun, 15 Nov 2015 05:25:19 +0000 (07:25 +0200)]
Improve Ruby 1.9-style keyword keys highlighting
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords):
Handle required keyword arguments (bug#21367).
And highlight the colon together with the name.
* lisp/progmodes/xref.el (xref-query-replace): Store the end
of each match as a marker again, instead of length.
(xref--query-replace-1): Update accordingly.
(package--with-work-buffer-async): Reimplement as
`package--with-response-buffer'.
(package--with-work-buffer): Mark obsolete.
(package--with-response-buffer): New macro. This is a more self
contained and less contrived version of
`package--with-work-buffer-async'. It uses keyword arguments,
doesn't have async on the name, doesn't fallback on
`package--with-work-buffer', and has _much_ simpler error
handling. On master, this macro will soon be part of another
library (either standalone or inside url.el), which is why this
commit is not to be merged back.
(package--check-signature, package--download-one-archive)
(package-install-from-archive, describe-package-1): Use it.
(package--download-and-read-archives): Let
`package--download-one-archive' take care of calling
`package--update-downloads-in-progress'.