summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2014-02-09 12:34:25 +0000
committerAlan Mackenzie <acm@muc.de>2014-02-09 12:34:25 +0000
commit411141fb8e659c11194b40b6fc645b7226c76d12 (patch)
tree93bf117deffaf461a8e2326781d41114e929a0b9
parent44e23a70ad84a80674e086af9d1d0de6399dbbfd (diff)
downloademacs-411141fb8e659c11194b40b6fc645b7226c76d12.tar.gz
Fix c-invalidate-state-cache on narrowed buffers.
progmodes/cc-defs.el (c-with-all-but-one-cpps-commented-out): Widen when setting and clearing the CPP delimiter properties.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/cc-defs.el8
2 files changed, 12 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 39d4a83033d..8f13ebaab2a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-09 Alan Mackenzie <acm@muc.de>
+
+ Fix c-invalidate-state-cache on narrowed buffers.
+ * progmodes/cc-defs.el (c-with-all-but-one-cpps-commented-out):
+ Widen when setting and clearing the CPP delimiter properties.
+
2014-02-09 Lars Ingebrigtsen <larsi@gnus.org>
* help.el (describe-bindings): Doc fix (bug#9888).
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index f72e2f99b17..1606cfb3357 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1293,10 +1293,14 @@ been put there by c-put-char-property. POINT remains unchanged."
;; suppressed.
`(unwind-protect
(c-save-buffer-state ()
- (c-clear-cpp-delimiters ,beg ,end)
+ (save-restriction
+ (widen)
+ (c-clear-cpp-delimiters ,beg ,end))
,`(c-with-cpps-commented-out ,@forms))
(c-save-buffer-state ()
- (c-set-cpp-delimiters ,beg ,end))))
+ (save-restriction
+ (widen)
+ (c-set-cpp-delimiters ,beg ,end)))))
(defsubst c-intersect-lists (list alist)
;; return the element of ALIST that matches the first element found