Glenn Morris [Sun, 11 Jun 2017 23:20:40 +0000 (16:20 -0700)]
Merge from origin/emacs-25
eaa00584ceb Improve documentation of 'gnutls-verify-error' 908498cc01b ; etc/PROBLEMS: Describe GTK-related crashes on elementar... 741daec617e ; Describe the problem with ksh when resizing shell window
Simen Heggestøyl [Sun, 11 Jun 2017 15:41:09 +0000 (17:41 +0200)]
Fix highlighting of CSS selectors with double hyphens
* lisp/textmodes/css-mode.el (css--font-lock-keywords): Fix
highlighting of selectors that contain double hyphens. They would be
mistaken for a variable.
Philipp Stephani [Sun, 11 Jun 2017 12:50:20 +0000 (14:50 +0200)]
Allow non-local exits in module initializers
Previously signals, throws, and quits from module initialization
functions were ignored. These function aren't special, and better
errors can be reported using signals than with the initialization
return code, so allow non-local exits.
* src/emacs-module.c (module_signal_or_throw): New helper function.
(Fmodule_load, funcall_module): Use it.
(Fmodule_load): Also allow quitting.
Michael Albinus [Sat, 10 Jun 2017 08:57:19 +0000 (10:57 +0200)]
Fix domain port and handling in tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-byte-array-to-string):
Return nil if BYTE-ARRAY is nil.
(tramp-gvfs-url-file-name, tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec):
Fix domain and port handling.
Eli Zaretskii [Sat, 10 Jun 2017 08:29:58 +0000 (11:29 +0300)]
Fix handling of Python/Guile commands with arguments in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb-python-guile-commands-regexp): New
variable.
(gdb-control-commands-regexp): Use it.
(gdb-send): Don't increment gdb-control-level if the command
matches gdb-python-guile-commands-regexp and has non-empty
arguments. Reported by David Boles <boles@ieee.org> in
http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00009.html.
Eli Zaretskii [Sat, 10 Jun 2017 08:22:50 +0000 (11:22 +0300)]
Preserve point in Dired windows under 'dired-auto-revert-buffer'
* lisp/dired.el (dired-find-file): When dired-auto-revert-buffer
is non-nil, bind switch-to-buffer-preserve-window-point to nil
while calling find-file. (Bug#27243)
Philipp Stephani [Fri, 19 May 2017 08:58:58 +0000 (10:58 +0200)]
Give test files a -tests.el suffix
Rename a couple of test files that have the same name as the library
they test. This harmonizes the naming pattern and makes it possible
to have the tests directories in the load path.
* lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Remove.
(cl-symbol-macrolet): Instead of adding each binding directly into the
main environment with a special key format, put all symbol macro
bindings into a single entry in the main environment under
`:cl-symbol-macros'.
(cl--sm-macroexpand): Look up symbol bindings in the
`:cl-symbol-macros' entry of the environment.
Glenn Morris [Tue, 6 Jun 2017 00:39:29 +0000 (20:39 -0400)]
Make authors.el report names that were ignored
* admin/authors.el (authors-ignored-names): New.
(authors-canonical-author-name): Add file and position arguments.
Record ignored authors.
(authors-scan-change-log, authors-scan-el):
Pass file and position to authors-canonical-author-name.
(authors): Also print authors that were ignored.
Eli Zaretskii [Mon, 5 Jun 2017 16:16:04 +0000 (19:16 +0300)]
Fix emacs-module-tests on MS-Windows
* src/print.c (print_vectorlike): Make sure module function's
address prints with a leading "0x". This fixes emacs-module-tests
on MS-Windows. Fix whitespace.
* src/dynlib.c (dynlib_addr): Remove unused variable. Update
commentary.
Use unwind protection to clean up data structures in modules
Reuse existing functionality and simplify the code a bit.
* src/emacs-module.c (Fmodule_load): Use unwind protection to clean up
runtime object.
(funcall_module): Use unwind protection to clean up environment
object.
(finalize_environment): Simplify signature.
(finalize_environment_unwind, finalize_runtime_unwind): New functions.
Michael Albinus [Mon, 5 Jun 2017 10:59:26 +0000 (12:59 +0200)]
Some minor tweaks in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-relative):
Let it pass for all gfvs based methods.
(tramp-test24-file-name-completion): Run method and host
completion for all syntaxes only when expensive tests are enabled.
Do not check host completion for gvfs based methods.
(tramp--test-gvfs-p): Add optional METHOD argument.
(tramp--test-afp-or-smb-p): Remove.
Paul Eggert [Mon, 5 Jun 2017 06:52:10 +0000 (23:52 -0700)]
Remove easserts etc. from emacs-module.c
Most of these seem to run afoul of the comment "Do NOT use
'eassert' for checking validity of user code in the module."
* src/emacs-module.c (MODULE_FUNCTION_BEGIN_NO_CATCH)
(module_non_local_exit_check, module_non_local_exit_clear)
(module_non_local_exit_get, module_non_local_exit_signal)
(module_non_local_exit_throw, module_make_string):
Remove unnecessary easserts that pointers are nonnull.
Hardware checks this for us nowadays, and the checks
just clutter up the code.
(module_extract_integer): Remove unnecessary verify that
a C signed integer is in the range INTMAX_MIN..INTMAX_MAX.
The C standard guarantees this.
(module_copy_string_contents): Remove unnecessary eassert
that Lisp strings are null-terminated.
(module_function_arity): Remove unnecessary easserts that
function arities are in range.
Paul Eggert [Mon, 5 Jun 2017 06:52:10 +0000 (23:52 -0700)]
Remove unnecessary checking in emacs-module.c
* src/emacs-module.c (module_copy_string_contents):
Remove checking, as string lengths are always nonnegative and less
than STRING_BYTES_BOUND, and this is checked elsewhere.
(module_make_string): Check length against STRING_BYTES_BOUND, a
tighter bound than MOST_POSITIVE_FIXNUM. (funcall_module): Don't
assume that an out-of-range integer is nonnegative.
Paul Eggert [Mon, 5 Jun 2017 06:52:10 +0000 (23:52 -0700)]
SCHARS and STRING_BYTES are nonnegative
Tell the compiler that SCHARS and STRING_BYTES are nonnegative, in
the hopes that this will optimize a bit better. Also, check this
at runtime if ENABLE_CHECKING.
* src/lisp.h (SCHARS, STRING_BYTES):
eassume that these functions return nonnegative values.
(STRING_SET_CHARS) [ENABLE_CHECKING]:
eassert that newsize is nonnegative.
* src/emacs-module.c (Fmodule_load, funcall_module): Adapt callers.
(finalize_environment): Add parameter for public part of the
environment, like 'initialize_environment'. Add assertions.
Fix a FIXME in emacs-module.c. Put the printing into print.c, like
other types.
* src/print.c (print_vectorlike): Add code to print module functions.
* src/emacs-module.c (funcall_module): Stop calling
'module_format_fun_env'. Now that module functions are first-class
objects, they can be added to signal data directly.
(module_handle_signal): Remove now-unused function
'module_format_fun_env'.
* test/src/emacs-module-tests.el (mod-test-sum-test): Adapt unit test.
* src/eval.c (funcall_lambda): Adapt call to changed signature of
'funcall_module'.
* src/emacs-module.c (MODULE_FUNCTION_BEGIN_NO_CATCH): New helper
macro.
(MODULE_FUNCTION_BEGIN, module_type_of, module_is_not_nil, module_eq):
Use it.
Paul Eggert [Sun, 4 Jun 2017 15:39:37 +0000 (08:39 -0700)]
Tune ‘format’ after recent fix
* doc/lispref/strings.texi (Formatting Strings):
* src/editfns.c (Fformat): Format field numbers no longer need
to be unique, reverting the previous doc change since that has
now been fixed. Also, document that %% should not have modifiers.
* src/editfns.c (styled_format): Improve performance. Remove
the need for the new prepass over the format string, by using
a typically-more-generous bound for the info array size.
Initialize the info array lazily. Move string inspection to
the same area to help caching. Avoid the need for a
converted_to_string bitfield by using EQ. Cache arg in a
local and avoid some potential aliasing issues to help the
compiler. Info array is now 0-origin, not 1-origin.
Previously styled_format overwrite the argument vector. This is no
longer possible because there might be more than one specification per
argument. Use the existing auxiliary info array instead.
* src/editfns.c (styled_format): Record arguments in the info
structure instead of overwriting them.
* test/src/editfns-tests.el (format-with-field): Add unit test.
Glenn Morris [Sat, 3 Jun 2017 00:06:12 +0000 (20:06 -0400)]
Add watch for password back to inferior python comint filter
It was removed along with other items for speed (bug#16875),
but doesn't seem to have been causing an issue, and it's useful to
have it there (bug#27154).
* lisp/progmodes/python.el (inferior-python-mode):
Add comint-watch-for-password-prompt to comint-output-filter-functions.
Ryan [Sat, 3 Jun 2017 00:00:49 +0000 (20:00 -0400)]
Use completing-read-default in tmm-prompt
tmm uses completing-read, but customizes its behavior so much
that any alternative completing-read-function will almost
certainly break it. For example, both ido-ubiquitous and ivy have
special code to deactivate themselves for tmm.
* lisp/tmm.el (tmm-prompt): Use completing-read-default instead of
completing-read. (Bug#27193)
Paul Eggert [Thu, 1 Jun 2017 23:03:12 +0000 (16:03 -0700)]
Limit format fields to more POSIX-like spec
* doc/lispref/strings.texi (Formatting Strings):
Don’t allow mixing numbered with unnumbered format specs.
* src/editfns.c (styled_format): Don’t bother checking for field 0,
since it doesn’t crash and the behavior is not specified.
* test/src/editfns-tests.el (format-with-field): Adjust tests to
match current doc. Add more tests for out-of-range fields.
Paul Eggert [Thu, 1 Jun 2017 23:03:12 +0000 (16:03 -0700)]
Improve performance by avoiding strtoumax
This made (string-to-number "10") 20% faster on my old desktop,
an AMD Phenom II X4 910e running Fedora 25 x86-64.
* admin/merge-gnulib (GNULIB_MODULES): Remove strtoumax.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/strtoul.c, lib/strtoull.c, lib/strtoumax.c, m4/strtoull.m4:
* m4/strtoumax.m4: Remove.
* src/editfns.c (str2num): New function.
(styled_format): Use it instead of strtoumax. Use ptrdiff_t
instead of uintmax_t. Check for integer overflow.
* src/lread.c (LEAD_INT, DOT_CHAR, TRAIL_INT, E_EXP):
Move to private scope and make them enums.
(string_to_number): Compute integer value directly during
first pass instead of revisiting it with strtoumax later.
Paul Eggert [Thu, 1 Jun 2017 05:09:39 +0000 (22:09 -0700)]
Minor improvements to format field numbers
* src/editfns.c (styled_format): Allow field numbers in a %% spec.
No need for a special diagnostic for field numbers greater than
PTRDIFF_MAX. Reword diagnostic for field 0.
* test/src/editfns-tests.el (format-with-field): Adjust to match.
Philipp Stephani [Wed, 31 May 2017 22:09:43 +0000 (00:09 +0200)]
Implement field numbers in format strings
A field number explicitly specifies the argument to be formatted.
This is especially important for potential localization work, since
grammars of various languages dictate different word orders.
* src/editfns.c (Fformat): Update documentation.
(styled_format): Implement field numbers.
* doc/lispref/strings.texi (Formatting Strings): Document field numbers.
Limit scope of local overriding-terminal-local-map
The function `binding' may call isearch-done, which globally sets
overriding-terminal-local-map to nil (Bug#23007).
* lisp/isearch.el (isearch-mouse-2): Don't bind
overriding-terminal-local-map around the call to `binding'.
Stephen Berman [Thu, 1 Jun 2017 20:15:50 +0000 (22:15 +0200)]
Correct and isolate the todo-mode test environment
This avoids having to set todo-mode variables globally in the test
file and prevents any exisiting user todo-mode files from influencing
the tests.
* test/lisp/calendar/todo-mode-tests.el:
(with-todo-test): New macro.
(todo-test-todo-quit01, todo-test-todo-quit02)
(todo-test-item-highlighting): Use it.
* src/xdisp.c (get_next_display_element): Dispatch used format string
for unprintables based on new display-raw-bytes-as-hex variable.
(display-raw-bytes-as-hex): New variable. (Bug#27122)
* lisp/cus-start.el: Add defcustom form for display-raw-bytes-as-hex.
* doc/emacs/display.texi: Document the new variable.
* etc/NEWS: Mention display-raw-bytes-as-hex.
* test/manual/redisplay-testsuite.el (test-redisplay-5-toggle)
(test-redisplay-5): New tests.
(test-redisplay): Call test-redisplay-5.