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: Sun, 03 Aug 2003 08:29:57 -0400

Index: emacs/lisp/progmodes/cc-engine.el
diff -c emacs/lisp/progmodes/cc-engine.el:1.32 
emacs/lisp/progmodes/cc-engine.el:1.33
*** emacs/lisp/progmodes/cc-engine.el:1.32      Wed Jul 16 16:54:46 2003
--- emacs/lisp/progmodes/cc-engine.el   Sun Aug  3 08:29:57 2003
***************
*** 2140,2150 ****
                     (goto-char pos))
                 (< pos start)))))))
  
! (defsubst c-end-of-current-token (&optional back-limit)
    ;; Move to the end of the current token.  Do not move if not in the
    ;; middle of one.  BACK-LIMIT may be used to bound the backward
    ;; search; if given it's assumed to be at the boundary between two
!   ;; tokens.
    (let ((start (point)))
      (cond ((< (skip-syntax-backward "w_" (1- start)) 0)
           (skip-syntax-forward "w_"))
--- 2140,2150 ----
                     (goto-char pos))
                 (< pos start)))))))
  
! (defun c-end-of-current-token (&optional back-limit)
    ;; Move to the end of the current token.  Do not move if not in the
    ;; middle of one.  BACK-LIMIT may be used to bound the backward
    ;; search; if given it's assumed to be at the boundary between two
!   ;; tokens.  Return non-nil if the point is moved, nil otherwise.
    (let ((start (point)))
      (cond ((< (skip-syntax-backward "w_" (1- start)) 0)
           (skip-syntax-forward "w_"))
***************
*** 2157,2163 ****
                      ;; syntax, but move forward in case it doesn't so that
                      ;; we don't leave point earlier than we started with.
                      (forward-char))
!                   (< (point) start)))))))
  
  (defconst c-jump-syntax-balanced
    (if (memq 'gen-string-delim c-emacs-features)
--- 2157,2164 ----
                      ;; syntax, but move forward in case it doesn't so that
                      ;; we don't leave point earlier than we started with.
                      (forward-char))
!                   (< (point) start)))))
!     (> (point) start)))
  
  (defconst c-jump-syntax-balanced
    (if (memq 'gen-string-delim c-emacs-features)
***************
*** 4404,4438 ****
    (unless (= (point) (c-point 'boi))
      ;; What we have below is actually an extremely stripped variant of
      ;; c-beginning-of-statement-1.
!     (let ((pos (point)))
        ;; Switch syntax table to avoid stopping at line continuations.
        (save-restriction
        (if lim (narrow-to-region lim (point-max)))
        (while (and (progn
                      (c-backward-syntactic-ws)
                      (c-safe (goto-char (scan-sexps (point) -1)) t))
!                   (not (c-crosses-statement-barrier-p (point) pos)))
          (setq pos (point)))
        (goto-char pos)))))
  
! (defsubst c-search-decl-header-end ()
    ;; Search forward for the end of the "header" of the current
    ;; declaration.  That's the position where the definition body
    ;; starts, or the first variable initializer, or the ending
    ;; semicolon.  I.e. search forward for the closest following
    ;; (syntactically relevant) '{', '=' or ';' token.  Point is left
    ;; _after_ the first found token, or at point-max if none is found.
!   (if (c-major-mode-is 'c++-mode)
!       ;; In C++ we need to take special care to handle those pesky
!       ;; template brackets.
!       (while (and (c-syntactic-re-search-forward "[;{=<]" nil 'move t)
!                 (when (eq (char-before) ?<)
!                   (c-with-syntax-table c++-template-syntax-table
!                     (if (c-safe (goto-char (c-up-list-forward (point))))
!                         t
!                       (goto-char (point-max))
!                       nil)))))
!     (c-syntactic-re-search-forward "[;{=]" nil 'move t t)))
  
  (defun c-beginning-of-decl-1 (&optional lim)
    ;; Go to the beginning of the current declaration, or the beginning
--- 4405,4456 ----
    (unless (= (point) (c-point 'boi))
      ;; What we have below is actually an extremely stripped variant of
      ;; c-beginning-of-statement-1.
!     (let ((pos (point)) c-maybe-labelp)
        ;; Switch syntax table to avoid stopping at line continuations.
        (save-restriction
        (if lim (narrow-to-region lim (point-max)))
        (while (and (progn
                      (c-backward-syntactic-ws)
                      (c-safe (goto-char (scan-sexps (point) -1)) t))
!                   (not (c-crosses-statement-barrier-p (point) pos))
!                   (not c-maybe-labelp))
          (setq pos (point)))
        (goto-char pos)))))
  
! (defun c-search-decl-header-end ()
    ;; Search forward for the end of the "header" of the current
    ;; declaration.  That's the position where the definition body
    ;; starts, or the first variable initializer, or the ending
    ;; semicolon.  I.e. search forward for the closest following
    ;; (syntactically relevant) '{', '=' or ';' token.  Point is left
    ;; _after_ the first found token, or at point-max if none is found.
! 
!   (let ((base (point)))
!     (if (c-major-mode-is 'c++-mode)
! 
!       ;; In C++ we need to take special care to handle operator
!       ;; tokens and those pesky template brackets.
!       (while (and
!               (c-syntactic-re-search-forward "[;{<=]" nil 'move t t)
!               (or
!                (c-end-of-current-token base)
!                ;; Handle operator identifiers, i.e. ignore any
!                ;; operator token preceded by "operator".
!                (save-excursion
!                  (and (c-safe (c-backward-sexp) t)
!                       (looking-at "operator\\([^_]\\|$\\)")))
!                (and (eq (char-before) ?<)
!                     (c-with-syntax-table c++-template-syntax-table
!                       (if (c-safe (goto-char (c-up-list-forward (point))))
!                           t
!                         (goto-char (point-max))
!                         nil)))))
!         (setq base (point)))
! 
!       (while (and
!             (c-syntactic-re-search-forward "[;{=]" nil 'move t t)
!             (c-end-of-current-token base))
!       (setq base (point))))))
  
  (defun c-beginning-of-decl-1 (&optional lim)
    ;; Go to the beginning of the current declaration, or the beginning
***************
*** 6094,6100 ****
                           ;; The '}' is unbalanced.
                           nil
                         (c-end-of-decl-1)
!                        (> (point) indent-point))))))
            (goto-char placeholder)
            (c-add-stmt-syntax 'topmost-intro-cont nil nil nil
                               containing-sexp paren-state))
--- 6112,6118 ----
                           ;; The '}' is unbalanced.
                           nil
                         (c-end-of-decl-1)
!                        (>= (point) indent-point))))))
            (goto-char placeholder)
            (c-add-stmt-syntax 'topmost-intro-cont nil nil nil
                               containing-sexp paren-state))




reply via email to

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