Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent parsing of non-org keywords between hl-todos and magit-todos #124

Closed
elfsternberg opened this issue Mar 24, 2022 · 1 comment

Comments

@elfsternberg
Copy link

I write technical documentation, and I mostly write in Markdown. While writing documentation, I frequently have to leave a placeholder for a future pass, which often reads like this: [TK: Where is this event handler defined?]. ("TK" is writerspeak for "to come" since the only words that have 'tk' in them are pocketknife and hotkey, and case sensitivity matters.)

If I use hl-todo in a buffer with TK notes, it works. It does not work with magit-todo. If I put a space in front of the letters, so it looks like [ TK: ...], then it works with magit-todos, but that's nonstandard and unaesthetic.

Expected behavior is that hl-todos and magit-todos find the same todo entries.

elfsternberg added a commit to elfsternberg/magit-todos that referenced this issue Mar 24, 2022
This patch addressses [Magit-todos Issue 124](alphapapa#124).

Magit-todos has inconsistent behavior with hl-todos.  If a keyword doesn't
start with a whitespace character (using the elisp-regexp symbol `blank`),
hl-todos will find it, but magit-todos will not.

This has consequences for documentation writers who typically leave their
todo tasks in-line with the documentation, using the "to come" convention
of `[TK: Do something here]`. Since the keyword "TK" does not have a leading
space, hl-todos will find it, but magit-todos will not.

This patch replaces the requirement that the keyword be proceeded with a
whitespace character with a more general case of `(not alphanumeric)`. This
creates behavior that matches hl-todos more closely.  This change is only
applied to the "non-org" branch of the macro.
@alphapapa
Copy link
Owner

As noted on #125, I don't think I necessarily intended that magit-todos behave exactly the same as hl-todo in this regard; the use of hl-todo in this package is mostly for convenience regarding display faces. Anyway, see discussion there.

@alphapapa alphapapa closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants