diff options
author | Alan Mackenzie <acm@muc.de> | 2017-03-30 20:24:39 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2017-03-30 20:24:39 +0000 |
commit | ef7df187eb0b631a6909bdc02f82b3dfef0ad689 (patch) | |
tree | e37b293633b0d65f3ea2f21125021ae99bf0dc92 /lisp/progmodes/cc-mode.el | |
parent | 6ff870218dd4bc015cc4115ceb2febd8d807e57c (diff) | |
download | emacs-ef7df187eb0b631a6909bdc02f82b3dfef0ad689.tar.gz |
Fix C++ fontification problems 500 bytes after typing a space, and other bugs
Also implement the "asymmetric space" rule for fontifying otherwise
ambiguous
declarations/expressions.
* lisp/progmodes/cc-engine.el (c-before-change-check-<>-operators): Don't set
c-new-BEG or c-new-END when there is no need.
(c-forward-decl-or-cast-1): Add "CASE 17.5" to implement the "asymmetric
space" rule.
* lisp/progmodes/cc-fonts.el (c-get-fontification-context): New function,
extracted from c-font-lock-declarations. Add to this function processing to
make `context' 'decl for lines contained within parens when these are also
declarations.
(c-font-lock-declarations): Call the newly extracted function above in place
of inline code.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): Set point before calling
c-literal-start.
* lisp/progmodes/cc-vars.el (c-asymmetry-fontification-flag): New user option.
* doc/misc/cc-mode.texi (Misc Font Locking): New node documenting the new
"asymmetric fontification" rule, including the variable
c-asymmetric-fontification-flag.
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r-- | lisp/progmodes/cc-mode.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 8326e6a6f29..20c63d4dbe2 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1363,6 +1363,7 @@ Note that the style variables are always made local to the buffer." ;; This function is called indirectly from font locking stuff - either from ;; c-after-change (to prepare for after-change font-locking) or from font ;; lock context (etc.) fontification. + (goto-char pos) (let ((lit-start (c-literal-start)) (new-pos pos) capture-opener |