emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116070: Bind open-paren-in-column-0-is-defun-start


From: Alan Mackenzie
Subject: [Emacs-diffs] trunk r116070: Bind open-paren-in-column-0-is-defun-start to nil at some entry points.
Date: Sun, 19 Jan 2014 12:37:15 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116070
revision-id: address@hidden
parent: address@hidden
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Sun 2014-01-19 12:32:47 +0000
message:
  Bind open-paren-in-column-0-is-defun-start to nil at some entry points.
  * progmodes/cc-engine.el (c-invalidate-state-cache-1)
  (c-parse-state-1, c-guess-basic-syntax):  Bind it here.
  * progmodes/cc-mode.el (c-before-change, c-after-change)
  (c-font-lock-fontify-region): Bind it here.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/cc-engine.el    
ccengine.el-20091113204419-o5vbwnq5f7feedwu-1227
  lisp/progmodes/cc-mode.el      ccmode.el-20091113204419-o5vbwnq5f7feedwu-1230
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-01-19 09:24:26 +0000
+++ b/lisp/ChangeLog    2014-01-19 12:32:47 +0000
@@ -1,3 +1,12 @@
+2014-01-19  Alan Mackenzie  <address@hidden>
+
+       Bind open-paren-in-column-0-is-defun-start to nil at some entry
+       points.
+       * progmodes/cc-engine.el (c-invalidate-state-cache-1)
+       (c-parse-state-1, c-guess-basic-syntax):  Bind it here.
+       * progmodes/cc-mode.el (c-before-change, c-after-change)
+       (c-font-lock-fontify-region): Bind it here.
+
 2014-01-19  Martin Rudalics  <address@hidden>
 
        * term.el (term-window-width): Call window-text-width instead of

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2014-01-16 06:24:06 +0000
+++ b/lisp/progmodes/cc-engine.el       2014-01-19 12:32:47 +0000
@@ -3183,7 +3183,8 @@
     ;; Truncate `c-state-cache' and set `c-state-cache-good-pos' to a value
     ;; below `here'.  To maintain its consistency, we may need to insert a new
     ;; brace pair.
-    (let ((here-bol (c-point 'bol here))
+    (let (open-paren-in-column-0-is-defun-start
+         (here-bol (c-point 'bol here))
          too-high-pa             ; recorded {/(/[ next above here, or nil.
          dropped-cons            ; was the last removed element a brace pair?
          pa)
@@ -3254,6 +3255,7 @@
   ;; This function might do hidden buffer changes.
   (let* ((here (point))
         (here-bopl (c-point 'bopl))
+        open-paren-in-column-0-is-defun-start
         strategy            ; 'forward, 'backward etc..
         ;; Candidate positions to start scanning from:
         cache-pos           ; highest position below HERE already existing in
@@ -9370,7 +9372,8 @@
     (c-save-buffer-state
        ((indent-point (point))
         (case-fold-search nil)
-        ;; A whole ugly bunch of various temporary variables.  Have
+        open-paren-in-column-0-is-defun-start
+        ;; A whole ugly bunch of various temporary variables.  Have
         ;; to declare them here since it's not possible to declare
         ;; a variable with only the scope of a cond test and the
         ;; following result clauses, and most of this function is a

=== modified file 'lisp/progmodes/cc-mode.el'
--- a/lisp/progmodes/cc-mode.el 2014-01-01 07:43:34 +0000
+++ b/lisp/progmodes/cc-mode.el 2014-01-19 12:32:47 +0000
@@ -1032,15 +1032,16 @@
                      (list type marked-id
                            type-pos term-pos
                            (buffer-substring-no-properties type-pos term-pos)
-                           (buffer-substring-no-properties beg end)))))))
+                             (buffer-substring-no-properties beg end)))))))
 
-       (if c-get-state-before-change-functions
-           (mapc (lambda (fn)
-                   (funcall fn beg end))
-                 c-get-state-before-change-functions))
-       )))
-  ;; The following must be done here rather than in `c-after-change' because
-  ;; newly inserted parens would foul up the invalidation algorithm.
+         (if c-get-state-before-change-functions
+             (let (open-paren-in-column-0-is-defun-start)
+               (mapc (lambda (fn)
+                       (funcall fn beg end))
+                     c-get-state-before-change-functions)))
+         )))
+    ;; The following must be done here rather than in `c-after-change' because
+    ;; newly inserted parens would foul up the invalidation algorithm.
   (c-invalidate-state-cache beg))
 
 (defvar c-in-after-change-fontification nil)
@@ -1062,7 +1063,7 @@
   ;; This calls the language variable c-before-font-lock-functions, if non nil.
   ;; This typically sets `syntax-table' properties.
 
-  (c-save-buffer-state (case-fold-search)
+  (c-save-buffer-state (case-fold-search open-paren-in-column-0-is-defun-start)
     ;; When `combine-after-change-calls' is used we might get calls
     ;; with regions outside the current narrowing.  This has been
     ;; observed in Emacs 20.7.
@@ -1178,7 +1179,8 @@
   ;; 
   ;; Type a space in the first blank line, and the fontification of the next
   ;; line was fouled up by context fontification.
-  (let ((new-beg beg) (new-end end) new-region case-fold-search)
+  (let ((new-beg beg) (new-end end) new-region case-fold-search
+       open-paren-in-column-0-is-defun-start)
     (if c-in-after-change-fontification
        (setq c-in-after-change-fontification nil)
       (save-restriction


reply via email to

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