emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b49d249ee5 2/3: * lisp/calendar/todo-mode.el: Restore old code.


From: Po Lu
Subject: master b49d249ee5 2/3: * lisp/calendar/todo-mode.el: Restore old code.
Date: Wed, 23 Mar 2022 08:26:57 -0400 (EDT)

branch: master
commit b49d249ee546d360f1c85cc1cbf441b23dbddbd2
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    * lisp/calendar/todo-mode.el: Restore old code.
---
 lisp/calendar/todo-mode.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index eed597a033..57fcd1b17e 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1040,7 +1040,9 @@ empty line above the done items separator."
   (eval-and-compile (require 'hl-line))
   (when (memq major-mode
              '(todo-mode todo-archive-mode todo-filtered-items-mode))
-    (hl-line-mode 'toggle)))
+    (if hl-line-mode
+       (hl-line-mode -1)
+      (hl-line-mode 1))))
 
 (defvar todo--item-headers-hidden nil
   "Non-nil if item date-time headers in current buffer are hidden.")
@@ -6674,8 +6676,9 @@ Added to `window-configuration-change-hook' in Todo mode."
 (defun todo-hl-line-range ()
   "Make `todo-toggle-item-highlighting' highlight entire item."
   (save-excursion
-    (when (and (todo-item-end) hl-line--overlay)
-      (move-overlay hl-line--overlay (todo-item-start) (todo-item-end)))))
+    (when (todo-item-end)
+      (cons (todo-item-start)
+            (todo-item-end)))))
 
 (defun todo-modes-set-2 ()
   "Make some settings that apply to multiple Todo modes."
@@ -6683,7 +6686,7 @@ Added to `window-configuration-change-hook' in Todo mode."
   (setq buffer-read-only t)
   (setq-local todo--item-headers-hidden nil)
   (setq-local desktop-save-buffer 'todo-desktop-save-buffer)
-  (add-hook 'hl-line-highlight-hook #'todo-hl-line-range nil t))
+  (setq-local hl-line-range-function #'todo-hl-line-range))
 
 (defun todo-modes-set-3 ()
   "Make some settings that apply to multiple Todo modes."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]