summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-mode.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2016-01-11 22:50:30 -0800
committerJohn Wiegley <johnw@newartisans.com>2016-01-11 22:50:30 -0800
commitfee9e3ff5e3181e5e477849b5db94e7e39a4e0c4 (patch)
treeb5a8934d6b587f3517d2b8214a6738374b07820d /lisp/progmodes/cc-mode.el
parent2d7f4d99f715a3b32bb2873be6e9b4e7e1dad1da (diff)
parentce4a052415b70030ee591af3cb5bed0fb79ef3aa (diff)
downloademacs-fee9e3ff5e3181e5e477849b5db94e7e39a4e0c4.tar.gz
emacs-fee9e3ff5e3181e5e477849b5db94e7e39a4e0c4.tar.bz2
emacs-fee9e3ff5e3181e5e477849b5db94e7e39a4e0c4.zip
Merge from origin/emacs-25
ce4a052 Add defvar-local to lisp-imenu-generic-expression a0121bc Revert commit b1e3d14845517bfa9fa5d6d3840f3ab3160306fd 76fe2d5 * lisp/emacs-lisp/autoload.el (autoload-find-destination): Doc fix. 1ae088f * lisp/emacs-lisp/autoload.el (autoload-find-destination): b6b47af Properly encode/decode base64Binary data in SOAP c632466 Obey coding-system-for-write when writing stdout/stderr in batch 2f32cb5 * doc/misc/efaq.texi (Packages that do not come with Emacs): Update the URI of MELPA and marmalade-repo. Reported by CHENG Goa <chenggao@royau.me> in https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00390.html. d2937aa * lisp/progmodes/opascal.el (opascal-mode-syntax-table): 5330c25 * lisp/progmodes/xscheme.el (xscheme-prompt-for-expression-exit): 7380990 Remove function wrongly on AWK Mode value of context fontification hook. d400753 * src/buffer.c: Stick with ASCII in doc string. 221240c Reword transient-mark-mode doc string 977d3ea Update doc string of 'selective-display' 229c3fa Make C++ buffers writeable when writing their initial text properties. f5c762c Additional changes for "make check-expensive" 1729cf3 ; * admin/MAINTAINERS: Remove myself. 33219d3 Apply text properties for <, > in new after-change function (C++ Java Modes).
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r--lisp/progmodes/cc-mode.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 7f71700c650..644065911dd 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -631,8 +631,11 @@ that requires a literal mode spec at compile time."
(font-lock-mode 1)))
;; Buffer local variables defining the region to be fontified by a font lock
-;; after-change function. They are set in c-after-change to
-;; after-change-functions' BEG and END, and may be modified by functions in
+;; after-change function. They are initialized in c-before-change to
+;; before-change-functions' BEG and END. `c-new-END' is amended in
+;; c-after-change with after-change-functions' BEG, END, and OLD-LEN. These
+;; variables may be modified by any before/after-change function, in
+;; particular by functions in `c-get-state-before-change-functions' and
;; `c-before-font-lock-functions'.
(defvar c-new-BEG 0)
(make-variable-buffer-local 'c-new-BEG)
@@ -671,8 +674,9 @@ compatible with old code; callers should always specify it."
(funcall fn (point-min) (point-max)))
c-get-state-before-change-functions)
(mapc (lambda (fn)
- (funcall fn (point-min) (point-max)
- (- (point-max) (point-min))))
+ (if (not (eq fn 'c-restore-<>-properties))
+ (funcall fn (point-min) (point-max)
+ (- (point-max) (point-min)))))
c-before-font-lock-functions))))
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
@@ -1032,6 +1036,8 @@ Note that the style variables are always made local to the buffer."
c-just-done-before-change) ; guard against a spurious second
; invocation of before-change-functions.
(setq c-just-done-before-change t)
+ ;; (c-new-BEG c-new-END) will be the region to fontify.
+ (setq c-new-BEG beg c-new-END end)
(setq c-maybe-stale-found-type nil)
(save-restriction
(save-match-data
@@ -1126,7 +1132,8 @@ Note that the style variables are always made local to the buffer."
;; (c-new-BEG c-new-END) will be the region to fontify. It may become
;; larger than (beg end).
- (setq c-new-BEG beg c-new-END end)
+ ;; (setq c-new-BEG beg c-new-END end)
+ (setq c-new-END (- (+ c-new-END (- end beg)) old-len))
(unless (c-called-from-text-property-change-p)
(setq c-just-done-before-change nil)
@@ -1245,7 +1252,8 @@ Note that the style variables are always made local to the buffer."
(save-restriction
(widen)
(save-excursion
- (let ((new-beg beg) (new-end end) new-region)
+ (let ((new-beg beg) (new-end end)
+ (new-region (cons beg end)))
(mapc (lambda (fn)
(setq new-region (funcall fn new-beg new-end))
(setq new-beg (car new-region) new-end (cdr new-region)))