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.
Paul Eggert [Tue, 19 Jul 2016 13:23:14 +0000 (15:23 +0200)]
Port to glibc 2.24 (pre-release) + ppc64
Backport from master (Bug#24033).
Inspired by a suggestion by Florian Weimer in:
https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
* src/emacs.c (main) [__PPC64__]:
Special case for __PPC64__, which needs ASLR disabled in
dumped Emacs too.
Robert Cochran [Fri, 15 Jul 2016 19:45:56 +0000 (12:45 -0700)]
Expand FIXME near definition of fboundp
This expansion of the FIXME is so that future developers are aware of
the potential problems of aliasing fboundp to symbol-function without
taking backwards compatibility into account.
* src/data.c (fboundp): Note potential backwards compatibility issues in
FIXME.
Stefan Monnier [Thu, 14 Jul 2016 19:05:49 +0000 (15:05 -0400)]
Fix eieio vs cl-generic incompatibilities found in Rudel (bug#23947)
* lisp/emacs-lisp/cl-generic.el (cl-generic-apply): New function.
* lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Fix incorrect
mapping between cl-no-applicable-method and EIEIO's no-applicable-method.
* lisp/emacs-lisp/eieio-core.el (eieio--class-precedence-c3):
`class' is not a symbol but a class object.
Stephen Berman [Tue, 12 Jul 2016 20:11:22 +0000 (22:11 +0200)]
Improve documentation of search functions
Make the documentation of the search functions more accurate,
complete, and uniform; in particular, extend the description of
the effect when the 'count' parameter is a negative number to all
of these functions.
* src/search.c (Fsearch_backward, Fsearch_forward)
(Fre_search_backward, Fre_search_forward)
(Fposix_search_backward, Fposix_search_forward):
* lisp/isearch.el (word-search-backward, word-search-forward)
(word-search-backward-lax, word-search-forward-lax): Improve doc
strings as described above.
* doc/lispref/searching.texi (String Search, Regexp Search)
(POSIX Regexps): Use 'count' instead of 'repeat' as the name of
the fourth parameter of the *-search-{forward,backward} functions
and improve documentation as described above.
Michael Albinus [Tue, 12 Jul 2016 18:02:10 +0000 (20:02 +0200)]
Delete environment variables in Tramp when needed
* lisp/net/tramp-sh.el (tramp-get-env-with-u-option): New defun.
(tramp-sh-handle-start-file-process)
(tramp-sh-handle-process-file, ): Use it. (Bug#23952)
Eli Zaretskii [Sun, 10 Jul 2016 19:06:57 +0000 (22:06 +0300)]
Fix 'vertical-motion' in non-interactive sessions
* src/indent.c (Fvertical_motion): Don't return uninitialized
value in non-interactive session. This fixes random errors in
batch mode, see
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00609.html
and
http://lists.gnu.org/archive/html/emacs-devel/2016-07/msg00500.html
for the details.
Paul Eggert [Tue, 5 Jul 2016 18:40:40 +0000 (20:40 +0200)]
Fix open-network-stream responsiveness
Problem reported by Christer Ekholm (Bug#23864).
Backport from master.
* src/process.c (wait_reading_process_output):
Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu
when wait == INFINITY and got_output_end_time is invalid.
In this case the code should break, not continue.
Phillip Lord [Thu, 30 Jun 2016 21:06:00 +0000 (22:06 +0100)]
Fix missing point information in undo
* src/undo.c (record_insert): Use record_point instead of
prepare_record, and do so unconditionally.
(prepare_record): Do not record first change.
(record_point): Now conditional on state before the last command.
(record_delete): Call record_point unconditionally.
(record_property_change): Use prepare_record.
(record_marker_adjustments): Use prepare_record.
Eli Zaretskii [Mon, 4 Jul 2016 15:34:40 +0000 (18:34 +0300)]
Avoid crashes when buffer modification hooks clobber match data
* src/search.c (Freplace_match): Error out if buffer modification
hooks triggered by buffer changes in replace_range, upcase-region,
and upcase-initials-region clobber the match data needed to be
adjusted for the replacement. (Bug#23869)
Noam Postavsky [Sat, 25 Jun 2016 00:39:24 +0000 (20:39 -0400)]
Clarify lexical binding with symbol args behavior
* doc/lispref/variables.texi (Lexical Binding): Clarify that symbol
arguments always refer to dynamic values (Bug #23781). Remove mention
of obsolete restriction regarding lexical binding for defun and
defmacro, this no longer applies since 61b108cc 2012-05-29 "*
lisp/emacs-lisp/byte-run.el (defmacro, defun): Move from C...".
Eli Zaretskii [Wed, 29 Jun 2016 16:14:58 +0000 (19:14 +0300)]
Avoid assertion violations when rendering some fonts
* src/dispextern.h (FONT_TOO_HIGH): Don't consider a font "too
high" if its pixel_size value is zero. This avoids assertion
violations at the end of x_produce_glyphs.
Eli Zaretskii [Sun, 26 Jun 2016 16:40:12 +0000 (19:40 +0300)]
Fix slow redisplay in term-mode
* lisp/term.el (term-mode): Move the setting of
bidi-paragraph-direction from 'ansi-term' to here, since term-mode
is also affected. Do not merge to master, since there the problem
is solved in bidi.c by changing the regexps that delimit a
paragraph. (Bug#23801)
Eli Zaretskii [Thu, 23 Jun 2016 15:09:14 +0000 (18:09 +0300)]
Fix documentation of 'assoc-string' and 'compare-strings'
* src/minibuf.c (Fassoc_string): Clarify how CASE-FOLD affects the
string comparison. (Bug#23833)
* src/fns.c (Fcompare_strings): Fix the description of how
IGNORE-CASE affects the comparison.
* doc/lispref/strings.texi (Text Comparison): Clarify how
CASE-FOLD affects the string comparison in 'assoc-string'. Fix
the description of how IGNORE-CASE affects the comparison in
'compare-strings'.
Dmitry Gutov [Wed, 22 Jun 2016 18:20:06 +0000 (21:20 +0300)]
Error on multibyte characters in HTTP request
* lisp/url/url-http.el (url-http-create-request): Check the
constructed request in the end to verify that it does not contain
multibyte characters (bug#23750).
Eli Zaretskii [Sat, 18 Jun 2016 09:50:57 +0000 (12:50 +0300)]
Clarify documentation of 'font-lock-maximum-decoration'
* doc/emacs/display.texi (Font Lock): Explain how to make the
customization of 'font-lock-maximum-decoration' effective for an
existing buffer. (Bug#23783)
Noam Postavsky [Sat, 4 Jun 2016 13:02:20 +0000 (09:02 -0400)]
Fbackward_prefix_chars: stay within buffer bounds
The commit 1fd3172d "(Fbackward_prefix_chars): Set point properly while
scanning" (1998-03-18), moved the check against of the position against the
buffer beginning out the loop condition so that we might end up checking
the syntax of characters before the beginning of the buffer. This can
cause segfaults or trigger a "Point before start of properties" error in
`update_interval' (called indirectly from `char_quoted').
* src/syntax.c (Fbackward_prefix_chars): Stop the loop when beginning of
buffer is reached (Bug #3552, Bug #17132, Bug #19379).
Paul Eggert [Wed, 15 Jun 2016 05:40:18 +0000 (22:40 -0700)]
Fix ifdef-vs-if typo with RANDR13_LIBRARY
* src/xfns.c (x_get_monitor_attributes_xrandr): Use #if, not #ifdef.
This ports to systems that predate xrandr 1.3. See Christian Lynbech in:
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00198.html
Stephen Berman [Wed, 15 Jun 2016 18:08:16 +0000 (20:08 +0200)]
Improve last todo-mode fix
* lisp/calendar/todo-mode.el (todo-read-category): Use
set-keymap-parent instead of copy-keymap, and default (as
previously) to the global binding (for rationale, see
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00217.html).
Ken Brown [Sat, 11 Jun 2016 12:31:27 +0000 (08:31 -0400)]
Fix dbus crash on 32-bit Cygwin
* src/dbusbind.c (Fdbus__init_bus): Use make_save_pointer to store
connection address. (Bug#23741)
(xd_lisp_dbus_to_dbus): Use XSAVE_POINTER to retrieve connection
address.
Jules Tamagnan [Fri, 10 Jun 2016 09:08:29 +0000 (12:08 +0300)]
Fix eldoc-related freezes in python mode
* lisp/progmodes/python.el (python-eldoc-get-doc): New defvar.
(python-eldoc-function-timeout)
(python-eldoc-function-timeout-permanent): New defcustoms.
(python-eldoc-function): If python-eldoc--get-doc-at-point times
out, effectively turn off ElDoc in current buffer. (Bug#23609)