From: Richard M. Stallman Date: Wed, 28 Jun 1995 21:25:06 +0000 (+0000) Subject: (electric-c++-terminator): Fix logic for handling colon. X-Git-Tag: emacs-19.34~3443 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e2b1cb74271b973feaee005696441fdf136e5702;p=emacs.git (electric-c++-terminator): Fix logic for handling colon. --- diff --git a/lisp/progmodes/cplus-md.el b/lisp/progmodes/cplus-md.el index 647f08ba493..8c93118d91b 100644 --- a/lisp/progmodes/cplus-md.el +++ b/lisp/progmodes/cplus-md.el @@ -301,15 +301,15 @@ no args if that value is non-nil." ;; So quickly rule out most other uses of colon ;; and do no indentation for them. (and (eq last-command-char ?:) - (not (looking-at "case[ \t]")) - (save-excursion - (forward-word 1) - (skip-chars-forward " \t") - (< (point) end)) - ;; Do re-indent double colons - (save-excursion - (end-of-line 1) - (looking-at ":"))) + (or (not (or (looking-at "case[ \t]") + (save-excursion + (forward-word 1) + (skip-chars-forward " \t") + (>= (point) end)))) + ;; Do re-indent double colons + (save-excursion + (end-of-line 1) + (looking-at ":")))) (progn (beginning-of-defun) (let ((pps (parse-partial-sexp (point) end)))