# HG changeset patch # User Richard M. Stallman # Date 1073164528 0 # Node ID e7d6a284bd5ac5eb1a61f1e64965210096d3dee4 # Parent daa5c6e18f6234c63d87fd1e1c9941a326791f48 (latex-find-indent): Avoid error at end of buf. diff -r daa5c6e18f62 -r e7d6a284bd5a lisp/textmodes/tex-mode.el --- a/lisp/textmodes/tex-mode.el Sat Jan 03 21:14:11 2004 +0000 +++ b/lisp/textmodes/tex-mode.el Sat Jan 03 21:15:28 2004 +0000 @@ -2342,15 +2342,15 @@ (+ 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 " ")