diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-09-08 03:20:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-09-08 03:20:49 +0000 |
commit | 562fb3eeda5d457b21549ebc9ddb6fe614c5c598 (patch) | |
tree | 510e173e3c6a671104dcef56c94f0d3eed3ecc90 | |
parent | 580aa385c4d648faa9abfffa3244f658bae5f550 (diff) | |
download | emacs-562fb3eeda5d457b21549ebc9ddb6fe614c5c598.tar.gz |
(c-end-of-statement-1): Wrap backward-up-list in a c-safe call so no
error results when buffer contains only a comment and point is at eob.
(c-inside-bracelist-p): Add a test to the enum list test so that enum
in a k&r arg decl doesn't confuse handling of the function body.
-rw-r--r-- | lisp/progmodes/cc-engine.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 5aa24e67fc0..9fd6d372485 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -7,7 +7,7 @@ ;; 1985 Richard M. Stallman ;; Maintainer: cc-mode-help@python.org ;; Created: 22-Apr-1997 (split from cc-mode.el) -;; Version: 5.16 +;; Version: 5.17 ;; Keywords: c languages oop ;; This file is part of GNU Emacs. @@ -188,13 +188,13 @@ (goto-char end)) (re-search-backward "[;{}]") (forward-char 1)) - (error + (error (let ((beg (point))) - (backward-up-list -1) + (c-safe (backward-up-list -1)) (let ((end (point))) (goto-char beg) - (search-forward ";" end 'move)))))) - + (search-forward ";" end 'move))) + ))) (defun c-crosses-statement-barrier-p (from to) @@ -750,9 +750,11 @@ (save-excursion (goto-char containing-sexp) (forward-sexp -1) - (if (or (looking-at "enum[\t\n ]+") - (progn (forward-sexp -1) - (looking-at "enum[\t\n ]+"))) + (if (and (or (looking-at "enum[\t\n ]+") + (progn (forward-sexp -1) + (looking-at "enum[\t\n ]+"))) + (progn (c-end-of-statement-1) + (> (point) containing-sexp))) (point))) (error nil)) ;; this will pick up array/aggregate init lists, even if they are nested. |