]> git.eshelyaron.com Git - emacs.git/commitdiff
(latex-find-indent): Avoid error at end of buf.
authorRichard M. Stallman <rms@gnu.org>
Sat, 3 Jan 2004 21:15:28 +0000 (21:15 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 3 Jan 2004 21:15:28 +0000 (21:15 +0000)
lisp/textmodes/tex-mode.el

index 87dc8fcbc00866fd4391f7054d325ff4eb32150f..68b408af0813f7e3800ccdf9fd6abd66ddf3dfbc 100644 (file)
@@ -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 " ")