[PATCH 4/6] emacs/tree: condition hl-line-mode on notmuch-hl-line

Subject: [PATCH 4/6] emacs/tree: condition hl-line-mode on notmuch-hl-line

Date: Sat, 10 Aug 2024 14:36:23 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


It isn't clear that this call to hl-line-mode will survive the coming
re-organization to stop relying on hooks, but incrementally this at
least makes the disabling behviour consistent.
---
 emacs/notmuch-tree.el      | 3 ++-
 test/T312-emacs-hl-line.sh | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 2332f020..24a9970f 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1091,7 +1091,8 @@ Complete list of currently available key bindings:
 
 \\{notmuch-tree-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
-  (hl-line-mode 1)
+  (when notmuch-hl-line
+    (hl-line-mode 1))
   (setq buffer-read-only t)
   (setq truncate-lines t)
   (when notmuch-tree-outline-enabled (notmuch-tree-outline-mode 1)))
diff --git a/test/T312-emacs-hl-line.sh b/test/T312-emacs-hl-line.sh
index 4697b671..dd27db0e 100755
--- a/test/T312-emacs-hl-line.sh
+++ b/test/T312-emacs-hl-line.sh
@@ -147,7 +147,6 @@ test_emacs_expect_t '(let ((notmuch-hl-line nil))
 			   nil))'
 
 test_begin_subtest "hl-line disabled, tree"
-test_subtest_known_broken
 test_emacs_expect_t '(let ((notmuch-hl-line nil))
 			(notmuch-tree "tag:inbox")
 			(notmuch-test-wait)
@@ -156,7 +155,6 @@ test_emacs_expect_t '(let ((notmuch-hl-line nil))
 			   nil))'
 
 test_begin_subtest "hl-line disabled, unthreaded"
-test_subtest_known_broken
 test_emacs_expect_t '(let ((notmuch-hl-line nil))
 			(notmuch-unthreaded "tag:inbox")
 			(notmuch-test-wait)
-- 
2.43.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: