Paul Eggert [Fri, 5 Aug 2016 21:10:30 +0000 (14:10 -0700)]
Merge from origin/emacs-25
d841a03 ; Spelling fix a6ae479 Post AppDefined events from the main thread ONLY (bug#23934) d35d398 Update to the AUTHORS file for Bob Weiner 4d2f4df Revert "Fix local printer set to left aligned string formatter." cd1b4d6 Revert "Fix ses-delete-blanks to delete only blanks + documen... f7ceb8e Revert "Fix English." baa7abd Improve doc strings of 'gud-gdb' and 'gdb' aa4271a Fix doc string of 'minibuffer-message-timeout' b275cc7 Fix English. 3c97b0f Fix ses-delete-blanks to delete only blanks + documentation. 272391f profiler: document prefix arg for tree expansion 442cc39 Clarify usage of eshell-visual-options b443c3c Fix comment in files-in-below-directory 8a38e94 Fix local printer set to left aligned string formatter. 0f0b191 ; Fix typos in NEWS 6bdf687 ; * etc/NEWS: Remove temporary marks
Paul Eggert [Fri, 5 Aug 2016 21:10:30 +0000 (14:10 -0700)]
Merge from origin/emacs-25
d08afa1 * etc/AUTHORS: Update the AUTHORS file 2668500 ;; * ChangeLog.2: ChangeLog update. 7acfaea ; ChangeLog fixes 97d28b4 * admin/authors.el (authors-valid-file-names): Addition. 9ab52f6 * admin/authors.el: Additions. 0e646c7 Warn about Cairo-related problems bc4c07f Don't let completion break `declare' handling 66f95e0 Adjust match data before calling after-change-funs 52cf0d5 Do not show string-rectangle preview if minibuffer is empty 6a3d031 * etc/PROBLEMS: Add entry about selection problems under Plas...
Paul Eggert [Fri, 5 Aug 2016 21:09:09 +0000 (14:09 -0700)]
; Merge from origin/emacs-25
The following commits were skipped:
ff3fc21 Port to glibc 2.24 (pre-release) + ppc64 eb9d461 * lisp/net/shr.el (shr-fill-line): Withdraw the last commit (... 4157159 * lisp/net/shr.el (shr-fill-line): Preserve text properties i...
Paul Eggert [Fri, 5 Aug 2016 21:07:00 +0000 (14:07 -0700)]
Merge from origin/emacs-25
d4c6774 Fix missing point information in undo 3a9d629 Avoid crashes when buffer modification hooks clobber match data 178b2f5 Note combine-and-quote-strings doesn't shell quote dec7567 Explain when package-initialize isn't called 113d1e2 Fix escaping in sh-indent-after-continuation docstr 80e2044 ; * etc/NEWS: Improve previous change. 5bb9e6c ; * etc/NEWS: Document how to avoid horizontal scroll bars. 38f4b8e Clarify the documentation of back-references in replacements
Paul Eggert [Fri, 5 Aug 2016 21:06:59 +0000 (14:06 -0700)]
Merge from origin/emacs-25
850ba44 Clarify lexical binding with symbol args behavior f981b31 * lisp/net/tramp-sh.el (tramp-remote-path): Doc fix. 68fc964 * lisp/net/tramp-sh.el (tramp-remote-path): Doc fix. (Bug#23... 21110af Avoid assertion violations when rendering some fonts 6192b6c Document more details of package activation 272ddc6 Fixup warning message regarding HOME a bit more 43206d6 * lisp/leim/quail/indian.el ("bengali-probhat"): Change indic... d41f7ff Fix input method "probhat" for Bengali c150a64 ; Fix typo in commit before last ebf0472 Add to elisp-completion-at-point's docstring fd9fad0 Give more helpful warning about setting HOME ea6b01d ; * lisp/term.el (term-mode): FIXME comment about bidi reorde...
Alan Mackenzie [Thu, 4 Aug 2016 21:07:52 +0000 (21:07 +0000)]
Widen in certain low level CC Mode functions. This fixes bug #24148.
* lisp/progmodes/cc-engine (c-state-semi-pp-to-literal)
(c-state-full-pp-to-literal): Widen around the functionality.
(c-parse-ps-state-below): Correct the order of save-excursion and
save-restriction.
Paul Eggert [Wed, 3 Aug 2016 21:20:38 +0000 (14:20 -0700)]
Fix GnuTLS includes
* src/gnutls.c [HAVE_GNUTLS]: Don’t include gnutls/gnutls.h
a second time; although it doesn’t hurt, it’s not needed.
* src/sysdep.c [!HAVE_GNUTLS]: Don’t include gnutls/crypto.h,
as it may not be available. Problem reported by Glenn Morris in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00100.html
Fix accessing regex-resources in out-of-tree test runs in regex-tests
[82a487d: Fix reading of regex-resources in regex-tests] attempted to
fix regex-tests failing when run from the source tree (i.e. via make)
by hard-coding path to regex-resources directory relative to the test
directory.
This fixed runs from the tree but broke the test when run using other
methods.
Fix by trying ‘load-file-name’ or ‘buffer-file-name’, whichever is set.
* test/src/regex-tests.el (regex-tests--resources-dir): New variable
storing path to the regex-resources directory.
(regex-tests-generic-line): Use aforementioned variable.
Paul Eggert [Wed, 3 Aug 2016 11:45:47 +0000 (07:45 -0400)]
Port to systems lacking GNUTLS_NONBLOCK
Problem reported by Colin Baxter in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00096.html
* src/gnutls.c (Fgnutls_boot): Don’t assume GNUTLS_NONBLOCK is defined.
Paul Eggert [Wed, 3 Aug 2016 08:54:20 +0000 (01:54 -0700)]
Fix non-blocking GnuTLS with slow connection
Although the problem is reported for OS X (Bug#23982), it seems to
be possible on other POSIXish platforms.
* src/gnutls.c (emacs_gnutls_nonblock_errno) [!WINDOWSNT]:
New function.
(emacs_gnutls_handshake) [!WINDOWSNT]:
Use it as the errno function, if non-blocking.
(Fgnutls_boot): Use GNUTLS_NONBLOCK if non-blocking.
Paul Eggert [Wed, 3 Aug 2016 08:33:21 +0000 (04:33 -0400)]
Require GnuTLS 2.12.2 or later
* configure.ac, etc/NEWS: Require GnuTLS 2.12.2 or later,
instead of merely 2.6.6 or later (Bug#23982#20).
* src/gnutls.c (init_gnutls_functions, emacs_gnutls_handshake)
[WINDOWSNT]: Don’t bother with gnutls_check_version or
gnutls_transport_set_lowat, as they are no longer needed now that
we require gnutls 2.12.2 or later.
Paul Eggert [Wed, 3 Aug 2016 01:04:28 +0000 (21:04 -0400)]
Fix (mapcar F S) crash when F alters S’s length
* src/fns.c (mapcar1): Return number of elements computed,
which can be less than LENI if the function alters the list.
All callers changed. (Bug#24118)
Stefan Monnier [Tue, 2 Aug 2016 23:45:30 +0000 (19:45 -0400)]
* src/window.c: Fix bootstrap failure due to window.el changes
(sanitize_window_sizes): Adjust to new calling convention of
window--sanitize-window-sizes and only call it if defined.
(Fwindow__sanitize_window_sizes): Remove.
(syms_of_window): Don't defsubr it.
Michael Albinus [Tue, 2 Aug 2016 20:38:03 +0000 (22:38 +0200)]
Fix Bug#23883
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
Call `process-actions' with adapted position. The connection
buffer might have been cleaned up already. (Bug#23883)
Stefan Monnier [Tue, 2 Aug 2016 19:17:01 +0000 (15:17 -0400)]
* lisp/window.el: Use lexical-binding
(window--min-size-ignore-p): Remove unused arg `horizontal'.
(window--sanitize-window-sizes): Remove unused arg `frame'.
(window-edges): Remove unused vars left-off and right-off.
(display-buffer-reuse-mode-window): Remove unused var `frame?'.
Avoid extraneous setq and do a bit of CSE.
(fit-frame-to-buffer): Remove unused vars `window', `fit-width',
and `toolbar-extra-height'.
(window-adjust-process-window-size): Remove unused arg `process'.
regex.c:516:0: warning: macro "STREQ" is not used [-Wunused-macros]
#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
^
* src/regex.c (STREQ): Remove unused macro. It should have been removed
in a [4538a5e: Refactor regex character class parsing in [:name:]]
commit but was mistakenly left out.
Stefan Monnier [Tue, 2 Aug 2016 17:01:26 +0000 (13:01 -0400)]
* cl-generic.el: Fix problems introduced by new load-history format
* lisp/emacs-lisp/cl-generic.el (cl--generic-load-hist-format): New function.
(cl-generic-define-method, cl--generic-describe): Use it.
(cl--generic-search-method): Adjust for new format.
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
* test/lisp/progmodes/elisp-mode-tests.el:
Use cl--generic-load-hist-format rather than hard-coding cl-generic's
internal format.
Hardcode regex syntax to remove dead code handling different syntax
Emacs only ever uses its own regex syntax so support for other syntaxes
is never used. Hardcode the syntax so that the compilar can detect such
dead code and remove it from compiled code.
The only exception is RE_NO_POSIX_BACKTRACKING which can be separatelly
specified. Handle this separatelly with a function argument (replacing
now unnecessary syntax argument).
With this patchset, size of Emacs binary on x86_64 machine is reduced by
around 60 kB:
new-sizes:-rwx------ 3 mpn eng 30254720 Jul 27 23:31 src/emacs
old-sizes:-rwx------ 3 mpn eng 30314828 Jul 27 23:29 src/emacs
* src/regex.h (re_pattern_buffer): Don’t define syntax field #ifdef emacs.
(re_compile_pattern): Replace syntax with posix_backtracking argument.
* src/regex.c (print_compiled_pattern): Don’t print syntax #ifdef emacs.
(regex_compile): #ifdef emacs, replace syntax argument with
posix_backtracking which is now used instead of testing for
RE_NO_POSIX_BACKTRACKING syntax.
(re_match_2_internal): Don’t access bufp->syntax #ifndef emacs.
(re_compile_pattern): Replace syntax with posix_backtracking argument.
* src/search.c (compile_pattern_1): Pass boolean posix_backtracking
instead of syntax to re_compile_pattern.
* src/regex.c (re_set_whitespace_regexp, whitespace_regexp): Delete.
(regex_compile): Add whitespace_regexp argument #ifdef emacs and wrap
whitespace_regexp-related code in an #ifdef emacs so it’s compiled out
unless building Emacs.
(re_compile_pattern): Pass whitespace_regexp argument to regex_compile
* src/search.c (compile_pattern_1): Don’t use re_set_whitespace_regexp,
pass the regex as argument to re_compile_pattern instead.
Instead of using a global variable for storing regex syntax, pass it
to re_compile_pattern. This is only enabled when compiling Emacs (i.e.
‘#ifdef emacs’).
* src/regex.h (re_set_syntax): Declare only #ifndef emacs.
(re_compile_pattern): Now takes syntax argument #ifdef emacs.
* src/regex.c (re_syntax_options): Define only #ifndef emacs.
(re_compile_pattern): Use the new syntax argument #ifdef emacs.
* src/search.c (compile_pattern_1): Don’t use re_set_syntax and
instead pass syntax to re_compile_pattern directly.
There is no way to specify before_dot and after_dot opcodes in a regex
so code handling those ends up being dead. Remove it.
* src/regex.c (print_partial_compiled_pattern, regex_compile,
analyze_first, re_match_2_internal): Remove handling and references to
before_dot and after_dot opcodes.
Refactor regex character class parsing in [:name:]
re_wctype function is used in three separate places and in all of
those places almost exact code extracting the name from [:name:]
surrounds it. Furthermore, re_wctype requires a NUL-terminated
string, so the name of the character class is copied to a temporary
buffer.
The code duplication and unnecessary memory copying can be avoided by
pushing the responsibility of parsing the whole [:name:] sequence to
the function.
Furthermore, since now the function has access to the length of the
character class name (since it’s doing the parsing), it can take
advantage of that information in skipping some string comparisons and
using a constant-length memcmp instead of strcmp which needs to take
care of NUL bytes.
* src/regex.c (re_wctype): Delete function. Replace it with:
(re_wctype_parse): New function which parses a whole [:name:] string
and returns a RECC_* constant or -1 if the string is not of [:name:]
format.
(regex_compile): Use re_wctype_parse.
* src/syntax.c (skip_chars): Use re_wctype_parse.
* test/src/regex-tests.el (regex-tests): Remove and split into multiple
tests cases.
(regex-tests-glbic-BOOST, regex-tests-glibc-PCRE,
regex-tests-glibc-PTESTS, regex-tests-glibc-TESTS): New test cases split
from ‘regex-tests’.
* test/src/regex-tests.el (regex-tests-generic-line): Referring to
‘buffer-file-name’ does not work when running the test from command
line, i.e. via make, which results in (wrong-type-argument stringp nil)
failures. Replace it with hard-coded path.
(regex-tests-BOOST, regex-tests-PCRE, regex-tests-PTESTS-whitelist,
regex-tests-TESTS-whitelist): ‘regex-tests-generic-line’ now includes
the ‘regex-resources’ path component so the tests don’t need to specify
it explicitly.
Dima Kogan [Sat, 12 Mar 2016 02:18:14 +0000 (18:18 -0800)]
New regex tests imported from glibc 2.21
* test/src/regex-resources/BOOST.tests:
* test/src/regex-resources/PCRE.tests:
* test/src/regex-resources/PTESTS:
* test/src/regex-resources/TESTS:
New test data files
[mina86@mina86.com: Moved files from test/src/regex/* to test/src/*.]
Paul Eggert [Tue, 2 Aug 2016 07:31:04 +0000 (03:31 -0400)]
Fix use-after-close in connect_network_socket
* src/process.c (connect_network_socket):
Reverse sense of previous fix. Problem reported by Ken Brown in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00004.html
Martin Rudalics [Sat, 30 Jul 2016 12:11:12 +0000 (14:11 +0200)]
Fix calculation of tool bar width reported by `frame-geometry' (Bug#24107)
* src/w32fns.c (Fw32_frame_geometry): Fix calculation of tool
bar width (Bug#24107). Reindent.
* src/xfns.c (frame_geometry): Fix calculation of tool bar
width on non-GTK builds.
Eli Zaretskii [Sat, 30 Jul 2016 08:32:02 +0000 (11:32 +0300)]
Fix region display while dragging mouse
* lisp/mouse.el (mouse-drag-track): Reset deactivate-mark in the
buffer of the drag event, to allow mark to be set and the region
be shown as we drag the mouse. (Bug#24030)
Eli Zaretskii [Sat, 30 Jul 2016 08:23:10 +0000 (11:23 +0300)]
Avoid warnings about undo list while decoding
* src/coding.c (coding_restore_undo_list): New function.
(decode_coding_gap, decode_coding_object): Temporarily set the
buffer's undo list to t, to avoid warnings when decoding changes
the buffer many times, e.g. due to post-read-conversion. Use
coding_restore_undo_list to make sure the undo list is restored.
(Bug#23813)
Vincent Belaïche [Fri, 29 Jul 2016 11:44:14 +0000 (13:44 +0200)]
Fix ses-delete-blanks to delete only blanks + documentation.
* doc/misc/ses.texi (Quick Tutorial): Mention the '!'
'ses-range' modifier as an alternative to 'ses+'.
(Advanced Features): Add a refernce to node 'Nonrelocatable
references' concerning function 'ses-rename-cell'.
(Standard formula functions): Mention the '!' 'ses-range'
modifier as an alternative to 'ses-delete-blanks'.
(More on cell printing): Fix fallback printer
definition. Minor editorial formatting changes.
(Nonrelocatable references): Document the use of
'ses-rename-cell' as a better way to make cell reference
non-relocatable.
(The data area): Document the presence of local printer
definitions in the data area.
* lisp/ses.el (ses-delete-blanks): Do not remove
*error*. Any error in an argument should propagate into the
using formula rather than being silently hidden !
Vincent Belaïche [Thu, 28 Jul 2016 15:41:21 +0000 (17:41 +0200)]
Enable addition of local printers from a mode hook.
* doc/misc/ses.texi (Printer functions): Split the node into 5
sub-nodes + add some extra documentation.
(Various kinds of printer functions): Make an itemisation to
disintguish better the 3 types of printers, give an example of
lambda printer definition.
(Standard printer functions): Add documentation for ses-prin1
printer function.
(Local printer functions): Add documentation for creating
local printers programmatically from a hook.
(Writing a lambda printer function): Add documentation about
anti-stackoverflow precautions to take when you call the
standard printer functions from inside a local printer.
* lisp/ses.el (ses-standard-printer-functions): Add ses-prin1
among standard printer function, and update docstring
accordingly.
(ses-call-printer, ses-export-tab): Call `ses-prin1' instead
of prin1-to-string.
(ses-define-local-printer): Add definition to arguments so
that a local printer can be defined programmatically from a
mode hook. Make docstring more substantial. Use completing
read for local printer name input. Plus some minor
optimization.
(ses-define-if-new-local-printer): New defsubst.
(ses-center, ses-center-span, ses-dashfill)
(ses-dashfill-span, ses-tildefill-span): Allow to pass printer
as an optional argument to superseed column printer/default
spreadsheet printer.
(ses-prin1): New defun.
Ken Brown [Wed, 27 Jul 2016 16:28:14 +0000 (12:28 -0400)]
Fix dired-test-bug22694
* test/lisp/dired-tests.el (dired-test-bug22694): Delete the
"bug22694" directory, if it exists, before running the test. It
might be left over from a previous aborted run of the test.
Fix ‘is multibyte’ test regex.c’s mutually_exclusive_p (bug#24020)
* src/regex.c (mutually_exclusive_p): Fix how whether character is
unibyte is tested when calling execute_charset function. This bug has
been introduced by [6dc6b00: Fix ‘[[:cc:]]*literal’ regex failing to
match ‘literal’] which dropped a call to IS_REAL_ASCII (c) macro.
Reinstitute it.
Eli Zaretskii [Tue, 26 Jul 2016 15:27:21 +0000 (18:27 +0300)]
Avoid segfaults in compute_motion
* src/indent.c (compute_motion): Don't turn on and don't use the
width cache unless the buffer's width-table is non-nil. This
avoids segfaults because code that uses the width cache assumes
the width-table exists. (Bug#24064)
Andrew Hyatt [Mon, 25 Jul 2016 03:58:47 +0000 (23:58 -0400)]
Add warning to format-alist docs.
*/doc/lispref/files.texi (format-alist) Change documentation for
format-alist to warn against file modifications when formatting, which
leads to incorrect results. (Bug#5440)
Fix ‘[[:cc:]]*literal’ regex failing to match ‘literal’ (bug#24020)
The regex engine tries to optimise Kleene star by avoiding backtracking
when it can detect that star’s operand cannot match what follows it in
the pattern.
For example, when ‘[[:alpha:]]*1’ tries to match a ‘foo’, the engine
will test the longest match for ‘[[:alpha:]]*’, namely ’foo’ which is
the entire string. Literal digit one still present in the pattern will
however not match the remaining empty string.
Normally, backtracking would be performed trying a shorter match for the
character class (namely ‘fo’ leaving ‘o’ in the string), but since the
engine knows whatever would be put back into the string cannot possibly
match literal digit one so no backtracking will be attempted.
In the regexes of the form ‘[[:CC:]]*X’, the optimisation can be applied
if the character class CC does not match character X. In the above
example, this holds because digit one is not in alpha character class.
This test is performed by mutually_exclusive_p function but it did not
check class bits of a charset opcode. This resulted in an assumption
that character classes do not match multibyte characters. For example,
it would incorrectly conclude that [[:alpha:]] doesn’t match ‘ż’.
This, in turn, led to the aforementioned Kleene star optimisation being
incorrectly applied in patterns such as ‘[[:graph:]]*☠’ (which should
match ‘☠’ but doesn’t as can be tested by executing
(string-match-p "[[:graph:]]*☠" "☠")
which should return 0 but instead yields nil.
This issue affects any class witch matches multibyte characters, i.e.
if ‘[[:cc:]]’ matches a multibyte character X then ‘[[:cc:]]*X’ will
fail to match ‘X’.
* src/regex.c (executing_charset): A new function for executing the
charset and charset_not opcodes. It performs check on the character
taking into consideration existing bitmap, range table and class bits.
It also advances the pointer in the regex bytecode past the parsed
opcode.
(CHARSET_LOOKUP_RANGE_TABLE_RAW, CHARSET_LOOKUP_RANGE_TABLE): Removed.
Code now included in executing_charset.
(mutually_exclusive_p, re_match_2_internal): Changed to take advantage
of executing_charset function.
* test/src/regex-tests.el: New file with tests for the character class
matching.
Paul Eggert [Sun, 24 Jul 2016 09:10:09 +0000 (11:10 +0200)]
‘signal’ no longer returns
Although for decades ‘signal’ has been documented to not return,
a corner case in the Lisp debugger causes ‘signal’ to return.
Remove the corner case and adjust Emacs internals accordingly.
An alternative would be to document the corner case, but this
would complicate the Lisp API unnecessarily. (Bug#24047)
* src/eval.c (signal_or_quit): New function, with most of the
old contents of Fsignal.
(quit): New function, which uses signal_or_quit and which
might return. All keyboard-based callers of Fsignal (Qquit,
Qnil) changed to use this new function instead.
(Fsignal): Use signal_or_quit. Now _Noreturn. All callers
changed.
(xsignal): Move to lisp.h.
* src/lisp.h (xsignal): Now an inline function, as it's now
just an alias for Fsignal.
Alan Mackenzie [Sat, 23 Jul 2016 15:03:07 +0000 (15:03 +0000)]
Fontify C++ parameter packs.
This fixes debbugs #23610.
* lisp/progmodes/cc-langs.el (c-pack-ops, c-pack-key): New
c-lang-defconsts/defvars.
(c-type-decl-prefix-key): Add "..." and "&&" into the C++ version.
* lisp/progmodes/cc-engine.el (c-forward-type): Handle matches of c-pack-key.
Adjust match data before calling after-change-funs
It's important to adjust the match data in between calling
before-change-functions and after-change-functions, so that buffer
change hooks will always see match-data consistent with buffer content.
(Bug #23917)
* src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if
true call update_search_regs. Update all callers (except
Freplace_match) to pass 0 for the new parameter.
* src/search.c (update_search_regs): New function, extracted from
Freplace_match.
(Freplace_match): Remove match data adjustment code, pass 1 for
ADJUST_MATCH_DATA to replace_range instead.