From: Richard M. Stallman Date: Sat, 3 Jan 2004 21:15:28 +0000 (+0000) Subject: (latex-find-indent): Avoid error at end of buf. X-Git-Tag: ttn-vms-21-2-B4~8012 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21749f14c7dfac88a0c1e0e748f222e4ca83bef6;p=emacs.git (latex-find-indent): Avoid error at end of buf. --- diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 87dc8fcbc00..68b408af081 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2342,15 +2342,15 @@ There might be text before point." (+ indent (current-column) tex-indent-item)) (t (let ((col (current-column))) - (if (not (eq (char-syntax char) ?\()) + (if (or (null char) (not (eq (char-syntax char) ?\())) ;; If the first char was not an open-paren, there's ;; a risk that this is really not an argument to the ;; macro at all. - (+ indent col) - (forward-sexp 1) - (if (< (line-end-position) - (save-excursion (forward-comment (point-max)) - (point))) + (+ indent col) + (forward-sexp 1) + (if (< (line-end-position) + (save-excursion (forward-comment (point-max)) + (point))) ;; we're indenting the first argument. (min (current-column) (+ tex-indent-arg col)) (skip-syntax-forward " ")