* lisp/window.el (window--process-window-list): No-op if no processes.
This avoids an issue with save-selected-window (from walk-windows)
failing if frame.el is not loaded, eg if the terminal is resized
during startup of a -nw CANNOT_DUMP build. (Bug#23369).
Paul Eggert [Wed, 27 Apr 2016 22:52:53 +0000 (15:52 -0700)]
Port dumping to NetBSD with PaX
Problem reported by Thomas Klausner (Bug#23371).
* configure.ac (PAXCTL_dumped, PAXCTL_notdumped): New vars.
Set them to setfattr and/or paxctl commands appropriate for
GNU/Linux and/or NetBSD; the latter prefers paxctl +a. Search
for paxctl only if setfattr is not found.
* src/Makefile.in (PAXCTL_dumped, PAXCTL_notdumped):
New vars, replacing PAXCTL_if_present and SETFATTR_if_present.
All uses changed.
Anders Lindgren [Tue, 26 Apr 2016 18:58:52 +0000 (20:58 +0200)]
Fix bug#22891: wrong terminal width when a fringe width is zero.
When either fringe width is zero, Emacs reserved one column for a
continuation glyph. Terminal windows does not take this into
account when the frame is resized.
* lisp/window.el (window-adjust-process-window-size): Use
`window-max-chars-per-line' instead of `window-body-width'.
* lisp/term.el (term-window-width): Remove function. (It does the
same as `window-max-chars-per-line' but without recent bug fixes.)
(term-mode): Use `window-max-chars-per-line' instead of
`term-window-width'.
Python 3.5, released in mid September 2015, introduced a few new
keywords to better support asynchronous code, "async" and "await"
in particular. See https://www.python.org/dev/peps/pep-0492/ for
details. (Bug#21783)
* lisp/progmodes/python.el (python-rx-constituents): Add async
def/for/with as block-start and async def as defun.
* lisp/progmodes/python.el (python-font-lock-keywords): Add async
def/for/with as keyword.
* test/automated/python-tests.el (python-indent-after-async-block-1,
python-indent-after-async-block-2, python-indent-after-async-block-3,
python-nav-beginning-of-defun-3): New tests to test indentation and
navigation for the async keyword.
Mark Oteiza [Tue, 26 Apr 2016 15:42:53 +0000 (11:42 -0400)]
Partially revert previous change.
This commit partially reverts 0f332848cdb2ed6d46771914a911cbca194cd51a.
* lisp/rect.el (rectangle--highlight-for-redisplay): Use region face.
This function is for rectangle-mark-mode, not string-rectangle.
Eli Zaretskii [Mon, 25 Apr 2016 08:28:17 +0000 (11:28 +0300)]
Don't mention ~/.emacs.bmk literally in doc strings
* lisp/bookmark.el (bookmark-save-flag, bookmark-load): Don't
mention "~/.emacs.bmk" explicitly as the default bookmark file in
the doc strings. (Bug#23350)
(vc-git-mode-line-string): Don't use `replace-regexp-in-string'
* lisp/vc/vc-git.el (vc-git-mode-line-string): Use `substring'
instead of `replace-regexp-in-string', because REV can be nil
(e.g. when FILE is a directory, bug#23344), and we actually know
we only need the first 4 characters.
Martin Rudalics [Fri, 22 Apr 2016 09:56:03 +0000 (11:56 +0200)]
In x_set_window_size restore do_pending_window_change calls
* src/xterm.c (x_set_window_size):
* src/w32term.c (x_set_window_size): Restore
do_pending_window_change calls after their stupid removal on
2015-08-31.
Fix Alt-modified keys on some European MS-Windows keyboards
* src/w32fns.c (deliver_wm_chars): If the reported character is
ASCII, AND Meta modifier is a candidate, behave as if Meta is
present, i.e. fall back to the legacy code. (Bug#23251)
Eli Zaretskii [Wed, 20 Apr 2016 14:52:25 +0000 (17:52 +0300)]
Clarify documentation of 'dired-mark-files-containing-regexp'
* doc/emacs/dired.texi (Marks vs Flags): Clarify that for files
visited in buffers, 'dired-mark-files-containing-regexp' searches
the buffer rather than the file on disk. (Bug#22694)
* lisp/dired.el (dired-mark-files-containing-regexp): Clarify that
for files visited in buffers, 'dired-mark-files-containing-regexp'
searches the buffer rather than the file on disk. (Bug#22694)
Eli Zaretskii [Tue, 19 Apr 2016 15:06:52 +0000 (18:06 +0300)]
Make tmm-menubar work in correct order again
* lisp/tmm.el (tmm-prompt): Don't reverse 'tmm-km-list' right at the
beginning; instead, pass a reversed copy to 'tmm--completion-table'.
(Bug#23309)
(tmm-menubar): Fix an off-by-one error in determining the menu
item when the function is called with a non-nil 'x-position'
argument.
* lisp/progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp): Update.
(vhdl-mode): No longer set comment-padding.
(vhdl-begin-p): Handle missing space between keyword and parenthesis.
(vhdl-beginning-of-statement-1): Fix indentation for "else generate".
(vhdl-template-else, vhdl-template-elsif): Support generate statement.
(vhdl-re-search-forward, vhdl-re-search-backward): Save match data.
Paul Eggert [Sun, 17 Apr 2016 02:49:15 +0000 (19:49 -0700)]
Tweak configure.ac syntax in recent module patch
* configure.ac: Use proper Autoconf parenthesization in
recent HAVE_MODULES patch. Although this doesn’t fix any bugs,
the previous syntax was confusing.
Mark Oteiza [Sat, 16 Apr 2016 18:40:17 +0000 (14:40 -0400)]
Make sh-electric-here-document-mode accessible in sh-mode-hook. (Bug#3226)
* lisp/progmodes/sh-script.el (sh-mode-hook): Add
sh-electric-here-document-mode as an option and the default value.
(sh-mode): Mention sh-mode-hook in docstring.
(sh-mode): Remove sh-electric-here-document-mode invocation.
Eli Zaretskii [Sat, 16 Apr 2016 10:53:17 +0000 (13:53 +0300)]
Fix minor issues with removing left or right fringes
* lisp/window.el (window-max-chars-per-line): Account for
'left-fringe-width' and 'right-fringe-width' variables.
* doc/lispref/windows.texi (Window Sizes): Document the effect on
window text width when setting the width of one or both fringes to
zero.
* doc/emacs/display.texi (Fringes): Document the effect on window
text width when setting the width of one or both fringes to zero.
(Bug#22891)
Philipp Stephani [Sat, 16 Apr 2016 09:55:17 +0000 (12:55 +0300)]
Simplify 8-bit character handling by terminal for 'raw-text'
* lisp/international/mule.el (set-keyboard-coding-system): Treat
'raw-text' as another coding type that requires 8-bit characters.
* lisp/xt-mouse.el (xterm-mouse--read-coordinate): Use 'no-conversion'
instead of 'latin-1'.
Eli Zaretskii [Fri, 15 Apr 2016 14:26:37 +0000 (17:26 +0300)]
Fix w32 memory-management problem when extending buffer text
* src/w32heap.c (mmap_realloc): Only attempt extending a region if
the following region has the same allocation base. Also, use the
original allocation base and enlarged size to commit reserved
memory, to ensure that the allocation base stays at its original
value. This fixes several hard-to-debug problems whereby part of
buffer text was overwritten with binary nulls, because
mmap_realloc copied only part of buffer text when extending it.
See
http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00325.html
and http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23223#55 for two
examples of the related problems.
Paul Eggert [Thu, 14 Apr 2016 15:21:34 +0000 (08:21 -0700)]
substitute-command-keys keeps quotes’ text props
Problem reported by Clément Pit--Claudel (Bug#23254).
* src/doc.c: Include intervals.h.
(Fsubstitute_command_keys): If the only substitutions are for
quotes, copy the source string’s text properties too, since no
substring lengths have changed.
Perform xref searches without visiting unopened files
* lisp/progmodes/xref.el (xref-collect-references): Instead of
calling `semantic-symref-find-references-by-name', use
`semantic-symref-instantiate' and `semantic-symref-perform-search'
directly. Ask for `line-and-text' results (bug#23223).
(xref-collect-matches): Include the line text in the "hit"
structure.
(xref--convert-hits): New function, split off from
`xref-collect-references' and `xref-collect-matches', to convert
"hits" to xref instance list. Create a temporary buffer here, to
use it for post-processing all hit lines.
(xref--collect-matches): Use a different approach for non-visited
files. Insert the line text into the temp buffer, apply the
file's major mode the best we can without reading its whole
contents, syntax-propertize, and search in the result.
(xref--collect-matches-1): Extract, to handle the common logic
between two cases.
(xref--find-buffer-visiting): New function, a wrapper around
`find-buffer-visiting' to amortize its cost.
* lisp/cedet/semantic/symref/idutils.el
(semantic-symref-idutils--line-re): New constant.
(semantic-symref-parse-tool-output-one-line): Support result type
`line-and-text'.
Paul Eggert [Tue, 12 Apr 2016 15:47:15 +0000 (08:47 -0700)]
Improve time zone documentation
* doc/lispref/os.texi (Time Zone Rules):
New section, mostly with material moved here from other sections.
* doc/emacs/cmdargs.texi (General Variables):
* doc/lispref/os.texi (Time Conversion, Time Parsing):
Xref new section.
* etc/NEWS, etc/PROBLEMS:
* lisp/org/org.el (org-timestamp-format):
* src/editfns.c (Fformat_time_string, Fdecode_time)
(Fencode_time, Fcurrent_time_string, Fcurrent_time_zone)
(Fset_time_zone_rule):
When documenting time zone rule strings, mention the TZ
environment variable in preference to mentioning the
sort-of-internal function set-time-zone-rule.
Paul Eggert [Mon, 11 Apr 2016 16:02:00 +0000 (09:02 -0700)]
Sync with gnulib
This is for picky compilers whose stdint.h fails our C11 tests.
Problem reported for clang by Philipp Stephani (Bug#23261).
This incorporates:
2016-04-11 stdint: port to strict C11 left shift
* doc/misc/texinfo.tex, lib/stdint.in.h: Copy from gnulib.
Leo Liu [Mon, 11 Apr 2016 12:19:38 +0000 (20:19 +0800)]
Fix last change on 2016-01-02
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Move
`cl-errs-re' before `lisp--el-match-keyword'; don't use `prepend'
which highlights `cl-errs-re' even in comments or strings.
Paul Eggert [Mon, 11 Apr 2016 05:47:03 +0000 (22:47 -0700)]
Port run-prolog EMACS to SWI-Prolog 7.2.3
* lisp/progmodes/prolog.el (prolog-ensure-process):
Work around incompatibility of SWI-Prolog 7.2.3 and earlier
with the new way of dealing with the EMACS and INSIDE_EMACS
environment variables.
Eli Zaretskii [Sun, 10 Apr 2016 16:50:39 +0000 (19:50 +0300)]
Avoid crashes due to unreasonably large or small text scaling
* lisp/face-remap.el (text-scale-min-amount)
(text-scale-max-amount): New functions.
(text-scale-set, text-scale-increase): Use them to limit the text
scaling to a reasonable range of values. (Bug#23259)
Eli Zaretskii [Sun, 10 Apr 2016 16:04:33 +0000 (19:04 +0300)]
Improve handling of non-ASCII characters in Git log messages
* lisp/vc/vc-git.el (vc-git-commits-coding-system): Now a defcustom.
(vc-git-log-output-coding-system): New defcustom.
(vc-git-print-log, vc-git-command, vc-git--call): Use
'vc-git-log-output-coding-system' for reading stuff from Git.
Don't override values of 'coding-system-for-read/write' if they
are bound by caller -- this allows the user to force an encoding
via "C-x RET c".
(vc-git-checkin): On MS-Windows, pass the log message via a
temporary file, to work around the limitations on passing
non-ASCII characters via command-line arguments. Force using the
'locale-coding-system' for Git command-line arguments. This fixes
problems with non-ASCII commit log messages on MS-Windows.
(Bug#23076)
* etc/NEWS: Mention the new vc-git related defcustoms.
* src/xwidget.c (x_draw_xwidget_glyph_string): Use window_box
instead of calculating the clipping borders manually. Suggested
by YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>.
Eli Zaretskii [Sat, 9 Apr 2016 09:30:59 +0000 (12:30 +0300)]
Improve Lisp-level documentation of tooltips
* doc/lispref/display.texi (Tooltips): New section. (Bug#23246)
(Display): Update the chapter menu.
* doc/lispref/text.texi (Special Properties): Make the "tooltip"
index entry more concrete. Change the cross-reference to point to
"Tooltips" in the ELisp manual.
* doc/lispref/elisp.texi (Top): Update the master menu.
* doc/emacs/frames.texi (Tooltips): Include more customization
variables. Add a cross-reference to the ELisp manual.
Paul Eggert [Fri, 8 Apr 2016 20:39:17 +0000 (13:39 -0700)]
Comint and compile no longer set EMACS
This mostly restores the change that I reverted on March 23,
fixing most of Bug#20202. The only part of the change that is
still reverted is the change to M-x term, where compatibility with
current Bash constrains us from moving too quickly (Bug#20484).
Problem reported by Phillip Lord in: http://bugs.gnu.org/20484#108
* etc/NEWS: Document this.
* lisp/comint.el (comint-exec-1):
* lisp/net/tramp-sh.el (tramp-remote-process-environment):
* lisp/progmodes/compile.el (compilation-start):
Don’t set EMACS=t in the subsidiary process.
Eli Zaretskii [Fri, 8 Apr 2016 13:54:18 +0000 (16:54 +0300)]
Allow to customize names of executables used by grep.el
* lisp/progmodes/grep.el (grep-find-program): Renamed from
'find-program', which was a variable. All uses changed.
(grep-xargs-program): Renamed from 'xargs-program', which was a
variable. All uses changed.
(grep-program): Now a defcustom rather than a simple variable.
(Bug#23219)
* lisp/play/studly.el (studlify-region): Call
'forward-word-strictly' and 'backward-word-strictly' instead of
'forward-word' and 'backward-word'. (Bug#19940)
Paul Eggert [Thu, 7 Apr 2016 23:52:01 +0000 (16:52 -0700)]
Don’t recommend obsolete EMACS env var
* doc/misc/efaq.texi (Escape sequences in shell output):
Remove long-obsolete (and now-confusing) notes about
the EMACS environment variable in Emacs 21.1 and earlier.
* doc/misc/efaq.texi (^M in the shell buffer):
* etc/PROBLEMS:
Remove obsolescent recommendation to consult the EMACS environment
variable.
* lisp/progmodes/project.el (project-roots): Implement for the
`transient' project type (bug#23224).
(project-current): Instead of signaling an error, return a
transient project instance rooted in the chosen directory.
Paul Eggert [Wed, 6 Apr 2016 08:22:00 +0000 (01:22 -0700)]
Fix stability confusion in sort-tests
Problem reported by Philipp Stephani (Bug#23205).
* test/automated/sort-tests.el:
(sort-tests--insert-words-sort-and-compare):
Don’t assume that reversing a sorted list is the same
as sorting with the reverse predicate. This is not true
for stable sorts when items compare equal.
Paul Eggert [Tue, 5 Apr 2016 20:58:57 +0000 (13:58 -0700)]
Avoid describe-key error with lambdas
Problem reported by Sho Takemori (Bug#22716).
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(xref-mode-local-overload): Use function-overload-p instead
of assuming the argument is a symbol.
Paul Eggert [Mon, 4 Apr 2016 06:12:04 +0000 (23:12 -0700)]
Sync with gnulib
This incorporates:
2016-04-03 stdint: detect good enough pre-C++11 stdint.h in C++ mode
2016-04-01 stddef: support configuring with g++
* doc/misc/texinfo.tex, lib/stddef.in.h, m4/stdint.m4:
Copy from gnulib.
Paul Eggert [Sun, 3 Apr 2016 22:27:21 +0000 (15:27 -0700)]
Fix doc for Universal Time
* doc/lispref/os.texi (Time of Day, Time Conversion):
Be more careful about distinguishing UTC (which is not valid for
pre-1961 time stamps) and UT (which is).
(Time Parsing): Remove stray obsolete paragraph about a
UNIVERSAL argument for ‘format-time-string’.
Paul Eggert [Sun, 3 Apr 2016 06:43:44 +0000 (23:43 -0700)]
More format-time-string change fixups
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times):
* lisp/org/org.el (org-timestamp-format):
Fix doc to match new format-time-string behavior.
* lisp/org/ox-icalendar.el (org-icalendar-convert-timestamp):
Use (not (not X)) to treat non-nil values of utc arg as UTC.