aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-18 02:11:28 +0000
committerRichard M. Stallman1997-07-18 02:11:28 +0000
commit640012115a9b8519fcfb327ea708f07c5d17b72a (patch)
tree84b1a0c20af28975161f5295ad9a8d91866a45d3
parentc93a62d8c1d3649e516169ada7eccb4372810653 (diff)
downloademacs-640012115a9b8519fcfb327ea708f07c5d17b72a.tar.gz
emacs-640012115a9b8519fcfb327ea708f07c5d17b72a.zip
(c-maybe-labelp): Add defvar.
-rw-r--r--lisp/progmodes/cc-engine.el32
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3ac0ed52b74..2c3b22cd249 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.12 10;; Version: 5.13
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.
@@ -28,21 +28,27 @@
28;; Boston, MA 02111-1307, USA. 28;; Boston, MA 02111-1307, USA.
29 29
30 30
31;; WARNING: Be *exceptionally* careful about modifications to this 31;; KLUDGE ALERT: c-maybe-labelp is used to pass information between
32;; function! Much of CC Mode depends on this Doing The Right Thing. 32;; c-crosses-statement-barrier-p and c-beginning-of-statement-1. A
33;; If you break it you will be sorry. 33;; better way should be implemented, but this will at least shut up
34;; the byte compiler.
35(defvar c-maybe-labelp nil)
36
37;; WARNING WARNING WARNING
38;;
39;; Be *exceptionally* careful about modifications to this function!
40;; Much of CC Mode depends on this Doing The Right Thing. If you
41;; break it you will be sorry. If you think you know how this works,
42;; you probably don't. No human on Earth does! :-)
43;;
44;; WARNING WARNING WARNING
34 45
35(defun c-beginning-of-statement-1 (&optional lim) 46(defun c-beginning-of-statement-1 (&optional lim)
36 ;; move to the start of the current statement, or the previous 47 ;; move to the start of the current statement, or the previous
37 ;; statement if already at the beginning of one. 48 ;; statement if already at the beginning of one.
38 (let ((firstp t) 49 (let ((firstp t)
39 (substmt-p t) 50 (substmt-p t)
40 donep c-in-literal-cache 51 donep c-in-literal-cache saved
41 ;; KLUDGE ALERT: maybe-labelp is used to pass information
42 ;; between c-crosses-statement-barrier-p and
43 ;; c-beginning-of-statement-1. A better way should be
44 ;; implemented.
45 maybe-labelp saved
46 (last-begin (point))) 52 (last-begin (point)))
47 ;; first check for bare semicolon 53 ;; first check for bare semicolon
48 (if (and (progn (c-backward-syntactic-ws lim) 54 (if (and (progn (c-backward-syntactic-ws lim)
@@ -76,7 +82,7 @@
76 (setq last-begin (point) 82 (setq last-begin (point)
77 donep t))) 83 donep t)))
78 84
79 (setq maybe-labelp nil) 85 (setq c-maybe-labelp nil)
80 ;; see if we're in a literal. if not, then this bufpos may be 86 ;; see if we're in a literal. if not, then this bufpos may be
81 ;; a candidate for stopping 87 ;; a candidate for stopping
82 (cond 88 (cond
@@ -138,7 +144,7 @@
138 ((c-crosses-statement-barrier-p (point) last-begin) 144 ((c-crosses-statement-barrier-p (point) last-begin)
139 (setq donep t)) 145 (setq donep t))
140 ;; CASE 7: ignore labels 146 ;; CASE 7: ignore labels
141 ((and maybe-labelp 147 ((and c-maybe-labelp
142 (or (and c-access-key (looking-at c-access-key)) 148 (or (and c-access-key (looking-at c-access-key))
143 ;; with switch labels, we have to go back further 149 ;; with switch labels, we have to go back further
144 ;; to try to pick up the case or default 150 ;; to try to pick up the case or default
@@ -201,7 +207,7 @@
201 (if (memq (char-after) '(?\; ?{ ?})) 207 (if (memq (char-after) '(?\; ?{ ?}))
202 (setq crossedp t) 208 (setq crossedp t)
203 (if (eq (char-after) ?:) 209 (if (eq (char-after) ?:)
204 (setq maybe-labelp t)) 210 (setq c-maybe-labelp t))
205 (forward-char 1)) 211 (forward-char 1))
206 (setq lim (point))) 212 (setq lim (point)))
207 (forward-char 1)))) 213 (forward-char 1))))