From 8d61930f5f676f4c3fa7ff35db8c1ef84d985658 Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Fri, 6 Nov 2026 11:09:05 +0100 Subject: [PATCH 1/2] Add test kotl-mode--insert-initial-tab-in-cell-row * test/kotl-mode-tests.el (kotl-mode--insert-initial-tab-in-cell-row): Add test. --- ChangeLog | 5 +++++ test/kotl-mode-tests.el | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f2a07efe..cebf6540 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-11-06 Mats Lidell + +* test/kotl-mode-tests.el (kotl-mode--insert-initial-tab-in-cell-row): New + test. + 2026-11-04 Mats Lidell * Makefile (verify-clean-test-run): Target that runs checks for left over diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el index 5467735a..b000aa43 100644 --- a/test/kotl-mode-tests.el +++ b/test/kotl-mode-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 18-May-21 at 22:14:10 -;; Last-Mod: 17-Oct-26 at 02:56:46 by Bob Weiner +;; Last-Mod: 6-Nov-26 at 11:08:27 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1528,6 +1528,30 @@ marked with :ignore t") "(kotl-mode:kill-region): Bad region or not within a single Koutline cell" (cadr err)))))))))) +(ert-deftest kotl-mode--insert-initial-tab-in-cell-row () + "Verify that a TAB can be inserted first in a cell row and also deleted." + (let ((kotl-mode:emulate-tab t) + (kotl-mode:indent-tabs-mode t)) + (with-temp-buffer + (save-window-excursion + (with-selected-window (display-buffer (current-buffer)) + (kotl-mode) + (insert "1") + (kotl-mode:newline 1) + (insert "2") + (kotl-mode:beginning-of-line) + (execute-kbd-macro (kbd "TAB")) + (kotl-mode:beginning-of-line) + (should (looking-at-p "\t2")) + + ;; Delete the tab. Verify it deletes to the left column in + ;; the cell + (let ((p (point))) + (kotl-mode:forward-char 1) + (execute-kbd-macro (kbd "")) + (should (= p (point))) + (should (looking-at-p "2")))))))) + (provide 'kotl-mode-tests) ;; This file can't be byte-compiled without the `el-mock' package From 2832d92cb2830247de4d53077cfddc083951ad00 Mon Sep 17 00:00:00 2001 From: Mats Lidell Date: Sat, 7 Nov 2026 00:21:21 +0100 Subject: [PATCH 2/2] Move let info temp buffer --- test/kotl-mode-tests.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el index b000aa43..3700524d 100644 --- a/test/kotl-mode-tests.el +++ b/test/kotl-mode-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 18-May-21 at 22:14:10 -;; Last-Mod: 6-Nov-26 at 11:08:27 by Mats Lidell +;; Last-Mod: 7-Nov-26 at 00:19:59 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1530,9 +1530,9 @@ marked with :ignore t") (ert-deftest kotl-mode--insert-initial-tab-in-cell-row () "Verify that a TAB can be inserted first in a cell row and also deleted." - (let ((kotl-mode:emulate-tab t) - (kotl-mode:indent-tabs-mode t)) - (with-temp-buffer + (with-temp-buffer + (let ((kotl-mode:emulate-tab t) + (kotl-mode:indent-tabs-mode t)) (save-window-excursion (with-selected-window (display-buffer (current-buffer)) (kotl-mode)