]> code.delx.au - gnu-emacs/commitdiff
Fix c-invalidate-state-cache on narrowed buffers.
authorAlan Mackenzie <acm@muc.de>
Sun, 9 Feb 2014 12:34:25 +0000 (12:34 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 9 Feb 2014 12:34:25 +0000 (12:34 +0000)
progmodes/cc-defs.el (c-with-all-but-one-cpps-commented-out): Widen when
setting and clearing the CPP delimiter properties.

lisp/ChangeLog
lisp/progmodes/cc-defs.el

index 39d4a83033dc4dd4480eef513ae27f683979035e..8f13ebaab2a59138ce76cd94ae71ca1095e11680 100644 (file)
@@ -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).
index f72e2f99b17fd6be7f70a7abc2f69c2aad242b6a..1606cfb33575df70fb66ab9f13a7d8fe011f4880 100644 (file)
@@ -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)))))
 \f
 (defsubst c-intersect-lists (list alist)
   ;; return the element of ALIST that matches the first element found