From 25b13765167746529e4ecbdcbb7bcfc8cc647cd3 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Thu, 13 Jun 2019 10:06:33 +0000 Subject: [PATCH] CC Mode: replace an erroneous re-search-forward with search-forward Move two declarations to a more suitable point in the cc-engine.el. * lisp/progmodes/cc-engine.el (c-after-change-unmark-raw-strings): Change an re-search-forward to search-forward. (c-semi-lit-near-cache, c-semi-near-cache-limit): Move the declarations. --- lisp/progmodes/cc-engine.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 1ded3f081d8..b121529086a 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2494,18 +2494,6 @@ comment at the start of cc-engine.el for more info." ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defvar c-semi-lit-near-cache nil) -(make-variable-buffer-local 'c-semi-lit-near-cache) -;; A list of up to six recent results from `c-semi-pp-to-literal'. Each -;; element is a cons of the buffer position and the `parse-partial-sexp' state -;; at that position. - -(defvar c-semi-near-cache-limit 1) -(make-variable-buffer-local 'c-semi-near-cache-limit) -;; An upper limit on valid entries in `c-semi-lit-near-cache'. This is -;; reduced by buffer changes, and increased by invocations of -;; `c-semi-pp-to-literal'. - (defvar c-lit-pos-cache nil) (make-variable-buffer-local 'c-lit-pos-cache) ;; A list of elements in descending order of POS of one of the forms: @@ -2709,6 +2697,18 @@ comment at the start of cc-engine.el for more info." (cons (point) state))))) +(defvar c-semi-lit-near-cache nil) +(make-variable-buffer-local 'c-semi-lit-near-cache) +;; A list of up to six recent results from `c-semi-pp-to-literal'. Each +;; element is a cons of the buffer position and the `parse-partial-sexp' state +;; at that position. + +(defvar c-semi-near-cache-limit 1) +(make-variable-buffer-local 'c-semi-near-cache-limit) +;; An upper limit on valid entries in `c-semi-lit-near-cache'. This is +;; reduced by buffer changes, and increased by invocations of +;; `c-semi-pp-to-literal'. + (defun c-semi-trim-near-cache () ;; Remove stale entries in `c-semi-lit-near-cache', i.e. those ;; whose positions are above `c-lit-pos-cache-limit'. @@ -7354,7 +7354,7 @@ comment at the start of cc-engine.el for more info." (goto-char (cadr c-old-beg-rs)) (when (looking-at c-c++-raw-string-opener-1-re) (setq id (match-string-no-properties 1)) - (when (re-search-forward (concat ")" id "\"") nil t) ; No bound. + (when (search-forward (concat ")" id "\"") nil t) ; No bound. (setq c-new-END (point-max)) (c-clear-char-properties (cadr c-old-beg-rs) c-new-END 'syntax-table) -- 2.39.5