diff options
author | Alan Mackenzie <[email protected]> | 2011-08-16 20:10:40 +0000 |
---|---|---|
committer | Alan Mackenzie <[email protected]> | 2011-08-16 20:10:40 +0000 |
commit | 9c4aeabf550b825ddfd501b49d5df0c31ab6b446 (patch) | |
tree | c52921c97914eb75defe5efebde939b5efd2704d | |
parent | b215eee57d8427ac896f42a9546930cd852a1637 (diff) |
progmodes/cc-engine.el (c-state-cache-non-literal-place): Correct to
avoid the insides of macros.
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/progmodes/cc-engine.el | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 70d34fb711..a18344766f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-08-16 Alan Mackenzie <[email protected]> + + * progmodes/cc-engine.el (c-state-cache-non-literal-place): + Correct, to avoid the inside of macros. + 2011-08-16 Richard Stallman <[email protected]> * epa-mail.el: Handle GnuPG group definitions. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 0236a2be29..0d88f85d26 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2130,13 +2130,17 @@ comment at the start of cc-engine.el for more info." pos)) (defsubst c-state-cache-non-literal-place (pos state) - ;; Return a position outside of a string/comment at or before POS. + ;; Return a position outside of a string/comment/macro at or before POS. ;; STATE is the parse-partial-sexp state at POS. - (if (or (nth 3 state) ; in a string? - (nth 4 state)) ; in a comment? - (nth 8 state) - pos)) - + (let ((res (if (or (nth 3 state) ; in a string? + (nth 4 state)) ; in a comment? + (nth 8 state) + pos))) + (save-excursion + (goto-char res) + (if (c-beginning-of-macro) + (point) + res)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Stuff to do with point-min, and coping with any literal there. |