Alan Mackenzie [Mon, 23 Nov 2015 14:49:23 +0000 (14:49 +0000)]
Expunge occurrences of `setq' with an odd number of arguments.
* lisp/apropos.el (apropos-documentation):
* lisp/obsolete/complete.el (PC-include-file-all-completions):
* lisp/progmodes/compile.el (compilation-goto-locus):
* lisp/vc/vc-cvs.el (vc-cvs-parse-root): (twice)
Insert missing nil at end of `setq' forms.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-autoload): Remove an
erroneous trailing variable name from a setq, thus allowing a compilation
properly to track functions not defined at runtime.
Alan Mackenzie [Mon, 23 Nov 2015 14:25:15 +0000 (14:25 +0000)]
Issue a warning from the byte compiler on a malformed `setq' form.
Partly fixes bug#20241.
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Issue a warning when a
`setq' form with an odd number of arguments is compiled.
Alan Mackenzie [Mon, 23 Nov 2015 14:10:36 +0000 (14:10 +0000)]
Don't let cconv_convert insert a nil argument into a `setq' form.
Fixes bug#21983.
* lisp/emacs-lisp/cconv.el (cconv-convert): Don't silently insert a nil last
argument into a `setq' when there're an odd number of args. This enables the
byte compiler to issue a message in this case.
Eli Zaretskii [Sun, 22 Nov 2015 18:38:51 +0000 (20:38 +0200)]
Allow loading modules by 'load-file'
* src/lread.c (Fload): Call 'unbind_to' with 'Fmodule_load' as the
2nd arg, to avoid the "binding stack not balanced" error.
(syms_of_lread) <module-file-suffix>: New Lisp variable.
* lisp/files.el (module-file-suffix): Declare.
(load-file): Remove 'module-file-suffix' from
'completion-ignored-extensions', to allow completion on modules.
This change finishes what my commit of Thu Nov 19 17:32:37 2015 -0600
(git commit c59353896) started. It turns out that having INTERACTIVE
cause `post-self-insert-hook' to run (via `newline') meant `open-line'
still had the electric indent behavior, as `post-self-insert-hook'
normally contains `electric-indent-post-self-insert-function' ever
since `electric-indent-mode' has been on by default. Tracing the code
change in `open-line' is mildly twisty, because Artur Malabarba's
earliest two commits of 24 Oct 2015 first removed the `interactive'
form entirely (git commit 6939896e2) and then restored it with the new
extra "p" already added (git commit bd4f04f86), such that there is no
single-commit diff in which one sees the second "p" appear. Thus this
change is effectively a reversion of parts of each of those commits.
This could close bug#21884, at least until further discussion.
Dmitry Gutov [Sun, 22 Nov 2015 04:33:22 +0000 (06:33 +0200)]
Adhere closer to the "implicit tag name" definition
* lisp/progmodes/etags.el (etags-tags-completion-table):
Adhere closer to the "implicit tag name" definition. Simplify
the regexp. Search for the explicit tag name first, and when
not found, search locally for the implicit one. (Bug#21934)
Stefan Monnier [Sun, 22 Nov 2015 03:05:28 +0000 (22:05 -0500)]
Unrevert most of regexp reentrancy abort patch
The problem was in:
* src/syntax.c (update_syntax_table_forward): Propertize even when truncated
which is hence not unreverted.
The rest is:
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
(UPDATE_SYNTAX_TABLE_FAST): Re-introduce.
All callers in regex.c changed back to the _FAST versions.
* test/automated/message-mode-tests.el: Tweak the test to rely on auto
propertization in backward-sexp.
Paul Eggert [Sat, 21 Nov 2015 22:13:56 +0000 (14:13 -0800)]
Revert regexp reentrancy abort patch
Although the patch does fix Bug#21688 and prevents a core dump,
it also makes the message-mode-propertize test fail; see:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01667.html
Perhaps someone else can come up with a better fix some day.
* src/syntax.c (update_syntax_table_forward):
Propertize even when truncated.
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
(UPDATE_SYNTAX_TABLE_FAST): Remove.
All callers changed back to the non-_FAST versions.
Paul Eggert [Sat, 21 Nov 2015 18:38:19 +0000 (10:38 -0800)]
Add a few safety checks when ENABLE_CHECKING
This was motivated by the recent addition of module code,
which added some ENABLE_CHECKING-enabled checks that are
useful elsewhere too.
* src/alloc.c (compact_font_cache_entry):
* src/fns.c (sweep_weak_table):
* src/lread.c (oblookup):
Use gc_asize rather than doing it by hand.
* src/emacs-module.c (module_make_global_ref)
(module_free_global_ref, module_vec_size):
Omit assertions that lisp.h now checks.
* src/lisp.h (XFASTINT, ASIZE): In functional implementations,
check that the result is nonnegative. Use eassume, as this
info can help a bit when optimizing production code.
(XSYMBOL) [!USE_LSB_TAG]: Assert that argument is a symbol,
to be consistent with the USE_LSB_TAG case.
(gc_asize): New function, when ASIZE is needed in the gc.
(gc_aset): Use it.
(HASH_TABLE_P): Move definition up, so that it can be used ...
(XHASH_TABLE): ... here, to assert that the arg is a hash table.
Eli Zaretskii [Sat, 21 Nov 2015 17:44:02 +0000 (19:44 +0200)]
Simplify recording of main thread's ID on MS-Windows
* src/w32term.c (w32_initialize):
* src/w32console.c (initialize_w32_display):
* src/w32fns.c (globals_of_w32fns): Don't record the main thread
ID independently for each type of session (GUI, TTY, batch).
* src/w32term.c (w32_init_main_thread): New function, records the
main thread's thread ID.
* src/w32term.h: Add prototype for w32_init_main_thread.
* src/emacs.c (main) [WINDOWSNT]: Call w32_init_main_thread.
* src/emacs-module.c [WINDOWSNT]: Rename main_thread_id to
main_thread, for consistency with other threading libraries. All
users changed. Include w32term.h.
(check_main_thread) [WINDOWSNT]: Simplify the test: no need to
make sure the main thread is alive, as we hold a handle on it
opened by w32_init_main_thread.
(module_init) [WINDOWSNT]: Reuse the thread ID recorded by
w32_init_main_thread, instead of calling the requisite APIs once
more.
Eli Zaretskii [Sat, 21 Nov 2015 11:30:30 +0000 (13:30 +0200)]
Call 'window-size-change-functions' for mini-windows
* src/window.c (grow_mini_window, shrink_mini_window): Set the
frame's 'window_sizes_changed' flag.
* src/xdisp.c (redisplay_internal): Call the hooks on
'window-size-change-functions' if the call to 'echo_area_display'
sets the frame's 'window_sizes_changed' flag.
(syms_of_xdisp) <window-size-change-functions>:
Update doc string to indicate the mini-window resizes trigger a
call to the hooks, and don't promise that will happen "before
redisplay". (Bug#19576, Bug#21333)
* doc/lispref/windows.texi (Window Hooks): Update the description
of 'window-size-change-functions'.
Eli Zaretskii [Sat, 21 Nov 2015 10:49:57 +0000 (12:49 +0200)]
Improve documentation of dynamic modules
* src/fns.c (Frequire): Doc fix to include the dynamic module
support.
* src/lread.c (Fload, Vload_suffixes): Doc fixes to include the
dynamic module support.
(Fload): Treat the module suffix the same as '*.el' and '*.elc'
wrt the MUST-SUFFIX argument.
* etc/NEWS: Expand documentation of dynamically loaded modules.
Paul Eggert [Fri, 20 Nov 2015 21:48:54 +0000 (13:48 -0800)]
Fix double-decrement bug when freeing global refs
* src/emacs-module.c (module_free_global_ref): Add a FIXME
comment about error reporting. Fix a recently-introduced typo
that double-decremented the refcount.
Paul Eggert [Fri, 20 Nov 2015 20:20:26 +0000 (12:20 -0800)]
Declare emacs_module_init in the module API
* src/emacs-module.h (emacs_module_init): New decl.
Without it, GCC might complain about a module that defines
emacs_module_init without using it. This also checks the
API better.
Paul Eggert [Fri, 20 Nov 2015 20:15:22 +0000 (12:15 -0800)]
Fix reindent-introduced typo in module code
* src/emacs-module.c (MODULE_SETJMP_1): Fix typo that I
introduced while reindenting the code earlier, and add a
comment explaining the unusual use of do-while here.
Anders Lindgren [Fri, 20 Nov 2015 20:07:29 +0000 (21:07 +0100)]
Fixed bug#19576: `write-file' saves wrong buffer.
If a function on the hook `window-size-change-functions' doesn't
restore the current buffer, functions that save and restore the
current window configuration (like `y-or-no-p') could silently
change the current buffer. When `write-file' asked the user
confirmation to overwrite a file, `y-or-no-p' changed the current
buffer, and the wrong buffer was saved to the file.
* lisp/follow.el (follow-windows-start-end): Call `select-frame'
using the `norecord' parameter.
(follow-window-size-change): Restore current buffer. Call
`select-frame' using the `norecord' parameter. Cleanup.
Paul Eggert [Fri, 20 Nov 2015 16:51:13 +0000 (08:51 -0800)]
Module function arg counts are ptrdiff_t, not int
* src/emacs-module.c (struct module_fun_env)
(module_make_function, module_funcall, Fmodule_call):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
Use ptrdiff_t, not int, for arg counts.
* src/emacs-module.c (module_make_function): Don’t bother
checking arity against MOST_POSITIVE_FIXNUM, as that’s
unnecessary here. Make the checking clearer by negating it.
(module_make_function, Fmodule_call): No need to use xzalloc
since the storage doesn’t need to be cleared.
(module_funcall): Don’t use VLA, since C11 doesn’t guarantee support
for it, and many implementations are buggy with large VLAs anyway.
Use SAFE_ALLOCA_LISP instead.
(module_vec_set): Don’t crash if i < 0.
(module_vec_get): Don’t crash if i < MOST_NEGATIVE_FIXNUM.
(module_vec_set, module_vec_get): Do fixnum checks only when
i is out of array bounds, for efficiency in the usual case.
(Fmodule_load): Simplify fixnum range check.
(Fmodule_call): Simplify arity check. Use xnmalloc to detect
integer overflow in array allocation size.
Eli Zaretskii [Fri, 20 Nov 2015 11:37:25 +0000 (13:37 +0200)]
Minor improvements in module test
* modules/mod-test/mod-test.c: Include stdlib.h, to avoid warnings
about missing prototype of malloc.
* modules/mod-test/Makefile (CFLAGS): Add -std=gnu99, to avoid
compiler warnings.
Eli Zaretskii [Fri, 20 Nov 2015 11:34:15 +0000 (13:34 +0200)]
Improve MS-Windows implementation in dynlib.c
* src/dynlib.c [WINDOWSNT]: Include errno.h, lisp.h, and w32.h.
No need to include windows.h, as w32.h already does that.
<dynlib_last_err>: New static variable.
(dynlib_reset_last_error): New function.
(dynlib_open): Convert forward slashes to backslashes. Convert
file names from UTF-8 to either UTF-16 or the current ANSI
codepage, and call either LoadLibraryW or LoadLibraryA. If the
argument is NULL, return a handle to the main module, like
'dlopen' does. Record the error, if any, for use by dynlib_error.
(dynlib_sym): Check the handle for validity. Record the error, if
any, for use by dynlib_error.
(dynlib_error): Call w32_strerror to produce the error string, and
zero out the last error code, like dlerror does.
(dynlib_close): Check the handle for validity. Record the error,
if any, for use by dynlib_error. Don't call FreeLibrary with a
handle for the main module.
* src/w32.c (globals_of_w32): Call dynlib_reset_last_error.
Paul Eggert [Fri, 20 Nov 2015 08:40:45 +0000 (00:40 -0800)]
Include-file tweaks for modules
* src/dynlib.c, src/emacs-module.c: Include <config.h> first.
* src/dynlib.h: Do not include config.h.
It’s every .c file’s responsibility to include config.h first.
* src/emacs-module.c: Include emacs-module.h immediately after
config.h, to test that emacs-module.h doesn’t depend on
include files other than config.h.
Paul Eggert [Fri, 20 Nov 2015 04:09:11 +0000 (20:09 -0800)]
Simplify push_handler and profile its malloc
* src/lisp.h (PUSH_HANDLER): Remove.
All callers changed to use push_handler directly.
* src/eval.c (internal_condition_case)
(internal_condition_case_1, internal_condition_case_2)
(internal_condition_case_n):
Use same pattern as for other invokers of push_handler.
(push_handler, push_handler_nosignal): Use call-by-value
instead of call-by-reference. All uses changed.
(push_handler): Simplify by rewriting in terms of
push_handler_nosignal.
(push_handler_nosignal): Profile any newly allocated memory.
Discover repository version in linked worktrees (bug#21930)
* lisp/version.el (emacs-repository--version-git-1): Do not assume
HEAD is at .git/HEAD, it can also be at .git/worktrees/<branch>/HEAD.
(emacs-repository-get-version): Grok linked worktrees when EXTERNAL
is nil too.
Juri Linkov [Fri, 20 Nov 2015 00:00:48 +0000 (02:00 +0200)]
* lisp/replace.el (occur-regexp-descr): New function.
(occur-1, occur-engine): Use it.
* lisp/isearch.el (isearch-occur): Propertize regexp with
isearch-string and isearch-regexp-function-descr for
occur-regexp-descr to display the correct description
message in the header (bug#21176, bug#21180).
This partly reverts Artur Malabarba's change that added electric
indent sensitivity to `open-line' (Oct 24 22:26:27 2015 +0100, git
commit bd4f04f86), and adjusts a new test he added right afterwards
(Sat Oct 24 23:43:06 2015 +0100, git commit 207f235e3) accordingly.
However, the new INTERACTIVE argument to `open-line', which he also
added in the first commit, is not reverted here.
See the thread "Questioning the new behavior of `open-line'." on the
Emacs Devel mailing list, and in particular this message:
From: Artur Malabarba
Subject: Re: Questioning the new behavior of `open-line'.
To: Karl Fogel Cc: David Kastrup, Pierpaolo Bernardi, emacs-devel
Date: Wed, 18 Nov 2015 21:03:58 +0000
Message-ID: \
<CAAdUY-KN06pvCMy5bt3+Buk3yeKjf6n9iB2FaSTTOPpCqPwyhA@mail.gmail.com>
Paul Eggert [Thu, 19 Nov 2015 23:01:26 +0000 (15:01 -0800)]
Prefer signed integer types in module code
Generally speaking, at the C level the Emacs source code prefers
signed types like ‘ptrdiff_t’ to unsigned types like ‘size_t’,
partly to avoid the usual signedness confusion when comparing values.
Change the module API to follow this convention.
Use ‘int’ for small values that can’t exceed INT_MAX.
* modules/mod-test/mod-test.c (Fmod_test_globref_make)
(Fmod_test_string_a_to_b, Fmod_test_vector_fill)
(Fmod_test_vector_eq):
* src/emacs-module.c (struct emacs_value_frame)
(module_make_global_ref, module_free_global_ref)
(module_copy_string_contents, module_make_string)
(module_vec_set, module_vec_get, module_vec_size):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
* src/lread.c (suffix_p):
Prefer signed to unsigned integer types.
Paul Eggert [Thu, 19 Nov 2015 22:24:50 +0000 (14:24 -0800)]
Omit ‘const’ on locals
Remove ‘const’ qualifier from locals that were newly added.
We don’t normally bother declaring locals with ‘const’ even
though they are not modified, for the same reason we don’t
bother declaring them with ‘register’ even though their
addresses are not taken; the advantage in compile-time
checking isn’t worth the loss of readability.
* modules/mod-test/mod-test.c (Fmod_test_non_local_exit_funcall)
(Fmod_test_vector_fill, Fmod_test_vector_eq):
* src/emacs-module.c (MODULE_SETJMP_1)
(module_make_global_ref, module_free_global_ref)
(module_non_local_exit_get, module_make_function)
(module_extract_integer, module_extract_float)
(module_get_user_ptr, module_set_user_ptr)
(module_get_user_finalizer, module_set_user_finalizer)
(module_vec_get, Fmodule_call)
(module_non_local_exit_signal_1)
(module_non_local_exit_throw_1, lisp_to_value)
(finalize_storage, allocate_emacs_value, mark_modules)
(module_handle_signal, module_handle_throw)
(module_format_fun_env):
* src/eval.c (push_handler, push_handler_nosignal)
(init_handler):
* src/lread.c (suffix_p):
Omit unnecessary ‘const’.
Paul Eggert [Thu, 19 Nov 2015 22:03:29 +0000 (14:03 -0800)]
Prefer intmax_t to int64_t in module code
* modules/mod-test/mod-test.c (sum, Fmod_test_sum):
* src/emacs-module.c (module_extract_integer)
(module_make_integer):
* src/emacs-module.h (struct emacs_env_25):
Prefer intmax_t to int64_t. This doesn’t change the generated
code on any of the machines Emacs currently ports to, but it’s
at least in theory more future-proof as C99 doesn’t guarantee
that int64_t exists.
Paul Eggert [Thu, 19 Nov 2015 19:49:27 +0000 (11:49 -0800)]
Fix minor module problems found by static checking
* src/dynlib.c (dynlib_close): #ifdef out for now, as it’s not used.
* src/eval.c, src/lisp.h (lisp_eval_depth): Now static.
* src/module.c (Fmodule_load): Fix pointer signedness bug.
(Fmodule_call): Tell GCC that the default case is unreachable.
Paul Eggert [Thu, 19 Nov 2015 19:31:45 +0000 (11:31 -0800)]
Style fixes for indenting etc. in module code
This is mostly indenting and spacing changes. Also, remove
some unnecessary static decls instead of bothering to reindent them.
* src/module.h (EMACS_EXTERN_C_BEGIN): Remove, and do this inline,
as most other Emacs files do for this sort of thing.
Eli Zaretskii [Wed, 18 Nov 2015 20:09:08 +0000 (22:09 +0200)]
Fix MS-Windows build --with-modules
* src/module.c: Reformat copyright commentary.
(module_vec_get): Use explicit cast to size_t to avoid compiler
warning in 32-bit builds.
(check_main_thread) [WINDOWSNT]: Fix letter-case in Windows APIs.
Compare thread IDs directly, as GetThreadId is not available
before Windows Vista.
(check_main_thread) [WINDOWSNT]: Duplicate the thread handle
without using APIs and constants not available on XP and older
systems. Obtain and store the thread ID as well.
Aurélien Aptel [Mon, 16 Nov 2015 00:00:25 +0000 (01:00 +0100)]
Add dynamic module test and helper script
Add 'modhelp.py' script (python2) to automate module testing and
module generation.
To build and test all modules in the modules/ dir
$ ./modhelp.py test
To generate a module from template code (good starting point)
$ ./modhelp init mynewtestmodule
See the script -h option for more documentation.
* modules/modhelp.py: New module helper script.
* modules/mod-test/Makefile: New file. Makefile for the test module.
* modules/mod-test/mod-test.c: New file. Test module source file.
* modules/mod-test/test.el: New file. ert test suite for the test module.
* modules/.gitignore: New file. Local .gitignore file.
Co-authored-by: Philipp Stephani <phst@google.com>
Aurélien Aptel [Sun, 15 Nov 2015 23:53:15 +0000 (00:53 +0100)]
Make 'Fload' look for modules
'Fload' can now load dynamic modules. This also makes 'require' work.
* src/lread.c:
(suffix_p): New function.
(Fload): Use 'suffix_p'. Call 'Fmodule_load' when we try to load a file
with a module suffix.
(syms_of_lread): Append module suffix to 'Vload_suffixes'.
Aurélien Aptel [Sun, 15 Nov 2015 23:47:04 +0000 (00:47 +0100)]
Add dynamic module module support
* configure.ac: Add '--with-modules' option. Conditionally add
dynlib.o and module.o to the list of objects. Add any system
specific flags to the linker flags to support dynamic libraries.
* m4/ax_gcc_var_attribute.m4: Add autoconf extension to test gcc
attributes.
* src/Makefile.in: Conditionally add module objects and linker flags.
* src/alloc.c (garbage_collect_1): protect module local values from
GC.
* src/lisp.h: Add 'module_init' and 'syms_of_module' prototypes.
* src/emacs_module.h: New header file included by modules. Public
module API.
* src/module.c: New module implementation file.
Co-authored-by: Philipp Stephani <phst@google.com>
Aurélien Aptel [Sun, 15 Nov 2015 23:42:14 +0000 (00:42 +0100)]
Add new User Pointer (User_Ptr) type
* src/lisp.h: Add new Lisp_Misc_User_Ptr type.
(XUSER_PTR): New User_Ptr accessor.
* src/alloc.c (make_user_ptr): New function.
(mark_object, sweep_misc): Handle Lisp_Misc_User_Ptr.
* src/data.c (Ftype_of): Return 'user-ptr' for user pointer.
(Fuser-ptrp): New user pointer type predicate function.
(syms_of_data): New 'user-ptrp', 'user-ptr' symbol. New 'user-ptrp'
subr.
* src/print.c (print_object): Add printer for User_Ptr type.
Paul Eggert [Wed, 18 Nov 2015 17:17:20 +0000 (09:17 -0800)]
Quote symbols in docstrings using `'
Be more systematic about quoting symbols `like-this' rather than
`like-this or 'like-this' in docstrings. This follows up Artur
Malabarba's email in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01647.html
Xue Fuqiao [Sat, 14 Nov 2015 04:49:17 +0000 (12:49 +0800)]
Backport: Mention CONTRIBUTE in README
Mention CONTRIBUTE in README, since it was moved from etc/ to root.
* etc/TODO: Remove the reference to `etc/CONTRIBUTE'.
* README: Mention CONTRIBUTE.
Paul Eggert [Tue, 17 Nov 2015 23:28:50 +0000 (15:28 -0800)]
Fix docstring quoting problems with ‘ '’
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes. The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.
Paul Eggert [Tue, 17 Nov 2015 07:08:54 +0000 (23:08 -0800)]
eval_sub followed dangling pointer when debugging
Problem reported by Pip Cet (Bug#21245).
This bug could occur in eval_sub if the C compiler reused
storage associated with the ‘argvals’ local after ‘argvals’
went out of scope, and if the Elisp debugger stopped on Elisp
function exit and accessed ‘argvals’. It could also occur if
a variadic function was called with so many arguments (over
2048 args on x86-64) that SAFE_ALLOCA_LISP called malloc, then
SAFE_FREE freed the arguments, then the memory manager used
the storage for other purposes, then the debugger accessed the
arguments.
* src/eval.c (eval_sub): Declare ‘argvals’ at top level of
function body. Simplify local decls.
When allocating args via SAFE_ALLOCA, call
debugger before invoking SAFE_FREE, as the debugger needs
access to the args.
(eval_sub, apply_lambda): Rework to avoid need for
set_backtrace_debug_on_exit hack. This is cleaner,
and should work better with buggy custom debuggers.
Paul Eggert [Tue, 17 Nov 2015 01:48:08 +0000 (17:48 -0800)]
ELF unexec: align section header
This ports the recent unexelf.c changes to Fedora x86-64
when configured with GCC’s -fsanitize=undefined option.
* src/unexelf.c (unexec): Align new_data2_size to a multiple
of ElfW (Shdr)’s alignment, so that NEW_SECTION_H returns a
pointer aligned appropriately for its type.
Paul Eggert [Mon, 16 Nov 2015 21:09:46 +0000 (13:09 -0800)]
Improve fix for regex reentrancy abort
Suggested by Stefan Monnier (Bug#21688).
* src/syntax.c (update_syntax_table_forward):
Remove recently-added PROPERTIZE arg, and assume it is true.
All callers changed.
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
Invoke update_syntax_table directly.
Alan Mackenzie [Sun, 15 Nov 2015 21:59:40 +0000 (21:59 +0000)]
De-pessimize detection of C++ member initialization lists.
list/progmodes/cc-engine.el (c-back-over-list-of-member-inits): New macro.
(c-back-over-member-initializers): Reformulate such that c-at-toplevel-p
is only called when a construct "looks right" rather than continually.
(c-guess-basic-syntax, CASE 5R): Add a check for the mode being C++ Mode.