]> git.eshelyaron.com Git - emacs.git/commitdiff
TCL indentation fix outside functions
authorRolf Ade <rolf@pointsman.de>
Sun, 13 Oct 2019 03:18:36 +0000 (05:18 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 13 Oct 2019 03:18:36 +0000 (05:18 +0200)
* lisp/progmodes/tcl.el (tcl-calculate-indent): Indent code
correctly outside of function definitions (bug#23565).

Copyright-paperwork-exempt: yes

lisp/progmodes/tcl.el

index 0fd3d6d1bf435b5d79e4f5f3a3f84e400004f31a..0788725055eed2bd11d82c00a9b8199c89887f85 100644 (file)
@@ -815,9 +815,14 @@ Returns nil if line starts inside a string, t if in a comment."
           state
           containing-sexp
           found-next-line)
-      (if parse-start
-         (goto-char parse-start)
-       (beginning-of-defun))
+      (cond
+       (parse-start
+       (goto-char parse-start))
+       ((not (beginning-of-defun))
+        ;; If we're not in a function, don't use
+        ;; `tcl-beginning-of-defun-function'.
+        (let ((beginning-of-defun-function nil))
+          (beginning-of-defun))))
       (while (< (point) indent-point)
        (setq parse-start (point))
        (setq state (parse-partial-sexp (point) indent-point 0))