Eli Zaretskii [Fri, 4 Nov 2016 09:50:48 +0000 (11:50 +0200)]
Clarify doc string of 'transpose-sexps'
* lisp/simple.el (transpose-sexps): Clarify the conditions for
transposing sexps that are lists or strings. Mention the effect
of the prefix argument. (Bug#24860)
Eli Zaretskii [Fri, 4 Nov 2016 09:16:40 +0000 (11:16 +0200)]
Improve documentation of 'font-lock-remove-keywords'
* doc/lispref/modes.texi (Customizing Keywords): Clarify the
'keywords' argument of 'font-lock-remove-keywords'. Suggested by
Hong Xu <hong@topbug.net>. (Bug#24830)
python.el: Fix detection of native completion in Python 3 (bug #24401)
With Python 3.5, (python-shell-completion-native-get-completions ... "")
would return an empty list, causing python.el to think that native
completion was unavailable (the difference between Python 2 and Python 3
is due to https://bugs.python.org/issue25660).
* lisp/progmodes/python.el (python-shell-completion-native-try): Use "_"
to check whether native completion is available instead of "".
Noam Postavsky [Tue, 25 Oct 2016 01:22:07 +0000 (21:22 -0400)]
Inhibit buffer relocation during regex searches
* src/search.c (looking_at_1, fast_looking_at, search_buffer): Prevent
relocation of buffer contents during calls to re_search_2. This ensures
the pointers into buffer text won't be invalidated by
r_alloc_sbrk (called from malloc with configurations where
REL_ALLOC=yes).
Paul Eggert [Tue, 25 Oct 2016 19:13:20 +0000 (12:13 -0700)]
Default REL_ALLOC to 'no'
This should make ralloc-related bugs less likely on GNU/Linux
systems with bleeding-edge glibc. See the email thread containing:
http://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00801.html
Do not merge to master.
* configure.ac (REL_ALLOC): Default to 'no' on all platforms, not
merely on platforms with Doug Lea malloc. Although bleeding-edge
glibc no longer exports __malloc_initialize_hook and so longer
passes the configure-time test for Doug Lea malloc, ralloc tickles
longstanding bugs like Bug#24358 and Bug#24764 and Emacs is likely
to be more reliable without it. This patch is not needed on
master, which uses hybrid malloc in this situation.
Eli Zaretskii [Mon, 24 Oct 2016 13:59:34 +0000 (16:59 +0300)]
Another fix for using pointer to buffer text
* src/search.c (Freplace_match): Move the call to BYTE_POS_ADDR
after the call to xpalloc, to avoid the danger of buffer text
relocation after its address was taken. (Bug#24358)
Michael Albinus [Mon, 24 Oct 2016 13:04:25 +0000 (15:04 +0200)]
Fix Bug#24478
* lisp/net/tramp-sh.el (tramp-histfile-override): Change default value
to "~/.tramp_history".
(tramp-open-shell): Check proper HISTFILE setting.
(tramp-maybe-open-connection): Cleanup also for errors. (Bug#24478)
Paul Eggert [Mon, 24 Oct 2016 04:54:13 +0000 (21:54 -0700)]
Port --enable-gcc-warnings to bleeding-edge glibc
Bleeding-edge glibc sets emacs_cv_var_doug_lea_malloc to 'no'.
Do not merge to master.
* configure.ac: Check for valloc decl when compiling gmalloc.c.
* src/gmalloc.c (emacs_abort) [emacs]: Adjust decl to match
what is in lisp.h. Remove duplicate decl.
(aligned_alloc): #undef before defining.
(aligned_alloc, memalign) [!MSDOS]: Declare.
(valloc) [HAVE_DECL_VALLOC]: Remove duplicate decl.
Paul Eggert [Sun, 23 Oct 2016 04:12:54 +0000 (21:12 -0700)]
Port to GCC 6.2.1 + --enable-gcc-warnings
* src/regex.c (ENSURE_FAIL_STACK, re_search_2):
Redo recent regex changes to avoid complaints from GCC 6.2.1 when
Emacs is configured with --enable-gcc-warnings. Also, work around
GCC bug 78081, which was uncovered by this new code.
Noam Postavsky [Mon, 3 Oct 2016 22:49:56 +0000 (18:49 -0400)]
Let describe-function work for lambda again
Since commit "* lisp/help-fns.el (describe-function): More type
checking[...]", `describe-function' throws a user-error when given a
non-symbol. This prevents the [back] button in a *Help* buffer from
working when the page it goes back to describes an anonymous
function (e.g., the result of `describe-key' on a key which is bound to
a lambda form).
* lisp/help-fns.el (describe-function): Move the checks on FUNCTION
being an fbound symbol into the `interactive' form. This allows
non-interactive calls to pass an anonymous function (Bug #24221). Note
that passing a non-bound symbol non-interactively will still trigger a
`void-function' error from `describe-function-1'.
Noam Postavsky [Thu, 20 Oct 2016 00:23:50 +0000 (20:23 -0400)]
Fix handling of allocation in regex matching
`re_match_2_internal' uses pointers to the lisp objects that it
searches. Since it may call malloc when growing the "fail stack", these
pointers may be invalidated while searching, resulting in memory
curruption (Bug #24358).
To fix this, we check the pointer that the lisp object (as specified by
re_match_object) points to before and after growing the stack, and
update existing pointers accordingly.
* src/regex.c (STR_BASE_PTR): New macro.
(ENSURE_FAIL_STACK, re_search_2): Use it to convert pointers into
offsets before possible malloc call, and back into pointers again
afterwards.
(POS_AS_IN_BUFFER): Add explanatory comment about punning trick.
* src/search.c (search_buffer): Instead of storing search location as
pointers, store them as pointers and recompute the corresponding address
for each call to `re_search_2'.
(string_match_1, fast_string_match_internal, fast_looking_at):
* src/dired.c (directory_files_internal): Set `re_match_object' to Qnil
after calling `re_search' or `re_match_2'.
* src/regex.h (re_match_object): Mention new usage in commentary.
Eli Zaretskii [Wed, 19 Oct 2016 18:10:31 +0000 (21:10 +0300)]
Fix documentation of 'alist-get'
* doc/lispref/lists.texi (Association Lists): Fix the signature of
'alist-get'. Fix the markup, the wording, and the punctuation in
the description. (Bug#24740)
Göktuğ Kayaalp [Tue, 18 Oct 2016 00:01:58 +0000 (03:01 +0300)]
Fix display of vc-dir CVS file statuses in subdirectories
* lisp/vc/vc-cvs.el (vc-cvs-dir-status-files): Use 'cvs update'
instead of 'cvs status'. It's faster, easier to parse, and
relieves us of the need to use vc-expand-dirs. (Bug#24082)
(vc-cvs-after-dir-status): Parse its output.
Eli Zaretskii [Mon, 17 Oct 2016 07:25:58 +0000 (10:25 +0300)]
Fix time-related data types in 2 editfns.c functions
* src/editfns.c (format_time_string, Fcurrent_time_zone): Pass a
pointer to time_t value to emacs_localtime_rz and gmtime_r,
instead of relying on struct timespec's tv_sec member to be of
compatible type.
Paul Eggert [Sun, 16 Oct 2016 23:25:47 +0000 (16:25 -0700)]
Port to Ubuntu 16.10, which needs gcc -nopie
* configure.ac (emacs_cv_prog_cc_no_pie): Rename from
emacs_cv_prog_cc_nopie. All usages changed. Check for -no-pie in
preference to -nopie (Bug#24682). Backport from master.
Eli Zaretskii [Sat, 15 Oct 2016 13:53:36 +0000 (16:53 +0300)]
Keep point when switching from and to *terminal* buffer
* lisp/term.el (term-reset-size): Don't reset the size if it
didn't change. If the size did change, restore point after
adjusting the size. (Bug#24465)
Eli Zaretskii [Fri, 14 Oct 2016 19:52:46 +0000 (22:52 +0300)]
Avoid crashes due to objects read with the #n=object form
* src/lread.c (read1): Use Fcons for 'placeholder', not AUTO_CONS,
because elements of the list in 'read_objects' cannot be allocated
off the stack. (Bug#24640)
Paul Eggert [Wed, 12 Oct 2016 16:16:31 +0000 (09:16 -0700)]
Port --enable-gcc-warnings to GCC 6.2.1
Backport from master.
* src/conf_post.h (GNUC_PREREQ): New macro.
* src/keyboard.c: Use it to work around GCC bug 54561.
* src/process.c (would_block): New function.
(server_accept_connection, wait_reading_process_output, send_process):
Use it.
Paul Eggert [Wed, 12 Oct 2016 16:01:03 +0000 (09:01 -0700)]
Work around Samba bug with ':' in symlink contents
* src/filelock.c (current_lock_owner): When reading the contents
of a lock, treat the UTF-8 for U+F022 as if it were ':' (Bug#24656).
Backport from master.
Eli Zaretskii [Wed, 12 Oct 2016 08:59:53 +0000 (11:59 +0300)]
Adapt GDB scripts to '--enable-check-lisp-object-type' builds
* etc/emacs-buffer.gdb <$qnil>: New variable.
(ybuffer-list, yset-buffer): Use $qnil for comparing against
'nil', as direct comparison with Qnil doesn't work in a build with
'--enable-check-lisp-object-type'.
* src/.gdbinit: Adapt commands of the temporary breakpoint in
init_sys_modes to a build with '--enable-check-lisp-object-type'.
Eli Zaretskii [Sat, 8 Oct 2016 19:31:14 +0000 (22:31 +0300)]
Allow to disable compaction of font caches
* src/font.c (syms_of_font) <inhibit-compacting-font-caches>: New
boolean variable.
* src/alloc.c (compact_font_caches): Use it to bypass the call to
compact_font_cache_entry. (Bug#24634) (Bug#24565)
Eli Zaretskii [Sat, 8 Oct 2016 19:03:51 +0000 (22:03 +0300)]
Allow selection of font for symbols as in Emacs 24.x
* src/fontset.c (syms_of_fontset) <use-default-font-for-symbols>:
New boolean variable.
(face_for_char): Use it to fall back to pre-Emacs 25.1 behavior
when selecting fonts for displaying symbol and punctuation
characters. (Bug#24644)
Eli Zaretskii [Sat, 8 Oct 2016 14:16:33 +0000 (17:16 +0300)]
; Fix last commit
* doc/lispref/functions.texi (Argument List): Restore the index
entry for 'wrong-number-of-arguments'. (Bug#24222)
* doc/lispref/errors.texi: Fix cross-reference for
'wrong-number-of-arguments'.
Eli Zaretskii [Sat, 8 Oct 2016 07:52:52 +0000 (10:52 +0300)]
Fix infloop in redisplay due to truncated lines and invisible text
* src/xdisp.c (forward_to_next_line_start): Don't call
'get_next_display_element' after finding the end of line. This
avoids setting the row's end position to the wrong value when the
next screen line begins with invisible text; that wrong value
caused set_cursor_from_row position the cursor in the wrong screen
line, and eventually triggered bug#24109.
Eli Zaretskii [Thu, 6 Oct 2016 15:08:31 +0000 (18:08 +0300)]
Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2
* nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before
defining to avoid redefinition warnings.
* nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid
inclusion of sys/stat.h from the system headers, which could then
lead to compilation errors due to redefinition of 'struct stat'
etc. This is needed because latest versions of MinGW runtime
include sys/stat.h from wchar.h.
* src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily
redefine to 4 to avoid conflict between 2 definitions of
MemoryBarrier. (Bug#24613)
Karl Fogel [Tue, 4 Oct 2016 21:03:27 +0000 (16:03 -0500)]
Clarify that doc fixes are okay in feature freeze
* CONTRIBUTE (branches): Explain that doc fixes are always safe, even
on a release branch in feature freeze. Tweak wording of paragraph
after that to avoid a misleading contrast.
Eli Zaretskii [Tue, 4 Oct 2016 19:12:08 +0000 (22:12 +0300)]
Avoid crashes when setting the cursor
* src/xdisp.c (display_and_set_cursor): Don't index glyphs of a
glyph row if hpos is out of valid bounds. This avoids crashes in
some rare cases. (Bug#24614)
Karl Fogel [Mon, 3 Oct 2016 00:47:27 +0000 (19:47 -0500)]
Document yank behavior in the right place
* lisp/simple.el (yank): Document the handling of the
`yank-handled-properties' and `yank-excluded-properties' variables,
and the `yank-handler' text property.
(yank-pop): Refer to `yank' now (bug#286)
* lisp/subr.el (insert-for-yank): Refer to `yank' now.
(insert-for-yank-1): Refer to `insert-for-yank' now.
See this thread for discussion:
https://lists.gnu.org/archive/html/emacs-devel/2016-09/threads.html#00329
From: Karl Fogel
To: Emacs Devel
Subject: Question about intended behavior of 'insert-for-yank-1'.
Date: Mon, 12 Sep 2016 00:17:14 -0500
Message-ID: <874m5lr92d.fsf@red-bean.com>
It is useful to be able to call `isearch-done' unconditionally to
ensure a non-isearching state.
* lisp/isearch.el (isearch-done): Check that `isearch--current-buffer'
is a live buffer before using it (Bug #21091).
* test/lisp/isearch-tests.el (isearch--test-done): Test it.
* lisp/calendar/icalendar.el (icalendar--read-element): Avoid a regex
stack overflow by not using regex to extract values from calendar
events. (Bug#24315)
Paul Eggert [Tue, 27 Sep 2016 00:00:03 +0000 (17:00 -0700)]
Regexp Functions doc minor fixes
* doc/lispref/searching.texi (Regexp Functions):
Fix misspelling of “matching”. Use @table for table.
Reformat code example to fit into info file width (Bug#17862).
Eli Zaretskii [Mon, 26 Sep 2016 16:02:01 +0000 (19:02 +0300)]
Improve documentation of 'expand-abbrev' and wrapper hooks
* lisp/simple.el (filter-buffer-substring-functions)
(buffer-substring--filter): Add a link to 'with-wrapper-hook' as
the place to look for documentation of wrapper hooks.
* lisp/minibuffer.el (completion-in-region-functions)
(completion--in-region): Add a link to 'with-wrapper-hook' as the
place to look for documentation of wrapper hooks.
* lisp/abbrev.el (expand-abbrev, abbrev--default-expand): Clarify
the doc strings. (Bug#24540)
* doc/lispref/text.texi (Buffer Contents): Mention
'with-wrapper-hook's doc string as the place to learn about that
obsolete facility.