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/emacs-lisp/ring.el (ring-elements): Don't use the RESULT
argument of `dotimes' when the iteration variable isn't referred by
it.
(ring-member): Don't pass nil as the RESULT argument of `dotimes'
since it's the default.
Split regex character class test into smaller chunks
Having one test for all character classes it is not always trivial to
determine which class is failing. This happens when failure is caused
by ‘(should (equal (point) (point-max)))’ not being met.
With per-character class tests, it is immidiatelly obvious which test
causes issues plus tests for all classes are run even if some of them
fail.
Don’t allocate char-table’s extra slots in regexp-out-charset
* lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Do not use
'case-table as charmap char-table’s property. The function has nothing
to do with casing and in addition using 'case-table causes unnecessary
extra slots to be allocated which ‘regexp-opt-charset’ does not use.
RE_CHAR_TO_MULTIBYTE(c) yields c for ASCII characters and a byte8
character for c ≥ 0x80. Furthermore, CHAR_BYTE8_P(c) is true only
for byte8 characters. This means that
c = RE_CHAR_TO_MULTIBYTE (ch);
if (! CHAR_BYTE8_P (c) && re_iswctype (c, cc))
is equivalent to:
c = c;
if (! false && re_iswctype (c, cc))
for 0 ⪬ c < 0x80, and
c = BYTE8_TO_CHAR (c);
if (! true && re_iswctype (c, cc))
for 0x80 ⪬ c < 0x100. In other words, the loop never executes for
c ≥ 0x80 and RE_CHAR_TO_MULTIBYTE call is unnecessary for c < 0x80.
* src/regex.c (regex_compile): Simplyfy a for loop by eliminating
dead iterations and unnecessary macro calls.
decimalnump was used in regex.c only in ISALNUM macro which ored it with
alphabeticp. Because both of those functions require Unicode general
category lookup, this resulted in unnecessary lookups (if alphabeticp
return false decimalp had to perform another lookup). Drop decimalnump
in favour of alphanumericp which combines decimelnump with alphabeticp.
* src/character.c (decimalnump): Remove in favour of…
(alphanumericp): …new function.
STRING_CHAR does not unify characters; update documentation
* src/character.h (STRING_CHAR): Update doc.
* src/buffer.h (FETCH_MULTIBYTE_CHAR): Update doc. While at it, change
the function to use BYTE_POS_ADDR instead of open-coding it.
Paul Eggert [Thu, 8 Sep 2016 01:08:45 +0000 (18:08 -0700)]
Port flexible array members to GCC + valgrind
These changes are needed to conform to the C standard's rule for
allocating structs containing flexible array members. C11 says
that malloc (offsetof (struct s, m) + n) does not suffice to
allocate a struct with an n-byte tail; instead, malloc’s arg
should be rounded up to the nearest multiple of alignof (struct s).
Although this is arguably a defect in C11, gcc -O2 + valgrind
sometimes complains when this rule is violated, and when debugging
it’s better to keep valgrind happy.
For details please see the thread containing the message at:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00416.html
* lib-src/ebrowse.c, src/alloc.c, src/image.c, src/process.c:
Include flexmember.h.
* lib-src/ebrowse.c (add_sym, add_member, make_namespace)
(register_namespace_alias):
* src/alloc.c (SDATA_SIZE, allocate_string_data):
* src/image.c (xpm_cache_color, imagemagick_create_cache):
* src/process.c (Fmake_network_process):
Use FLEXSIZEOF instead of offsetof and addition.
* src/alloc.c (SDATA_SIZE, vector_alignment):
Use FLEXALIGNOF instead of sizeof (ptrdiff_t).
* src/lisp.h (ALIGNOF_STRUCT_LISP_VECTOR):
Remove, as alloc.c can now calculate this on its own.
Paul Eggert [Thu, 8 Sep 2016 00:04:49 +0000 (17:04 -0700)]
Update from gnulib
This incorporates:
2016-09-07 flexmember: new macro FLEXALIGNOF
2016-09-07 flexmember: port better to GCC + valgrind
2016-08-18 Port modules to use getprogname explicitly
2016-09-02 manywarnings: add -fno-common
* admin/merge-gnulib (GNULIB_TOOL_FLAGS): Don’t avoid flexmember,
since time_rz now uses part of it. Instead, remove m4/flexmember.m4.
* configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Define away,
since Emacs assumes C99 and therefore removes m4/flexmember.m4.
* lib/euidaccess.c, lib/group-member.c, lib/time_rz.c:
* m4/manywarnings.m4: Copy from gnulib.
* lib/flexmember.h: New file, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
Noam Postavsky [Sun, 21 Aug 2016 14:51:38 +0000 (10:51 -0400)]
Don't --load directories
* lisp/startup.el (command-line-1): Only pass expanded FILENAME argument
of --load when it refers to a normal file, since `load' doesn't handle
directories (Bug #16406).
* 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 [Wed, 7 Sep 2016 00:27:24 +0000 (17:27 -0700)]
Use DEV_TTY more consistently
* src/conf_post.h (DEV_TTY): Move from here ...
* src/keyboard.c, src/keyboard.h: ... to here, as it doesn’t need
to be visible everywhere. Make it a constant.
* src/keyboard.c (handle_interrupt, Fset_quit_char):
* src/process.c (create_process): Prefer DEV_TTY to "/dev/tty".
Eli Zaretskii [Tue, 6 Sep 2016 16:46:06 +0000 (19:46 +0300)]
Avoid assertion violations when using marker positions
* src/intervals.c (set_point_from_marker): If MARKER comes from
another buffer, recalculate its byte position before using it to
set point.
* src/marker.c (set_marker_internal): If POSITION is a marker from
another buffer, recalculate its byte position before using it.
(Bug#24368)
Alan Mackenzie [Tue, 6 Sep 2016 11:47:16 +0000 (11:47 +0000)]
New options for handling of literals in c-syntactic-re-search-forward
* lisp/progmodes/cc-engine.el (c-syntactic-re-search-forward): `noerror' can
be given the values `before-literal' and `after-literal', so that when a
search fails, and the `bound' is inside a literal, point is left respectively
before or after that literal.
Eli Zaretskii [Mon, 5 Sep 2016 16:57:22 +0000 (19:57 +0300)]
Avoid assertion violations when scrolling narrowed buffer
* src/window.c (window_scroll_pixel_based):
* src/xdisp.c (pos_visible_p): Don't allow simulated redisplay to
start outside the accessible portion of the buffer. This avoids
assertion violations when some Lisp narrows the buffer to less
than the current window, and then attempts to scroll the buffer.
Eli Zaretskii [Mon, 5 Sep 2016 16:50:59 +0000 (19:50 +0300)]
Treat SIGINT correctly in GUI sessions on MS-Windows
* src/w32proc.c (sys_signal): Don't reject SIGINT, as it is
supported by MS runtime.
* src/term.c (DEV_TTY): Move from here ...
* src/conf_post.h (DEV_TTY): ... to here. Separate definitions
for WINDOWSNT and for the rest.
* src/keyboard.c (handle_interrupt_signal): Use DEV_TTY instead of
a literal "/dev/tty".
image-dired: Report when a necessary executable is not found
See discussion on:
https://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00552.html
* lisp/image-dired.el (image-dired-cmd-rotate-original-program)
(image-dired-cmd-create-thumbnail-program)
(image-dired-cmd-create-temp-image-program)
(image-dired-cmd-rotate-thumbnail-program)
(image-dired-cmd-write-exif-data-program)
(image-dired-cmd-read-exif-data-program):
Use executable-find to set the defaut value of this option.
(image-dired-cmd-rotate-original-program): Idem.
Search for program 'convert' if 'jpegtran' is not available.
(image-dired-cmd-rotate-original-options):
Set the default value consistent with the executable in
image-dired-cmd-rotate-original-program.
(image-dired-create-thumb, image-dired-display-image)
(image-dired-rotate-thumbnail, image-dired-rotate-original)
(image-dired-set-exif-data, image-dired-get-exif-data):
Throw and error when the executable used in the function is missing.
(image-dired-next-line, image-dired-previous-line):
Use 'forward-line'.
image-type-from-file-name: Perform a case insensitive match
Fix Bug#24317
* lisp/image.el (image-type-from-file-name): Bind case-fold-search
to a non-nil value to force a case insensitive match.
* lisp/image-dired.el (image-dired-rotate-original):
Use image-type (Bug#24317).
(image-dired-get-exif-file-name): Idem.
Set 'no-exif-data-found' and 'data' in same setq call.
Use file-attribute-modification-time.
* lisp/image.el (image-increase-size, image-decrease-size):
Compute a floating point division.
Problem reported in:
https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00067.html
Robert Cochran [Sat, 20 Aug 2016 01:03:24 +0000 (18:03 -0700)]
Fix uses of (call-interactively) in lisp/emacs-lisp/checkdoc.el
Passing the prefix argument as the 3rd argument to 'call-interactively'
causes the prefix argument to be interpreted as events, which is not
only wrong, but also causes a type error, as 'current-prefix-arg' can
never be a vector as 'call-interactively' expects. 'call-interactively'
automatically passes its prefix argument to the called function, so just
do that, eliminating faulty behavior.
* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell):
(checkdoc-ispell-current-buffer):
(checkdoc-ispell-interactive):
(checkdoc-ispell-message-text):
(checkdoc-ispell-start):
(checkdoc-ispell-continue):
(checkdoc-ispell-comments):
(checkdoc-ispell-defun):
Do not pass 'current-prefix-arg' to 'call-interactively' as an event
vector; merely allow it to propagate forward to the interactive call.
Stefan Monnier [Fri, 2 Sep 2016 15:44:13 +0000 (11:44 -0400)]
Check actual contents before promting about changed file
* lisp/userlock.el (userlock--check-content-unchanged)
(userlock--ask-user-about-supersession-threat): New functions.
* src/filelock.c (lock_file): Use them to avoid spurious prompting.
* doc/lispref/buffers.texi (Modification Time): Update doc of
ask-user-about-supersession-threat.
Paul Eggert [Fri, 2 Sep 2016 04:15:35 +0000 (21:15 -0700)]
Don’t create fd >= FD_SETSIZE
This avoids a potential crash if too many subprocesses (Bug#24325).
* src/process.c [HAVE_SETRLIMIT]: Include <sys/resource.h>.
(init_process_emacs): If ulimit -n is greater than FD_SETSIZE,
set it to FD_SETSIZE.
Alan Mackenzie [Thu, 1 Sep 2016 18:06:22 +0000 (18:06 +0000)]
Fix c-declaration-limits to return correct limits in all cases.
This function is the guts of c-indent-defun and c-mark-function.
In particular, when c-defun-tactic is nil, return a correct value rather than
always nil, and when it's 'go-outward, go through an intricate algorithm to
determine the requisite narrowing before the "top-level" defuns go to work.
* lisp/progmodes/cc-cmds.el (c-narrow-to-most-enclosing-decl-block): Enhance
to take additional optional parameter LEVEL, saying how many enclosing levels
of decl-block to narrow to.
(c-declaration-limits): Introduce algorithm to determine narrowing. Use
c-where-wrt-to-brace-block to determine whether to go back to BOD to determine
lower bound.
Eli Zaretskii [Thu, 1 Sep 2016 14:12:12 +0000 (17:12 +0300)]
Avoid compiler warnings with MinGW64 GCC 6
* nt/inc/ms-w32.h (execve) [MINGW_W64]: Make the prototype match
the GCC 6 builtin, to avoid warnings. For more details, see
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00721.html.
Paul Eggert [Thu, 1 Sep 2016 06:05:48 +0000 (23:05 -0700)]
Fix over-substitution of quotes on error
Problem reported by Tino Calancha in:
http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00000.html
* src/print.c (print_error_message):
Substitute quotes in errmsg only when gotten from a property.
Eli Zaretskii [Wed, 31 Aug 2016 15:53:43 +0000 (18:53 +0300)]
Avoid recursive calls in etags
* lib-src/etags.c (stack_entry): New struct.
(push_node, pop_node, put_entry): New functions.
(free_tree, add_node, invalidate_nodes, put_entries): Re-implement
in a non-recursive way, to avoid stack overflow. (Bug#5847)
Paul Eggert [Wed, 31 Aug 2016 02:44:41 +0000 (19:44 -0700)]
Minor doc quoting fixes
* doc/misc/htmlfontify.texi (Interactive):
* lisp/htmlfontify.el (htmlfontify-buffer):
Spell out character names, for clarity. The old doc string
generated the *Help* text ‘^L ([FF]) or ¤ (244)’, where ‘[FF]’
stands for a form feed character; this was confusing.
* lisp/electric.el (electric-quote-mode):
* src/doc.c (syms_of_doc):
* src/editfns.c (Fformat_message):
Remove no-longer-necessary ‘\=’s in doc strings.
Paul Eggert [Tue, 30 Aug 2016 20:15:04 +0000 (13:15 -0700)]
Update from gnulib
This incorporates:
2016-08-30 intprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6
2016-08-29 xalloc-oversized.h: port change to GCC 6.2.0
2016-08-29 intprops.h: port recent changes to GCC 6.2.0
2016-08-29 intprops.h: use __typeof__ with GCC 7
2016-08-29 intprops.h, xalloc-oversized.h: work with gcc 7
2016-08-24 intprops: fix paren typo on old platforms
2016-08-24 intprops: port to OpenVMS
* lib/intprops.h, lib/xalloc-oversized.h: Copy from gnulib.
Tassilo Horn [Tue, 30 Aug 2016 18:30:46 +0000 (20:30 +0200)]
Fix rules for \phi and \varphi which were reversed
* lisp/leim/quail/latin-ltx.el: Special-case phi/varphi because those
are reversed in ucs-names. Also remove FIXME stating sigma/varsigma
were reversed which is not true (anymore?).
Tassilo Horn [Tue, 30 Aug 2016 17:51:33 +0000 (19:51 +0200)]
Fix prettification of \phi, \varphi, and \varsigma
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Fix
prettification of \phi, \varphi, and \varsigma.
Concretely, \phi's symbol was actually varphi, \varphi was missing, and
\varsigma was commented out with a FIXME that it was reversed with
\sigma which it was not.
Karl Fogel [Tue, 30 Aug 2016 16:14:37 +0000 (11:14 -0500)]
Use normal double quotes in TeX / LaTeX comments
* lisp/textmodes/tex-mode.el (tex-insert-quote): When in a comment,
default to inserting a normal double quote (") instead of TeX-style
open (``) or close ('') quote marks.
https://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00611.html
From: Karl Fogel <kfogel {_AT_} red-bean.com>
To: Emacs Development <emacs-devel {_AT_} gnu.org>
Subject: [PATCH] Have LaTeX mode use normal double quotes in comments.
Date: Mon, 29 Aug 2016 14:44:12 -0500
Message-ID: <87twe3icmr.fsf@red-bean.com>
Alan Mackenzie [Tue, 30 Aug 2016 15:36:15 +0000 (15:36 +0000)]
Correctly analyze C++ list initialization in member init areas.
* lisp/progmodes/cc-engine.el (c-back-over-list-of-member-inits): Remove a
superfluous call to c-backward-syntactic-ws.
(c-looking-at-or-maybe-in-bracelist): Change calling convention, so that it
reports encountering the Java "new" keyword. Add, as an alternative, a check
that we can move back over member initializations, and handle this as finding
a brace block.
(c-looking-at-special-brace-list, c-guess-continued-construct): Adapt to the
new calling convention of c-looking-at-or-maybe-in-bracelist.
(c-guess-basic-syntax, CASE 5A.3): Replace lots of inline ad-hoc code with
calls to c-backward-over-enum-header and c-looking-at-or-maybe-in-bracelist,
using the extra info from the value of that function to generate a
topmost-into-cont element where needed (in Java).
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Adapt to the new
calling convention of c-looking-at-or-maybe-in-bracelist.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): Adapt to the new calling
convention of c-looking-at-or-maybe-in-bracelist.
Eli Zaretskii [Mon, 29 Aug 2016 14:27:06 +0000 (17:27 +0300)]
Avoid crashes for invalid value of key modifiers
* src/keyboard.c (parse_solitary_modifier): If the argument SYMBOL
is not a symbol, don't try to recognize it. See
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00502.html
for the details.
* test/src/keymap-tests.el (keymap-where-is-internal-test): New
test, for testing the above fix.
Paul Eggert [Sun, 28 Aug 2016 09:13:18 +0000 (02:13 -0700)]
Memory allocator alignment fixes
These changes remove some assumptions about heap allocator
alignment that may not be true on unusual platforms.
* src/alloc.c (POWER_OF_2): New macro.
(ROUNDUP): Use it.
(BLOCK_ALIGN): Verify that it is a power of 2.
(aligned_alloc): Check that alignment passed to posix_memalign
satisfies POSIX restrictions.
(lisp_align_malloc): Check that size passed to aligned_alloc
satisfies C11 restrictions.
(MALLOC_IS_GC_ALIGNED): Check that GCALIGNMENT is 8, since the
code has not been verified to work with other GCALIGNMENT values
and the ice is thin here. On GNU/Linux, malloc can return a value
that is a multiple of 8 but not 16, even though __alignof__
(max_align_t) is 16. See:
https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01902.html
(lmalloc) [USE_ALIGNED_ALLOC]: Use aligned_alloc only if size
is a multiple of alignment, since C11 says the behavior is
undefined otherwise.
(lmalloc, lrealloc): Don't use INT_ADD_WRAPV on size_t, as in
general this macro is restricted to signed types. Remove
assertion that the result is a multiple of GCALIGNMENT, as that
need not be true.
Paul Eggert [Sun, 28 Aug 2016 08:56:51 +0000 (01:56 -0700)]
Pacify --enable-gcc-warnings for lib-src/pop.c
* lib-src/pop.c: Include c-ctype.h.
(socket_connection): Pacify --enable-gcc-warnings by rewriting to
avoid 'if (v = E) ...'. Use c_tolower, instead of a combination
of the (undeclared) isupper and tolower. Fix pointer constness
problem.
Alan Mackenzie [Sat, 27 Aug 2016 19:57:42 +0000 (19:57 +0000)]
Handle the C++ "identifiers" "final" and "override" correctly.
This fixes bug #24319, allowing destructors affixed with these identifiers to
be correctly fontified.
* lisp/progmodes/cc-engine.el (c-forward-type, c-forward-decl-or-cast-1):
After reaching the "end" of a type expression, skip over any occurrences of
c-type-decl-suffix-ws-ids-key.
* lisp/progmodes/cc-langs.el (c-type-modifier-kwds): Remove "override" and
"final" from the C++ value.
(c-type-decl-suffix-ws-ids-kwds, c-type-decl-suffix-ws-ids-key): New lang
constants/variables for "final" and "override".
Alan Mackenzie [Thu, 25 Aug 2016 16:21:55 +0000 (16:21 +0000)]
Fix an infinite loop in C++ Mode when we have "{ .... [ .... }"
* lisp/progmodes/cc-fonts.el (c-font-lock-c++-lambda-captures): In the inner
`while' form's condition, check for "\\s)" rather than merely "\\]", so that
the loop won't hang at a "terminating" paren of a different type (due to the
c-syntactic-re-search-forward at the end of the loop stopping at such
characters).
Tino Calancha [Thu, 25 Aug 2016 13:17:56 +0000 (22:17 +0900)]
call-shell-region: New defun
Suggested by Stefan Monnier in Bug#22679.
* lisp/subr.el (call-shell-region): New defun; execute a command
in an inferior shell with the buffer region as input.
* lisp/simple.el (shell-command-on-region): Use it.
* lisp/gnus/message.el (message-do-fcc): Idem.
* doc/lispref/processes.texi: Document call-shell-region in the manual.
;* etc/NEWS: Add entry for this new function.
Martin Rudalics [Thu, 25 Aug 2016 08:53:27 +0000 (10:53 +0200)]
Some fixes around `delete-other-frames' and `next-frame'
* src/frame.c (Fdelete_frame): Clarify doc-string.
* lisp/frame.el (delete-other-frames): Delete other frames on
FRAME's terminal instead of the current terminal. Delete
non-minibuffer-only surrogate frames too. See
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00467.html
* doc/lispref/frames.texi (Deleting Frames): Minor fixes for
docs of `delete-frame' and `frame-live-p'. Add entry for
`delete-other-frames'.
(Finding All Frames): Fix doc of `next-frame'.
Alan Third [Thu, 18 Aug 2016 18:55:52 +0000 (19:55 +0100)]
Fix macOS 12 deprecation notices
* src/nsterm.h: Add #defines to allow older versions of macOS to use the
new constant names.
* src/nsmenu.m: Replace old constant names with
new.
(fillWithWidgetValue): Remove calls to deprecated
setMenuChangedMessagesEnabled.
* src/nsterm.m: Replace old constant names with new.
* src/nsfns.m: Replace old constant names with new.
Noah Friedman [Wed, 24 Aug 2016 00:13:31 +0000 (17:13 -0700)]
* src/xfns.c (Fx_change_window_property): Modify previous change.
Instead of forcing format to 8 for strings, check that the length of
the string is appropriate for whatever format given.
(Fx_window_property_attributes): If prop isn't found on frame's inner window,
try its outer window. This mimics the behavior of Fx_window_property.
Paul Eggert [Mon, 22 Aug 2016 21:38:49 +0000 (14:38 -0700)]
Merge from origin/emacs-25
8c2946e In NEWS describe new handling of window margins (Bug#24193) 0cee66c Facultatively ignore margins when splitting and resizing wind... 8d68147 Document CATEGORY arg to modify-category-entry 8342e74 Document char-script-table's effect on word motion e9ff485 Further fix for 'url-http-create-request' and multibyte strings 0695235 Fix docstring of eval-expression 98b01dd Clarify when 'cursor' property is in effect 75f1882 Convert the remaining strings to unibyte before concatenating d2db5dd Fix bug with handling the bidi cache ccd0e92 * doc/lispref/text.texi (Change Hooks): Minor copyedits. f785ff4 Clarify documentation of before/after-change-functions 3c9cb57 Document use of vectors in keymaps
Eli Zaretskii [Mon, 22 Aug 2016 17:19:35 +0000 (20:19 +0300)]
Display mini-window resized even when there are several frames
* src/xdisp.c (x_consider_frame_title): Bind inhibit-redisplay to
t to avoid resizing back the mini-window as result of considering
the title of other frames. (Bug#24285)
(redisplay_window): No need to bind inhibit-redisplay here.
Noah Friedman [Sun, 21 Aug 2016 21:03:46 +0000 (14:03 -0700)]
Fix interpretation of signed vs unsigned values when retrieving X
Window properties, and make sure the full value is returned when not
parsed.
New subr to export type and format information about X Window
properties to lisp.
* src/xselect.c (selection_data_to_lisp_data): Treat any data as
unsigned unless its actual type is INTEGER.
CARDINALs, in particular, are unsigned.
* src/xfns.c (Fx_change_window_property): If value is a string, ignore
any provided format and force to 8.
(x_window_property_intern): If returning value as a string, the length
is actual_size times the actual format of each element, which is not
necessarily bytes.
(Fx_window_property_attributes): New subr.
(syms_of_xfns): Declare it.
Alan Mackenzie [Sun, 21 Aug 2016 16:00:15 +0000 (16:00 +0000)]
Adapt CC Mode for C++11 uniform initialization.
For fontification, introduce a new "context", 'non-decl, to be used for
brace
lists; also a new value for the property 'c-type, called 'c-not-decl.
* lisp/progmodes/cc-engine.el (c-back-over-compound-identifier): Check that
an ostensible symbol we're going to move over isn't a keyword.
(c-forward-decl-or-cast-1): CASE 1: Where we have two consecutive identifiers
(hence a declaration), and an unmatched open paren, perform
c-fdoc-shift-type-backwards to recognize the partial construct correctly.
Whilst checking a type decl expression, check for and handle C++11's "copy
initialization", where we have <type>(<constant>). Recognize
<id><id>(... (where the paren is unclosed) as a declaration.
(c-looking-at-or-maybe-in-bracelist): New function, extracted from
c-inside-bracelist-p. Recognize as bracelists "{"s which are preceded by
valid tokens other than "=". Recognize a bracelist when preceded by a
template declaration.
(c-inside-bracelist-p): Call c-looking-at-or-maybe-in-bracelist in place of
much inline code.
(c-looking-at-inexpr-block): Amend so that it won't wrongly recognise an
initialization starting "({" as an in-expression block, by checking for
semicolons, as opposed to commas, separating elements inside it.
(c-guess-continued-construct): (CASE B-2): Recognize a brace-list-open by
calling c-looking-at-or-maybe-in-bracelist rather than checking for a
preceding "=". (CASE B-5): New code to recognize new construct "return {
...}".
(c-guess-basic-syntax): (CASE 5A.3): Additionally recognize a "{" preceded by
"return", or "{" preceded by <type><identifier> as a bracelist.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Recognize brace
lists, giving them `context' 'non-decl. Pass over elements of one by regexp
search for "," rather than calling c-forward-decl-or-cast-1.
* lisp/progmodes/cc-langs.el (c-return-kwds, c-return-key): New lang
constants/variables to recognize "return".
(c-pre-id-bracelist-key): New lang constant/variable to recognize tokens
which, when preceding an identifier followed by a brace, signify the brace as
a bracelist.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): When searching outwards for
the start of a "local" declaration, move out from an enclosing brace when
that is the start of a brace list.
Paul Eggert [Sun, 21 Aug 2016 11:25:24 +0000 (04:25 -0700)]
Update from gnulib
This incorporates:
2016-08-17 maint: preprocessor changes to support z/OS
2016-08-17 string: rename to avoid '__string'
* doc/misc/texinfo.tex, lib/alloca.in.h, lib/string.in.h:
Copy from gnulib.
Paul Eggert [Sun, 21 Aug 2016 11:02:06 +0000 (04:02 -0700)]
Minor text-quoting-style fixes
* src/charset.c (check_iso_charset_parameter):
* src/frame.c (store_frame_param):
* src/xselect.c (x_fill_property_data):
Use grave accent for left single quote in ‘error’ format strings.
Martin Rudalics [Sun, 21 Aug 2016 09:36:11 +0000 (11:36 +0200)]
Fix semantics of 'minibuffer' frame parameter
The 'minibuffer' frame parameter is now t for a normal frame
(a frame with a root window plus a minibuffer window) and the
frame's minibuffer window for a minibuffer-less frame (a frame
whose minibuffer window is on another frame). See also:
https://lists.gnu.org/archive/html/emacs-devel/2016-07/msg01259.html
* src/frame.c (make_frame, make_frame_without_minibuffer)
(make_minibuffer_frame): When assigning the frame's minibuffer
window also store corresponding 'minibuffer' frame parameter.
(store_frame_param): Move the 'minibuffer' parameter checks to
the beginning so we can silently override the value before it
gets stored in the parameter alist. Fix error handling.
(Fframe_parameters): Return value of 'minibuffer' parameter
unmodified.
* lisp/frameset.el (frameset-filter-minibuffer): When the cdr of
the parameter is a minibuffer window, save (minibuffer . nil)
instead of (minibuffer . t).
(frameset--reuse-frame): To find a non-minibuffer-only frame
look out for a frame whose 'minibuffer' parameter is t instead
of that frame's minibuffer window.
(frameset-minibufferless-first-p): To find a minibuffer-less
frame look out for a frame whose 'minibuffer' parameter is a
window instead of nil.
Philipp Stephani [Fri, 19 Aug 2016 19:23:24 +0000 (21:23 +0200)]
Some assorted documentation clarifications
* src/fileio.c (Fwrite_region): Clarify that END is ignored if
START is nil.
* src/editfns.c (Fbuffer_size): Add short discussion about
narrowing.
* src/callproc.c (Fcall_process_region): Discuss behavior when
START and END are not buffer positions.