comparison lisp/progmodes/cplus-md.el @ 12416:8c1c47eb351a

(electric-c++-terminator): Fix logic for handling colon.
author Richard M. Stallman <rms@gnu.org>
date Wed, 28 Jun 1995 21:25:06 +0000
parents 4235784197f3
children bbd37ab04957
comparison
equal deleted inserted replaced
12415:c07a5e8f40ae 12416:8c1c47eb351a
299 ;; Colon is special only after a label, or 299 ;; Colon is special only after a label, or
300 ;; case, or another colon. 300 ;; case, or another colon.
301 ;; So quickly rule out most other uses of colon 301 ;; So quickly rule out most other uses of colon
302 ;; and do no indentation for them. 302 ;; and do no indentation for them.
303 (and (eq last-command-char ?:) 303 (and (eq last-command-char ?:)
304 (not (looking-at "case[ \t]")) 304 (or (not (or (looking-at "case[ \t]")
305 (save-excursion 305 (save-excursion
306 (forward-word 1) 306 (forward-word 1)
307 (skip-chars-forward " \t") 307 (skip-chars-forward " \t")
308 (< (point) end)) 308 (>= (point) end))))
309 ;; Do re-indent double colons 309 ;; Do re-indent double colons
310 (save-excursion 310 (save-excursion
311 (end-of-line 1) 311 (end-of-line 1)
312 (looking-at ":"))) 312 (looking-at ":"))))
313 (progn 313 (progn
314 (beginning-of-defun) 314 (beginning-of-defun)
315 (let ((pps (parse-partial-sexp (point) end))) 315 (let ((pps (parse-partial-sexp (point) end)))
316 (or (nth 3 pps) (nth 4 pps) (nth 5 pps)))))))) 316 (or (nth 3 pps) (nth 4 pps) (nth 5 pps))))))))
317 (progn 317 (progn