emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ed222c5: Make `todo-toggle-item-highlighting' work


From: Stephen Berman
Subject: [Emacs-diffs] master ed222c5: Make `todo-toggle-item-highlighting' work on multiline items (bug#27133)
Date: Mon, 29 May 2017 14:27:47 -0400 (EDT)

branch: master
commit ed222c502b1a0043a8bc606482a11516568a54b6
Author: Stephen Berman <address@hidden>
Commit: Stephen Berman <address@hidden>

    Make `todo-toggle-item-highlighting' work on multiline items (bug#27133)
    
    * lisp/calendar/todo-mode.el (todo-hl-line-range): New named function,
    replacing an anonymous function for the sake of `describe-variable'.
    (todo-modes-set-2): Use it as buffer-local value of hl-line-range-function
    and remove boundp test of this variable, so its value is available on
    invoking `todo-toggle-item-highlighting'.
---
 lisp/calendar/todo-mode.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 8155a42..7b27e70 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -6583,17 +6583,19 @@ Added to `window-configuration-change-hook' in Todo 
mode."
     (visual-line-mode)
     (setq wrap-prefix (make-string todo-indent-to-here 32))))
 
+(defun todo-hl-line-range ()
+  "Make `todo-toggle-item-highlighting' highlight entire item."
+  (save-excursion
+    (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."
   (add-to-invisibility-spec 'todo)
   (setq buffer-read-only t)
   (setq-local desktop-save-buffer 'todo-desktop-save-buffer)
-  (when (boundp 'hl-line-range-function)
-    (setq-local hl-line-range-function
-               (lambda() (save-excursion
-                           (when (todo-item-end)
-                             (cons (todo-item-start)
-                                   (todo-item-end))))))))
+  (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]