[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/gnus-cloud b003459 58/61: Merge branch 'master' of
From: |
Teodor Zlatanov |
Subject: |
[Emacs-diffs] scratch/gnus-cloud b003459 58/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs |
Date: |
Fri, 1 Jul 2016 17:37:57 +0000 (UTC) |
branch: scratch/gnus-cloud
commit b003459033f76805e1cb356834993b0c934e5202
Merge: 204ce6f 455700d
Author: Ted Zlatanov <address@hidden>
Commit: Ted Zlatanov <address@hidden>
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
---
lisp/progmodes/cc-engine.el | 39 +++++++++++++++++++++++++++++++--------
1 file changed, 31 insertions(+), 8 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 75f07e3..48b9e5e 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2290,6 +2290,12 @@ comment at the start of cc-engine.el for more info."
;; is reduced by buffer changes, and increased by invocations of
;; `c-parse-ps-state-below'.
+(defsubst c-truncate-semi-nonlit-pos-cache (pos)
+ ;; Truncate the upper bound of the cache `c-state-semi-nonlit-pos-cache' to
+ ;; POS, if it is higher than that position.
+ (setq c-state-semi-nonlit-pos-cache-limit
+ (min c-state-semi-nonlit-pos-cache-limit pos)))
+
(defun c-state-semi-pp-to-literal (here &optional not-in-delimiter)
;; Do a parse-partial-sexp from a position in the buffer before HERE which
;; isn't in a literal, and return information about HERE, either:
@@ -2492,7 +2498,7 @@ comment at the start of cc-engine.el for more info."
(let ((c c-state-semi-nonlit-pos-cache)
elt state pos npos high-elt)
;; Trim the cache to take account of buffer changes.
- (while (and c (> (c-ps-state-cache-pos (c-ps-state-cache-pos (car c)))
+ (while (and c (> (c-ps-state-cache-pos (car c))
c-state-semi-nonlit-pos-cache-limit))
(setq c (cdr c)))
(setq c-state-semi-nonlit-pos-cache c)
@@ -3489,8 +3495,7 @@ comment at the start of cc-engine.el for more info."
;; HERE.
(if (<= here c-state-nonlit-pos-cache-limit)
(setq c-state-nonlit-pos-cache-limit (1- here)))
- (if (<= here c-state-semi-nonlit-pos-cache-limit)
- (setq c-state-semi-nonlit-pos-cache-limit (1- here)))
+ (c-truncate-semi-nonlit-pos-cache here)
;; `c-state-cache':
;; Case 1: if `here' is in a literal containing point-min, everything
@@ -6071,19 +6076,32 @@ comment at the start of cc-engine.el for more info."
(cond
((null open-paren-prop)
;; A terminated raw string
- (if (search-forward (concat ")" id "\"") nil t)
- (c-clear-char-property-with-value
- (1+ open-paren) (match-beginning 0) 'syntax-table '(1))))
+ (when (search-forward (concat ")" id "\"") nil t)
+ (let* ((closing-paren (match-beginning 0))
+ (first-punctuation
+ (save-match-data
+ (goto-char (1+ open-paren))
+ (and (c-search-forward-char-property 'syntax-table '(1)
+ closing-paren)
+ (1- (point)))))
+ )
+ (when first-punctuation
+ (c-clear-char-property-with-value
+ first-punctuation (match-beginning 0) 'syntax-table '(1))
+ (c-truncate-semi-nonlit-pos-cache first-punctuation)
+ ))))
((or (and (equal open-paren-prop '(15)) (null bound))
(equal open-paren-prop '(1)))
;; An unterminated raw string either not in a macro, or in a macro with
;; the open parenthesis right up against the end of macro
(c-clear-char-property open-quote 'syntax-table)
+ (c-truncate-semi-nonlit-pos-cache open-quote)
(c-clear-char-property open-paren 'syntax-table))
(t
;; An unterminated string in a macro, with at least one char after the
;; open paren
(c-clear-char-property open-quote 'syntax-table)
+ (c-truncate-semi-nonlit-pos-cache open-quote)
(c-clear-char-property open-paren 'syntax-table)
(let ((after-string-fence-pos
(save-excursion
@@ -6183,9 +6201,11 @@ comment at the start of cc-engine.el for more info."
(while (progn (skip-syntax-forward "^\"" end-string)
(< (point) end-string))
(c-put-char-property (point) 'syntax-table '(1)) ; punctuation
+ (c-truncate-semi-nonlit-pos-cache (point))
(forward-char))
(goto-char after-quote))
(c-put-char-property open-quote 'syntax-table '(1)) ;
punctuation
+ (c-truncate-semi-nonlit-pos-cache open-quote)
(c-put-char-property open-paren 'syntax-table '(15)) ; generic string
(when bound
;; In a CPP construct, we try to apply a generic-string `syntax-table'
@@ -6212,9 +6232,12 @@ comment at the start of cc-engine.el for more info."
"\\(\\\\\n\\)*\\=")) ; 11
(1+ open-paren) t))
(if (match-beginning 10)
- (c-put-char-property (match-beginning 10) 'syntax-table '(15))
+ (progn
+ (c-put-char-property (match-beginning 10) 'syntax-table '(15))
+ (c-truncate-semi-nonlit-pos-cache (match-beginning 10)))
(c-put-char-property (match-beginning 5) 'syntax-table '(1))
- (c-put-char-property (1+ (match-beginning 5)) 'syntax-table '(15)))
+ (c-put-char-property (1+ (match-beginning 5)) 'syntax-table '(15))
+ (c-truncate-semi-nonlit-pos-cache (1+ (match-beginning 5))))
(c-put-char-property open-paren 'syntax-table '(1)))
(goto-char bound))))
- [Emacs-diffs] scratch/gnus-cloud ffefeea 43/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, (continued)
- [Emacs-diffs] scratch/gnus-cloud ffefeea 43/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 378a387 48/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 5a962af 28/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud c332287 53/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2ee3993 50/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 513812e 52/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 1b3c761 37/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 1bf1008 54/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 0703c56 55/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 07f3078 60/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud b003459 58/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs,
Teodor Zlatanov <=
- [Emacs-diffs] scratch/gnus-cloud f7975bf 14/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud f4ddee5 23/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 7222ca6 33/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud dde06db 41/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2518519 32/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud cfd6a26 39/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 1c37f18 38/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud de3eb76 51/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud ed55b4c 45/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 0456139 46/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01