aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2005-12-16 20:07:49 +0000
committerStefan Monnier <[email protected]>2005-12-16 20:07:49 +0000
commitf3725983e7c2abb2ad12e9509a34adbc0e2cfe0a (patch)
tree34f64380c5c06e22b5d78435dfa325c9f0537295 /lisp/progmodes/cc-engine.el
parent2a502a327197584831199210036cd01951255a5f (diff)
(c-after-change-check-<>-operators):
After-change-functions should not clobber the match data.
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el45
1 files changed, 23 insertions, 22 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index c9f2b87b7f..7f829bd26d 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -3993,35 +3993,36 @@ comment at the start of cc-engine.el for more info."
;;
;; This function might do hidden buffer changes.
- (save-excursion
- (goto-char beg)
- (when (or (looking-at "[<>]")
- (< (skip-chars-backward "<>") 0))
-
+ (save-match-data
+ (save-excursion
(goto-char beg)
- (c-beginning-of-current-token)
- (when (and (< (point) beg)
- (looking-at c-<>-multichar-token-regexp)
- (< beg (setq beg (match-end 0))))
- (while (progn (skip-chars-forward "^<>" beg)
- (< (point) beg))
- (c-clear-char-property (point) 'syntax-table)
- (forward-char))))
-
- (when (< beg end)
- (goto-char end)
(when (or (looking-at "[<>]")
(< (skip-chars-backward "<>") 0))
- (goto-char end)
+ (goto-char beg)
(c-beginning-of-current-token)
- (when (and (< (point) end)
+ (when (and (< (point) beg)
(looking-at c-<>-multichar-token-regexp)
- (< end (setq end (match-end 0))))
- (while (progn (skip-chars-forward "^<>" end)
- (< (point) end))
+ (< beg (setq beg (match-end 0))))
+ (while (progn (skip-chars-forward "^<>" beg)
+ (< (point) beg))
(c-clear-char-property (point) 'syntax-table)
- (forward-char)))))))
+ (forward-char))))
+
+ (when (< beg end)
+ (goto-char end)
+ (when (or (looking-at "[<>]")
+ (< (skip-chars-backward "<>") 0))
+
+ (goto-char end)
+ (c-beginning-of-current-token)
+ (when (and (< (point) end)
+ (looking-at c-<>-multichar-token-regexp)
+ (< end (setq end (match-end 0))))
+ (while (progn (skip-chars-forward "^<>" end)
+ (< (point) end))
+ (c-clear-char-property (point) 'syntax-table)
+ (forward-char))))))))
;; Dynamically bound variable that instructs `c-forward-type' to also
;; treat possible types (i.e. those that it normally returns 'maybe or