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.
Eli Zaretskii [Fri, 23 Sep 2016 14:25:55 +0000 (17:25 +0300)]
Fix display of cursor when 'blink-cursor-delay' has small value
* lisp/frame.el (blink-cursor-check, blink-cursor-mode):
Protect ourselves against too small values of blink-cursor-delay.
This avoids erratic display of the cursor, or even failure to
display it, when user types text at high speed or leans on a key
to invoke the keyboard auto-repeat feature. (Bug#24372)
Noam Postavsky [Sat, 6 Aug 2016 02:11:00 +0000 (22:11 -0400)]
Fix debugging of string-match-p errors
* src/eval.c (call_debugger): Bind inhibit-changing-match-data to nil so
that debugger code that needs to do regexp match won't break
(Bug #23949, Bug #24166, Bug#16294).
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, 21 May 2016 09:35:08 +0000 (12:35 +0300)]
Fix 'vertical-motion' and 'posn-at-point' under 'visual-line-mode'
* src/xdisp.c (move_it_in_display_line_to): Don't assume we can
wrap on a whitespace character if it's followed by another
whitespace character. When returning under WORD_WRAP for a screen
line that is continued, restore to wrap point when atpos/atx
position would be displayed on the next screen line due to
line-wrap. (Bug#23570)
Paul Eggert [Fri, 13 May 2016 20:30:33 +0000 (13:30 -0700)]
Improve display of tex-verbatim and Info quoted
Problem reported by Glenn Morris (Bug#19889).
* doc/emacs/display.texi (Standard Faces):
* doc/lispref/display.texi (Basic Faces):
* etc/NEWS: Mention fixed-pitch-serif.
* lisp/faces.el (face-font-family-alternatives):
New family alias Monospace Serif.
(fixed-pitch-serif): New face, which uses the new family.
* lisp/info.el (Info-quoted):
* lisp/textmodes/tex-mode.el (tex-verbatim): Use the new face.
* test/lisp/legacy/font-parse-tests.el (font-parse-tests--data):
Add test case for Monospace Serif.
Run find-function-after-hook after finding a symbol
* lisp/emacs-lisp/find-func.el (find-library):
* lisp/help-mode.el (help-function-def, help-variable-def):
Run `find-function-after-hook' inside the help-function of the
buttons (bug#22583).
* etc/NEWS: Mention the change.
Eli Zaretskii [Fri, 23 Sep 2016 08:27:18 +0000 (11:27 +0300)]
Improve documentation of overlay priorities
* doc/lispref/display.texi (Overlay Properties): Minor copyedits.
By popular demand, mention the '(PRIMNARY . SECONDARY)' form of
overlay properties used for the region. (Bug#20253)
Eli Zaretskii [Fri, 23 Sep 2016 08:08:34 +0000 (11:08 +0300)]
Fix 'dired-compress-files'
* lisp/dired-aux.el (dired-do-compress-to): Make sure the archive
file name is fully expanded by running it through
'expand-file-name'. Suggested by Drew Adams <drew.adams@oracle.com>.
(Bug#24486) Doc fix.
* lisp/dired.el: Regenerated changes in autoloads.
Eli Zaretskii [Fri, 23 Sep 2016 07:52:07 +0000 (10:52 +0300)]
Update commentary of STRING_CHAR and FETCH_MULTIBYTE_CHAR
* src/character.h (STRING_CHAR):
* src/buffer.h (FETCH_MULTIBYTE_CHAR): Update commentary: these
two macros no longer do any character unification, so the caveats
in those comments are no longer pertinent.
Eli Zaretskii [Wed, 21 Sep 2016 15:10:29 +0000 (18:10 +0300)]
Fix tagging of DEFUN by etags
* lib-src/etags.c (C_entries): Tag DEFUN twice: once with its C
name, and then again with its Lisp name. This restores the
ability to find Lisp primitives by their C name, which was lost
when the etags back-end was switched to a more strict search
criteria.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to the changes in etags.c wrt
tagging DEFUN.
Eli Zaretskii [Wed, 21 Sep 2016 15:00:18 +0000 (18:00 +0300)]
Avoid resetting track-mouse by mouse clicks
* lisp/mouse.el (mouse-drag-line, mouse-drag-track): Don't assume
the previous value of track-mouse is nil; instead, save and
restore the previous value. (Bug#24480)
Eli Zaretskii [Sat, 17 Sep 2016 09:20:09 +0000 (12:20 +0300)]
Document that desktop file overrides frame parameters
* doc/emacs/misc.texi (Saving Emacs Sessions):
* doc/emacs/frames.texi (Frame Parameters): Document that frame
parameters restored by desktop.el take precedence over the
customizations in the init file, and explain how to countermand
that. For the details of the issue, see
http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00318.html.
* src/window.h (WINDOW_MODE_LINE_HEIGHT, WINDOW_HEADER_LINE_HEIGHT): Fix
confusing claim that "height is in pixels and in lines"; in fact it's in
pixels.