diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-08-16 03:38:57 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-08-16 03:38:57 +0000 |
commit | 041ec7f62a5a5b7140c7df4b9390a57f27e0cedc (patch) | |
tree | 1a2f3c6440fc2f44ee5dc01906b1b10e570e6d54 /lisp/progmodes/cc-engine.el | |
parent | c3d3eea99157f4269c2da0973ac63ef41d171189 (diff) | |
download | emacs-041ec7f62a5a5b7140c7df4b9390a57f27e0cedc.tar.gz |
(c-end-of-statement-1): Eliminate false hits on important characters
inside literals (strings, comments).
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r-- | lisp/progmodes/cc-engine.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index bfbca233701..5aa24e67fc0 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.15 +;; Version: 5.16 ;; Keywords: c languages oop ;; This file is part of GNU Emacs. @@ -171,16 +171,22 @@ (skip-chars-backward "-+!*&:.~" (c-point 'boi)))) (defun c-end-of-statement-1 () - (condition-case () - (progn + (condition-case nil + (let (beg end found) (while (and (not (eobp)) - (let ((beg (point))) + (progn + (setq beg (point)) (forward-sexp 1) - (let ((end (point))) - (save-excursion - (goto-char beg) - (not (re-search-forward "[;{}]" end t))))))) - (re-search-backward "[;}]") + (setq end (point)) + (goto-char beg) + (setq found nil) + (while (and (not found) + (re-search-forward "[;{}]" end t)) + (if (not (c-in-literal beg)) + (setq found t))) + (not found))) + (goto-char end)) + (re-search-backward "[;{}]") (forward-char 1)) (error (let ((beg (point))) |