# HG changeset patch # User Katsumi Yamaoka # Date 1264111426 0 # Node ID 746534c20a0640576cc8bb8e351679948ce00889 # Parent d263e3698b86ff4247949b62f84a0c46c0860809# Parent 719b13c3b762f097bf570bbc5d8daa2f724b83b5 Merge from mainline. diff -r d263e3698b86 -r 746534c20a06 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jan 21 09:12:33 2010 +0000 +++ b/lisp/ChangeLog Thu Jan 21 22:03:46 2010 +0000 @@ -1,3 +1,16 @@ +2010-01-21 Alan Mackenzie + + Fix a situation where deletion of a cpp construct throws an error. + * progmodes/cc-engine.el (c-invalidate-state-cache): Before + invoking c-with-all-but-one-cpps-commented-out, check that the + special cpp construct is still in the buffer. + (c-parse-state): Record the special cpp with markers, not numbers. + +2010-01-21 Kenichi Handa + + * textmodes/sgml-mode.el (sgml-maybe-name-self): No need to + process last-command-event, as it is now decoded first (Bug#5380). + 2010-01-20 Chong Yidong * term.el (term-send-raw-meta): Revert 2009-12-04 change (Bug#5330). diff -r d263e3698b86 -r 746534c20a06 lisp/progmodes/cc-engine.el --- a/lisp/progmodes/cc-engine.el Thu Jan 21 09:12:33 2010 +0000 +++ b/lisp/progmodes/cc-engine.el Thu Jan 21 22:03:46 2010 +0000 @@ -2996,9 +2996,11 @@ ;; containing point. We can then call `c-invalidate-state-cache-1' without ;; worrying further about macros and template delimiters. (c-with-<->-as-parens-suppressed - (if c-state-old-cpp-beg + (if (and c-state-old-cpp-beg + (< c-state-old-cpp-beg here)) (c-with-all-but-one-cpps-commented-out - c-state-old-cpp-beg c-state-old-cpp-end + c-state-old-cpp-beg + (min c-state-old-cpp-end here) (c-invalidate-state-cache-1 here)) (c-with-cpps-commented-out (c-invalidate-state-cache-1 here))))) @@ -3029,8 +3031,9 @@ (c-parse-state-1)) (c-with-cpps-commented-out (c-parse-state-1)))) - (setq c-state-old-cpp-beg here-cpp-beg - c-state-old-cpp-end here-cpp-end)))) + (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t)) + c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t))) + ))) ;; Debug tool to catch cache inconsistencies. This is called from ;; 000tests.el. diff -r d263e3698b86 -r 746534c20a06 lisp/textmodes/sgml-mode.el --- a/lisp/textmodes/sgml-mode.el Thu Jan 21 09:12:33 2010 +0000 +++ b/lisp/textmodes/sgml-mode.el Thu Jan 21 22:03:46 2010 +0000 @@ -608,11 +608,7 @@ "Insert a symbolic character name according to `sgml-char-names'." (interactive "*") (if sgml-name-8bit-mode - (let ((mc last-command-event)) - (if (< mc 256) - (setq mc (unibyte-char-to-multibyte mc))) - (or mc (setq mc last-command-event)) - (sgml-name-char mc)) + (sgml-name-char last-command-event) (self-insert-command 1))) (defun sgml-name-8bit-mode ()