From: Tom Tromey Date: Wed, 4 Jul 2018 04:13:27 +0000 (-0600) Subject: Fix Tcl indentation in a namespace X-Git-Tag: emacs-27.0.90~4722 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38ea8e147add0b386737df4145d7ee0fc841fe55;p=emacs.git 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. --- diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index fad62e100a4..586d8cc0ed0 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -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' diff --git a/test/lisp/progmodes/tcl-tests.el b/test/lisp/progmodes/tcl-tests.el index 55211b70be2..061488636d0 100644 --- a/test/lisp/progmodes/tcl-tests.el +++ b/test/lisp/progmodes/tcl-tests.el @@ -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