[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 38ea8e1: Fix Tcl indentation in a namespace
From: |
Tom Tromey |
Subject: |
[Emacs-diffs] master 38ea8e1: Fix Tcl indentation in a namespace |
Date: |
Wed, 4 Jul 2018 00:13:47 -0400 (EDT) |
branch: master
commit 38ea8e147add0b386737df4145d7ee0fc841fe55
Author: Tom Tromey <address@hidden>
Commit: Tom Tromey <address@hidden>
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.
---
lisp/progmodes/tcl.el | 2 +-
test/lisp/progmodes/tcl-tests.el | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index fad62e1..586d8cc 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 55211b7..0614886 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 38ea8e1: Fix Tcl indentation in a namespace,
Tom Tromey <=