# HG changeset patch # User jwe # Date 817530802 0 # Node ID edfc235ced978bf68a6f74a72169c37ad0d6ae35 # Parent 21fe2afb3692abea75cc9ea5f0461242aeb4b313 [project @ 1995-11-28 03:53:22 by jwe] diff -r 21fe2afb3692 -r edfc235ced97 emacs/octave.el --- a/emacs/octave.el Thu Nov 16 19:16:11 1995 +0000 +++ b/emacs/octave.el Tue Nov 28 03:53:22 1995 +0000 @@ -763,42 +763,39 @@ (have-tc 0)) (save-excursion (beginning-of-line) - (while (< (point) (save-excursion (end-of-line) (point))) + (while (< (point) (octave-point 'eol)) (cond ((and (looking-at "\\bif\\b") (not (octave-is-in-string-p (point)))) - (progn - (setq icol (+ icol octave-stmt-indent)) - (setq have-if (+ have-if 1)))) + (setq icol (+ icol octave-stmt-indent) + have-if (+ have-if 1))) ((and (looking-at "\\btry\\b") (not (octave-is-in-string-p (point)))) - (progn - (setq icol (+ icol octave-stmt-indent)) - (setq have-tc (+ have-tc 1)))) + (setq icol (+ icol octave-stmt-indent) + have-tc (+ have-tc 1))) ((and (looking-at "\\bunwind_protect\\b") (not (octave-is-in-string-p (point)))) - (progn - (setq icol (+ icol octave-stmt-indent)) - (setq have-uwp (+ have-uwp 1)))) + (setq icol (+ icol octave-stmt-indent) + have-uwp (+ have-uwp 1))) ((and (looking-at "\\bcatch\\b") (not (octave-is-in-string-p (point)))) + (if (eq have-tc 0) + (setq icol (+ icol (* xelse octave-stmt-indent))))) + ((and (looking-at "\\b\\(else\\|elseif\\)\\b") + (not (octave-is-in-string-p (point)))) + (if (eq have-if 0) + (setq icol (+ icol (* xelse octave-stmt-indent))))) + ((and (looking-at "\\bunwind_protect_cleanup\\b") + (not (octave-is-in-string-p (point)))) + (if (eq have-uwp 0) + (setq icol (+ icol (* xelse octave-stmt-indent))))) + ((and (looking-at "\\bend") + (not (octave-is-in-string-p (point)))) (progn - (if (eq have-tc 0) - (setq icol (+ icol (* xelse octave-stmt-indent)))))) - ((and (looking-at "\\b\\(else\\|elseif\\)\\b") - (not (octave-is-in-string-p (point)))) - (progn - (if (eq have-if 0) - (setq icol (+ icol (* xelse octave-stmt-indent)))))) - ((and (looking-at "\\bunwind_protect_cleanup\\b") - (not (octave-is-in-string-p (point)))) - (progn - (if (eq have-uwp 0) - (setq icol (+ icol (* xelse octave-stmt-indent)))))) - ((and (looking-at "\\bend") - (not (octave-is-in-string-p (point)))) - (progn - (setq icol (- icol (* xend octave-stmt-indent))) + (if (> xend 0) + (setq icol (- icol (* xend octave-stmt-indent))) + (if (> icol 0) + (setq icol (- icol octave-stmt-indent)))) (cond ((and (> have-if 0) (looking-at "\\bendif\\b")) (setq have-if (- have-if 1)))