diff options
| author | Rolf Ade | 2019-10-13 05:18:36 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-13 05:18:36 +0200 |
| commit | 518ff50f7a245f437576c5f7e716be9cba336287 (patch) | |
| tree | 598b9498bc363308cd8fa665f2c1f579db7dec24 | |
| parent | de88ed8646383301f20f8340e13d43e5918310fa (diff) | |
| download | emacs-518ff50f7a245f437576c5f7e716be9cba336287.tar.gz emacs-518ff50f7a245f437576c5f7e716be9cba336287.zip | |
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
| -rw-r--r-- | lisp/progmodes/tcl.el | 11 |
1 files changed, 8 insertions, 3 deletions
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." | |||
| 815 | state | 815 | state |
| 816 | containing-sexp | 816 | containing-sexp |
| 817 | found-next-line) | 817 | found-next-line) |
| 818 | (if parse-start | 818 | (cond |
| 819 | (goto-char parse-start) | 819 | (parse-start |
| 820 | (beginning-of-defun)) | 820 | (goto-char parse-start)) |
| 821 | ((not (beginning-of-defun)) | ||
| 822 | ;; If we're not in a function, don't use | ||
| 823 | ;; `tcl-beginning-of-defun-function'. | ||
| 824 | (let ((beginning-of-defun-function nil)) | ||
| 825 | (beginning-of-defun)))) | ||
| 821 | (while (< (point) indent-point) | 826 | (while (< (point) indent-point) |
| 822 | (setq parse-start (point)) | 827 | (setq parse-start (point)) |
| 823 | (setq state (parse-partial-sexp (point) indent-point 0)) | 828 | (setq state (parse-partial-sexp (point) indent-point 0)) |