Commit ed222c50 authored by Stephen Berman's avatar Stephen Berman

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'.
parent c503188f
......@@ -6583,17 +6583,19 @@ Added to `window-configuration-change-hook' in Todo mode."
(setq wrap-prefix (make-string todo-indent-to-here 32))))
(defun todo-hl-line-range ()
"Make `todo-toggle-item-highlighting' highlight entire item."
(when (todo-item-end)
(cons (todo-item-start)
(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)
(setq-local hl-line-range-function 'todo-hl-line-range))
(defun todo-modes-set-3 ()
"Make some settings that apply to multiple Todo modes."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment