magit-todos icon indicating copy to clipboard operation
magit-todos copied to clipboard

Feature request: make hl-todo an optional dependency

Open zhaojiangbin opened this issue 5 years ago • 6 comments

I often need to switch between desktop sessions to work on different projects on daily basis. hl-todo adds noticeable delays to desktop-read when restoring sessions, in particular large ones with, for example, hundreds of buffers.

See tarsius/hl-todo#22

zhaojiangbin avatar Jul 15 '18 19:07 zhaojiangbin

Hm, I'm not sure about this. You don't need to have hl-todo-mode enabled to use magit-todos. Simply having it installed is all that's necessary. Without it, we'd either have no keyword fontification, or we'd have to invent something, and I don't want to reimplement that.

It seems like the problem you're having is that hl-todo-mode is slow, and I think the solution is to simply disable that mode in your config. You can still use magit-todos.

alphapapa avatar Jul 15 '18 22:07 alphapapa

You're right. I must have forgotten the case where the hl-todo package is installed but not enabled. Now I have tested it. Restoring sessions isn't affected.

As for fontifying the keywords listed in the TODOs section, a face defined within magit-todos should work. Before seeing your reply, I implemented it in a branch to not use hl-todo-keyword-faces. If you are interested, it's zhaojiangbin/magit-todos/todo-face.

zhaojiangbin avatar Jul 15 '18 23:07 zhaojiangbin

Pressed the wrong key in previous comment.

It's zhaojiangbin/magit-todos@4e5b94edbf5f5ad9421ed579fb1be04fcf31be0c.

Also, feel free to close this issue as it's working fine for me without any code change.

zhaojiangbin avatar Jul 15 '18 23:07 zhaojiangbin

Hmm, there is actually another case, minor albeit. Now that I don't enable hl-todo. I customize magit-todos-keywords as a list of strings. If I have a new keyword that's not in the default hl-todo-keyword-faces, this keyword is not highlighted in the TODOs section, unless I customize the hl-todo package and add the keyword in hl-todo-keyword-faces.

Same if I want to change the colors for the fontification.

Perhaps just a documentation matter.

zhaojiangbin avatar Jul 16 '18 00:07 zhaojiangbin

As for fontifying the keywords listed in the TODOs section, a face defined within magit-todos should work. Before seeing your reply, I implemented it in a branch to not use hl-todo-keyword-faces. If you are interested, it's zhaojiangbin/magit-todos/todo-face.

Thanks. The issue is that hl-todos gives us highlighting of several keywords. I don't want every keyword to be highlighted with the same face.

I customize magit-todos-keywords as a list of strings. If I have a new keyword that's not in the default hl-todo-keyword-faces, this keyword is not highlighted in the TODOs section, unless I customize the hl-todo package and add the keyword in hl-todo-keyword-faces.

Yeah, that's because the list of strings doesn't have colors associated. I guess we could change the customization to a list of cons cells with keyword and color in each, just like in hl-todos.

alphapapa avatar Jul 16 '18 05:07 alphapapa

I'm not interested in working on this, but maybe someone else will be.

alphapapa avatar Nov 01 '20 23:11 alphapapa