diff options
| author | Alan Mackenzie | 2010-01-21 21:45:01 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2010-01-21 21:45:01 +0000 |
| commit | 3e8f7d9196c6c5ccac68bfe4c083e541fc9922e0 (patch) | |
| tree | 9904e9affebfa320ba82ecf78e2de9d4613369fe | |
| parent | f0bd0ad525b8867540351715dda5743f8b4c4bd1 (diff) | |
| download | emacs-3e8f7d9196c6c5ccac68bfe4c083e541fc9922e0.tar.gz emacs-3e8f7d9196c6c5ccac68bfe4c083e541fc9922e0.zip | |
Fix a situation where deletion of a cpp construct throws an error.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 11 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3c95a95aa7..a308a571874 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2010-01-21 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | Fix a situation where deletion of a cpp construct throws an error. | ||
| 4 | * progmodes/cc-engine.el (c-invalidate-state-cache): Before | ||
| 5 | invoking c-with-all-but-one-cpps-commented-out, check that the | ||
| 6 | special cpp construct is still in the buffer. | ||
| 7 | (c-parse-state): Record the special cpp with markers, not numbers. | ||
| 8 | |||
| 1 | 2010-01-21 Kenichi Handa <handa@m17n.org> | 9 | 2010-01-21 Kenichi Handa <handa@m17n.org> |
| 2 | 10 | ||
| 3 | * textmodes/sgml-mode.el (sgml-maybe-name-self): No need to | 11 | * textmodes/sgml-mode.el (sgml-maybe-name-self): No need to |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 0e6358aeee1..9d0af1d53ce 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -2996,9 +2996,11 @@ comment at the start of cc-engine.el for more info." | |||
| 2996 | ;; containing point. We can then call `c-invalidate-state-cache-1' without | 2996 | ;; containing point. We can then call `c-invalidate-state-cache-1' without |
| 2997 | ;; worrying further about macros and template delimiters. | 2997 | ;; worrying further about macros and template delimiters. |
| 2998 | (c-with-<->-as-parens-suppressed | 2998 | (c-with-<->-as-parens-suppressed |
| 2999 | (if c-state-old-cpp-beg | 2999 | (if (and c-state-old-cpp-beg |
| 3000 | (< c-state-old-cpp-beg here)) | ||
| 3000 | (c-with-all-but-one-cpps-commented-out | 3001 | (c-with-all-but-one-cpps-commented-out |
| 3001 | c-state-old-cpp-beg c-state-old-cpp-end | 3002 | c-state-old-cpp-beg |
| 3003 | (min c-state-old-cpp-end here) | ||
| 3002 | (c-invalidate-state-cache-1 here)) | 3004 | (c-invalidate-state-cache-1 here)) |
| 3003 | (c-with-cpps-commented-out | 3005 | (c-with-cpps-commented-out |
| 3004 | (c-invalidate-state-cache-1 here))))) | 3006 | (c-invalidate-state-cache-1 here))))) |
| @@ -3029,8 +3031,9 @@ comment at the start of cc-engine.el for more info." | |||
| 3029 | (c-parse-state-1)) | 3031 | (c-parse-state-1)) |
| 3030 | (c-with-cpps-commented-out | 3032 | (c-with-cpps-commented-out |
| 3031 | (c-parse-state-1)))) | 3033 | (c-parse-state-1)))) |
| 3032 | (setq c-state-old-cpp-beg here-cpp-beg | 3034 | (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t)) |
| 3033 | c-state-old-cpp-end here-cpp-end)))) | 3035 | c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t))) |
| 3036 | ))) | ||
| 3034 | 3037 | ||
| 3035 | ;; Debug tool to catch cache inconsistencies. This is called from | 3038 | ;; Debug tool to catch cache inconsistencies. This is called from |
| 3036 | ;; 000tests.el. | 3039 | ;; 000tests.el. |