Fix Tcl indentation in a namespace

Fixes bug#32035
* lisp/progmodes/tcl.el (tcl-proc-list): Add "namespace".
* test/lisp/progmodes/tcl-tests.el (tcl-mode-namespace-indent): New
test.
This commit is contained in:
Tom Tromey 2018-07-03 22:13:27 -06:00
parent f9f0c99384
commit 38ea8e147a
2 changed files with 10 additions and 1 deletions

View file

@ -360,7 +360,7 @@ Add functions to the hook with `add-hook':
(defvar tcl-proc-list
'("proc" "method" "itcl_class" "body" "configbody" "class")
'("proc" "method" "itcl_class" "body" "configbody" "class" "namespace")
"List of commands whose first argument defines something.
This exists because some people (eg, me) use `defvar' et al.
Call `tcl-set-proc-regexp' and `tcl-set-font-lock-keywords'

View file

@ -63,6 +63,15 @@
(insert "proc inthis {} {\n # nothing\n")
(should (equal "inthis" (add-log-current-defun)))))
;; From bug#32035
(ert-deftest tcl-mode-namespace-indent ()
(with-temp-buffer
(tcl-mode)
(let ((text "namespace eval Foo {\n variable foo\n}\n"))
(insert text)
(indent-region (point-min) (point-max))
(should (equal (buffer-string) text)))))
(provide 'tcl-tests)
;;; tcl-tests.el ends here