all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: 27133@debbugs.gnu.org
Subject: bug#27133: 26.0.50; Todo-mode multiline item highlighting is broken
Date: Mon, 29 May 2017 20:19:57 +0200	[thread overview]
Message-ID: <87poerplte.fsf@rosalinde> (raw)

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

If a todo-mode item contains more than one line (hard newline), then
typing `H' (`todo-toggle-item-highlighting') only highlights the first
line instead of the entire item.


[-- Attachment #2: ChangeLog --]
[-- Type: text/plain, Size: 452 bytes --]

2017-05-29  Stephen Berman  <stephen.berman@gmx.net>

	Make `todo-toggle-item-highlighting' work on multiline items

	* 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'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: todo-mode item highlighting patch --]
[-- Type: text/x-patch, Size: 1078 bytes --]

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 8155a4241a..7b27e7049d 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -6583,17 +6583,19 @@ todo-modes-set-1
     (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."

[-- Attachment #4: Type: text/plain, Size: 247 bytes --]



In GNU Emacs 26.0.50 (build 29, x86_64-pc-linux-gnu, GTK+ Version 3.22.8)
 of 2017-05-28 built on rosalinde
Repository revision: 288b3ca2e519903653b9bc88d281ecd9f6b162a4
Windowing system distributor 'The X.Org Foundation', version 11.0.11901000

             reply	other threads:[~2017-05-29 18:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 18:19 Stephen Berman [this message]
2017-05-29 18:32 ` bug#27133: 26.0.50; Todo-mode multiline item highlighting is broken Stephen Berman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87poerplte.fsf@rosalinde \
    --to=stephen.berman@gmx.net \
    --cc=27133@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.