emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105473: progmodes/cc-engine.el (c-st


From: Alan Mackenzie
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105473: progmodes/cc-engine.el (c-state-cache-non-literal-place): Correct to
Date: Tue, 16 Aug 2011 20:10:40 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105473
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Tue 2011-08-16 20:10:40 +0000
message:
  progmodes/cc-engine.el (c-state-cache-non-literal-place): Correct to
  avoid the insides of macros.
modified:
  lisp/ChangeLog
  lisp/progmodes/cc-engine.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-08-16 04:04:27 +0000
+++ b/lisp/ChangeLog    2011-08-16 20:10:40 +0000
@@ -1,3 +1,8 @@
+2011-08-16  Alan Mackenzie  <address@hidden>
+
+       * progmodes/cc-engine.el (c-state-cache-non-literal-place):
+       Correct, to avoid the inside of macros.
+
 2011-08-16  Richard Stallman  <address@hidden>
 
        * epa-mail.el: Handle GnuPG group definitions.

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2011-07-26 19:18:40 +0000
+++ b/lisp/progmodes/cc-engine.el       2011-08-16 20:10:40 +0000
@@ -2130,13 +2130,17 @@
       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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]