GNU bug report logs - #44834
27.1; Tcl mode enforces bad indentation following proc within a namespace

Previous Next

Package: emacs;

Reported by: Morgan Willcock <mwillcock <at> precedence.co.uk>

Date: Tue, 24 Nov 2020 00:18:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 44083

Found in versions 27.0.50, 27.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 44834 <at> debbugs.gnu.org (full text, mbox):

From: Anticrisis <anticrisisg <at> gmail.com>
To: 44834 <at> debbugs.gnu.org
Subject: Patch to provide failing test for bug 44834
Date: Fri, 8 Jan 2021 13:04:20 -1000
--- emacs/test/lisp/progmodes/tcl-tests.el 2021-01-01 22:11:30.620000000 -1000
+++ emacs.patched/test/lisp/progmodes/tcl-tests.el 2021-01-08
12:51:27.420000000 -1000
@@ -50,14 +50,14 @@
(insert "proc notinthis {} {\n # nothing\n}\n\n")
(should-not (add-log-current-defun))))

-(ert-deftest tcl-mode-function-name ()
+(ert-deftest tcl-mode-function-name-2 ()
(with-temp-buffer
(tcl-mode)
(insert "proc simple {} {\n # nothing\n}")
(backward-char 3)
(should (equal "simple" (add-log-current-defun)))))

-(ert-deftest tcl-mode-function-name ()
+(ert-deftest tcl-mode-function-name-3 ()
(with-temp-buffer
(tcl-mode)
(insert "proc inthis {} {\n # nothing\n")
@@ -71,6 +71,15 @@
(insert text)
(indent-region (point-min) (point-max))
(should (equal (buffer-string) text)))))
+
+;; From bug#44834
+(ert-deftest tcl-mode-namespace-indent-2 ()
+ (with-temp-buffer
+ (tcl-mode)
+ (let ((text "namespace eval Foo {\n proc foo {} {}\n\n proc bar {}{}}\n"))
+ (insert text)
+ (indent-region (point-min) (point-max))
+ (should (equal (buffer-string) text)))))

(provide 'tcl-tests)




This bug report was last modified 4 years and 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.