From: Rolf Ade Date: Sun, 13 Oct 2019 03:18:36 +0000 (+0200) Subject: TCL indentation fix outside functions X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~19^2~1500 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=518ff50f7a245f437576c5f7e716be9cba336287;p=emacs.git TCL indentation fix outside functions * lisp/progmodes/tcl.el (tcl-calculate-indent): Indent code correctly outside of function definitions (bug#23565). Copyright-paperwork-exempt: yes --- diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 0fd3d6d1bf4..0788725055e 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -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))