Paul Eggert [Sun, 1 May 2016 16:00:08 +0000 (09:00 -0700)]
Use ‘T *restrict’ proto, not ‘T[restrict]’
* src/fns.c (sort_vector_copy): Use a different way to attempt to
work around GCC 3.0-and-earlier incompatibility with C99, one that
does not have problems with modern non-GCC compilers.
* src/process.c (remove_slash_colon): Move out of "#ifdef
subprocesses" block, as it its called unconditionally. Move
ADD_SUBFEATURE calls into "#ifdef subprocesses" block, as they
reference variables only defined in that block.
* src/msdos.h: Provide prototypes for IT_set_frame_parameters,
faccessat, msdos_fatal_signal, syms_of_msdos, pthread_sigmask,
dos_keysns, dos_keyread, run_msdos_command, and
syms_of_win16select, to avoid compiler warnings.
* src/msdos.c (SYS_ENVIRON): Define to either '_environ' or
'environ', depending on the DJGPP version.
Remove declarations of externally-visible Lisp objects, like
Qbackground_color and Qreverse.
(run_msdos_command): First argument is not signed, not unsigned.
Use SYS_ENVIRON.
(sys_select): Use 'timespec_cmp' instead of 'timespec_sign', as
the latter doesn't work when 'time_t' is an unsigned data type.
This caused idle timers to behave incorrectly: they only fired
after a keyboard input event.
* src/frame.c (adjust_frame_size) [MSDOS]: Account for
FRAME_TOP_MARGIN that isn't counted in the frame's number of
lines, but dos_set_window_size needs it to be added.
* src/lread.c (INFINITY, NAN) [DJGPP < 2.05]: Provide definitions.
* src/fns.c (sort_vector_copy) [__GNUC__ < 4]: Provide a prototype
that works around compilation errors with older GCC versions.
* src/w16select.c: Don't declare QCLIPBOARD and QPRIMARY as Lisp
Objects.
* src/filelock.c [MSDOS]: Ifdef away most of the code. Provide
no-op implementations for 'lock_file' and 'unlock_file'.
(Ffile_locked_p) [MSDOS]: Always return nil. This avoids multiple
ifdefs in all users of filelock.c functionality.
* src/conf_post.h (EOVERFLOW, SIZE_MAX) [DJGPP < 2.04]: Define.
* src/emacs.c [MSDOS]: Include dosfns.h, to avoid compiler
warnings.
* src/dosfns.h: Provide prototypes for dos_cleanup,
syms_of_dosfns, and init_dosfns.
* src/deps.mk (atimer.o): Depend on msdos.h.
(emacs.o): Depend on dosfns.h.
* src/atimer.c [MSDOS]: Include msdos.h, to avoid compiler
warnings.
* lisp/window.el (window--adjust-process-windows): Skip the body
if 'process-list' is not available. This avoids failure to start
up on MS-DOS.
* lisp/vc/diff.el (diff-no-select): Test 'make-process', not
'start-process', as the latter is now available on all platforms.
* lisp/textmodes/ispell.el (ispell-async-processp): Replace
'start-process' with 'make-process' in a comment.
* lisp/term/internal.el (IT-unicode-translations): Modify and add
a few translations to display Info files with Unicode markup. Fix
an ancient off-by-one mismatch error with Unicode codepoints.
* lisp/progmodes/compile.el (compilation-start): Test
'make-process', not 'start-process', as the latter is now
available on all platforms.
* lisp/man.el (Man-build-man-command, Man-getpage-in-background):
Test 'make-process', not 'start-process', as the latter is now
available on all platforms.
* lisp/international/mule-cmds.el (set-coding-system-map): Test
'make-process', not 'start-process', as the latter is now
available on all platforms.
* lisp/eshell/esh-cmd.el (eshell-do-pipelines-synchronously): Doc
fix.
(eshell-execute-pipeline): Test 'make-process', not
'start-process', as the latter is now available on all platforms.
Eli Zaretskii [Sat, 30 Apr 2016 09:56:03 +0000 (12:56 +0300)]
Fix variable-pitch font on MS-Windows
* lisp/faces.el (variable-pitch) [w32]: Name a variable-pitch font
explicitly, to avoid Emacs picking up a bold-italic variant on
some MS-Windows systems. See this thread for details:
http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00746.html.
Alan Mackenzie [Fri, 29 Apr 2016 14:58:21 +0000 (14:58 +0000)]
Restore follow-scroll-up/down to scrolling by the combined size of all windows
Also rename the current follow-scroll-up/down functions to
follow-scroll-up-window and follow-scroll-down-window. These scroll by the
height of the current window.
This fixes bug #23347.
* lisp/follow.el (follow-mode): Tweak the doc string.
(follow-scroll-up-arg, follow-scroll-down-arg): new functions, extracted from
follow-scroll-up/down.
(follow-scroll-up-window, follow-scroll-down-window): Functions renamed from
follow-scroll-up/down.
(follow-scroll-up, follow-scroll-down): Restore the historic functionality.
Alan Mackenzie [Fri, 29 Apr 2016 14:36:33 +0000 (14:36 +0000)]
Revert unneeded change which harms syntactic parsing. This fixes bug #23308.
* lisp/progmodes/cc-engine.el (c-invalidate-state-cache): User
c-state-old-cpp-end as an argument to c-with-all-but-one-cpps-commented-out
regardless of the value of `here'.
Alan Mackenzie [Fri, 29 Apr 2016 13:35:01 +0000 (13:35 +0000)]
Correct indentation of ids in a C++ enum after a protection keyword.
Also correct the misfontification of the last enum identifier.
* lisp/progmodes/cc-engine.el (c-forward-keyword-prefixed-id): setq
c-last-identifier-range to nil to ensure that only types recognized by this
macro are set for fontification as types.
(c-backward-typed-enum-colon): Function renamed from
c-backward-colon-prefixed-type. On finding a colon in the backward search,
check it is preceded by an identifier rather than a keyword.
* 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)