diff options
| author | Richard M. Stallman | 1997-09-08 03:20:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-09-08 03:20:49 +0000 |
| commit | 9796cb5b2f7c4f2ff21979571fa462816ba663b2 (patch) | |
| tree | 4b10a62fcf0b59d951556e485456a6ef9d972ebe | |
| parent | b2eeba64e91f3b38008f512887766b6a20c5f6fe (diff) | |
| download | emacs-9796cb5b2f7c4f2ff21979571fa462816ba663b2.tar.gz emacs-9796cb5b2f7c4f2ff21979571fa462816ba663b2.zip | |
(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 @@ | |||
| 7 | ;; 1985 Richard M. Stallman | 7 | ;; 1985 Richard M. Stallman |
| 8 | ;; Maintainer: cc-mode-help@python.org | 8 | ;; Maintainer: cc-mode-help@python.org |
| 9 | ;; Created: 22-Apr-1997 (split from cc-mode.el) | 9 | ;; Created: 22-Apr-1997 (split from cc-mode.el) |
| 10 | ;; Version: 5.16 | 10 | ;; Version: 5.17 |
| 11 | ;; Keywords: c languages oop | 11 | ;; Keywords: c languages oop |
| 12 | 12 | ||
| 13 | ;; This file is part of GNU Emacs. | 13 | ;; This file is part of GNU Emacs. |
| @@ -188,13 +188,13 @@ | |||
| 188 | (goto-char end)) | 188 | (goto-char end)) |
| 189 | (re-search-backward "[;{}]") | 189 | (re-search-backward "[;{}]") |
| 190 | (forward-char 1)) | 190 | (forward-char 1)) |
| 191 | (error | 191 | (error |
| 192 | (let ((beg (point))) | 192 | (let ((beg (point))) |
| 193 | (backward-up-list -1) | 193 | (c-safe (backward-up-list -1)) |
| 194 | (let ((end (point))) | 194 | (let ((end (point))) |
| 195 | (goto-char beg) | 195 | (goto-char beg) |
| 196 | (search-forward ";" end 'move)))))) | 196 | (search-forward ";" end 'move))) |
| 197 | 197 | ))) | |
| 198 | 198 | ||
| 199 | 199 | ||
| 200 | (defun c-crosses-statement-barrier-p (from to) | 200 | (defun c-crosses-statement-barrier-p (from to) |
| @@ -750,9 +750,11 @@ | |||
| 750 | (save-excursion | 750 | (save-excursion |
| 751 | (goto-char containing-sexp) | 751 | (goto-char containing-sexp) |
| 752 | (forward-sexp -1) | 752 | (forward-sexp -1) |
| 753 | (if (or (looking-at "enum[\t\n ]+") | 753 | (if (and (or (looking-at "enum[\t\n ]+") |
| 754 | (progn (forward-sexp -1) | 754 | (progn (forward-sexp -1) |
| 755 | (looking-at "enum[\t\n ]+"))) | 755 | (looking-at "enum[\t\n ]+"))) |
| 756 | (progn (c-end-of-statement-1) | ||
| 757 | (> (point) containing-sexp))) | ||
| 756 | (point))) | 758 | (point))) |
| 757 | (error nil)) | 759 | (error nil)) |
| 758 | ;; this will pick up array/aggregate init lists, even if they are nested. | 760 | ;; this will pick up array/aggregate init lists, even if they are nested. |