changeset 53489:e7d6a284bd5a

(latex-find-indent): Avoid error at end of buf.
author Richard M. Stallman <rms@gnu.org>
date Sat, 03 Jan 2004 21:15:28 +0000
parents daa5c6e18f62
children 11067d9b11b9
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 " ")