]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/calendar/todo-mode.el: Restore old code.
authorPo Lu <luangruo@yahoo.com>
Wed, 23 Mar 2022 08:51:01 +0000 (16:51 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 23 Mar 2022 08:51:01 +0000 (16:51 +0800)
lisp/calendar/todo-mode.el

index eed597a033757142262c70c9ccc8e61ab8706fb3..57fcd1b17e15a6baedd321ae8b64e5850d48353e 100644 (file)
@@ -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."