emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/progmodes/cc-engine.el


From: Martin Stjernholm
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-engine.el
Date: Tue, 30 Apr 2002 19:00:54 -0400

Index: emacs/lisp/progmodes/cc-engine.el
diff -c emacs/lisp/progmodes/cc-engine.el:1.22 
emacs/lisp/progmodes/cc-engine.el:1.23
*** emacs/lisp/progmodes/cc-engine.el:1.22      Sun Apr 21 20:35:36 2002
--- emacs/lisp/progmodes/cc-engine.el   Tue Apr 30 19:00:54 2002
***************
*** 1608,1614 ****
    (catch 'return
      (let* ((start (point))
         (last-stmt-start (point))
!        (move (c-beginning-of-statement-1 lim nil t)))
  
      (while (and (/= last-stmt-start (point))
                (save-excursion
--- 1608,1614 ----
    (catch 'return
      (let* ((start (point))
         (last-stmt-start (point))
!        (move (c-beginning-of-statement-1 lim t t)))
  
      (while (and (/= last-stmt-start (point))
                (save-excursion
***************
*** 1618,1624 ****
        ;; want to continue if the block doesn't begin a top level
        ;; construct, i.e. if it isn't preceded by ';', '}', ':', or bob.
        (setq last-stmt-start (point)
!           move (c-beginning-of-statement-1 lim nil t)))
  
      (when c-recognize-knr-p
        (let ((fallback-pos (point)) knr-argdecl-start)
--- 1618,1624 ----
        ;; want to continue if the block doesn't begin a top level
        ;; construct, i.e. if it isn't preceded by ';', '}', ':', or bob.
        (setq last-stmt-start (point)
!           move (c-beginning-of-statement-1 lim t t)))
  
      (when c-recognize-knr-p
        (let ((fallback-pos (point)) knr-argdecl-start)
***************
*** 1634,1640 ****
                 (< knr-argdecl-start start)
                 (progn
                   (goto-char knr-argdecl-start)
!                  (not (eq (c-beginning-of-statement-1 lim nil t) 'macro))))
            (throw 'return
                   (cons (if (eq (char-after fallback-pos) ?{)
                             'previous
--- 1634,1640 ----
                 (< knr-argdecl-start start)
                 (progn
                   (goto-char knr-argdecl-start)
!                  (not (eq (c-beginning-of-statement-1 lim t t) 'macro))))
            (throw 'return
                   (cons (if (eq (char-after fallback-pos) ?{)
                             'previous
***************
*** 1642,1647 ****
--- 1642,1658 ----
                         knr-argdecl-start))
          (goto-char fallback-pos))))
  
+     (when c-opt-access-key
+       ;; Might have ended up before a protection label.  This should
+       ;; perhaps be checked before `c-recognize-knr-p' to be really
+       ;; accurate, but we know that no language has both.
+       (while (looking-at c-opt-access-key)
+       (goto-char (match-end 0))
+       (c-forward-syntactic-ws)
+       (when (>= (point) start)
+         (goto-char start)
+         (throw 'return (cons 'same nil)))))
+ 
      ;; `c-beginning-of-statement-1' counts each brace block as a
      ;; separate statement, so the result will be 'previous if we've
      ;; moved over any.  If they were brace list initializers we might
***************
*** 1700,1712 ****
                  (c-with-syntax-table decl-syntax-table
                    (let ((lim (point)))
                      (goto-char start)
!                     (not (and (c-syntactic-re-search-forward
!                                (concat "[;=\(\[{]\\|\\<\\("
!                                        c-opt-block-decls-with-vars-key
!                                        "\\)")
!                                lim t 1 t)
!                               (match-beginning 1)
!                               (not (eq (char-before) ?_))))))))
            ;; The declaration doesn't have any of the
            ;; `c-opt-block-decls-with-vars' keywords in the
            ;; beginning, so it ends here at the end of the block.
--- 1711,1729 ----
                  (c-with-syntax-table decl-syntax-table
                    (let ((lim (point)))
                      (goto-char start)
!                     (not (and
!                           ;; Check for `c-opt-block-decls-with-vars-key'
!                           ;; before the first paren.
!                           (c-syntactic-re-search-forward
!                            (concat "[;=\(\[{]\\|\\<\\("
!                                    c-opt-block-decls-with-vars-key
!                                    "\\)")
!                            lim t 1 t)
!                           (match-beginning 1)
!                           (not (eq (char-before) ?_))
!                           ;; Check that the first following paren is the 
block.
!                           (c-syntactic-re-search-forward "[;=\(\[{]" lim t 1 
t)
!                           (eq (char-before) ?{)))))))
            ;; The declaration doesn't have any of the
            ;; `c-opt-block-decls-with-vars' keywords in the
            ;; beginning, so it ends here at the end of the block.
***************
*** 3408,3414 ****
              (setq lim (c-most-enclosing-brace c-state-cache (point)))
              (c-beginning-of-statement-1 lim)
              (c-add-stmt-syntax 'brace-list-close t lim
!                                (c-whack-state-after (point) paren-state) t)))
           (t
            ;; Prepare for the rest of the cases below by going to the
            ;; token following the opening brace
--- 3425,3432 ----
              (setq lim (c-most-enclosing-brace c-state-cache (point)))
              (c-beginning-of-statement-1 lim)
              (c-add-stmt-syntax 'brace-list-close t lim
!                                (c-whack-state-after (point) paren-state)
!                                t)))
           (t
            ;; Prepare for the rest of the cases below by going to the
            ;; token following the opening brace



reply via email to

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