rougier / svg-tag-mode

A minor mode for Emacs that replace keywords with nice SVG labels
GNU General Public License v3.0
488 stars 28 forks source link

Include a default set of tags #11

Open justinbarclay opened 3 years ago

justinbarclay commented 3 years ago

I think it would be worthwhile, as a user onboarding experience, for this package to include a default set of tags bindings that they can enable.

One of the use cases I'm thinking of is If someone downloads this from MELPA, they won't have access to example1.el or example2.el to be able to be able to use at their discretion.

rougier commented 3 years ago

Make sense. Would you have some suggestiosn based on the examples ? We could sure at least add the TODO, but what else?

justinbarclay commented 3 years ago

I think restricting these customizations to Org makes sense, it's the only base install that changing the iconography to highlight specific parts makes sense. So like you I think the TODO keywords are sane defaults. After that tags could be nice, but I don't really use tags that much so I don't have a strong inclination on that. However, I do think priorities could be another nice surprise. I currently use org-fancy-priorities for this.

rougier commented 3 years ago

Makes sense. The default would thus be "TODO", "DONE", "#A", "#B", "#C". Coudl you make a PR?

japhir commented 3 years ago

Having it depend on org-todo-keywords would be even better :). I.e. I use the below with some further face customizations in my config

(setq org-todo-keywords
   '((sequence "NEXT(n)" "WAIT(w!/!)" "TICK(t)" "SOME(s!/!)" "|"
               "DONE(d)" "CANC(c)")))
rougier commented 3 years ago

Good point. Do you know how can we extract keywords and priorities text only?

japhir commented 3 years ago

I'm an absolute elisp beginner, but just calling (print org-todo-keywords) already gives something to work with ;-) EDIT: wow I learned something by reading the manual!

(symbol-value 'org-todo-keywords)
> ((sequence "NEXT(n)" "WAIT(w!/!)" "TICK(t)" "SOME(s!/!)" "|" "DONE(d)" "CANC(c)"))

(symbol-value 'org-todo-keyword-faces)
> (("NEXT" :family "Iosevka" :foreground "light goldenrod yellow" :background "red" :weight bold) ("WAIT" :family "Iosevka" :foreground "dim gray" :background "yellow") ("TICK" :family "Iosevka" :background "light slate blue") ("SOME" :family "Iosevka" :foreground "ghost white" :background "deep sky blue") ("DONE" :family "Iosevka" :foreground "green4" :background "pale green") ("CANC" :family "Iosevka" :foreground "dim gray" :background "gray"))
rougier commented 3 years ago

@japhir Thanks for the hint. I woudl prefer to avoid parsing this list to only extract the keywords. I guess there might be some way but I need to search.

mwsundberg commented 2 years ago

Another good set of defaults might be for key chords in Help buffers. They might be a bit harder to match with regex, yet that was the first use case I thought of after seeing this (and what I plan to try to use it for).

rougier commented 2 years ago

By the way, there's now a svg-lib that is available on ELPA. I'm not sure to add the default tags inside, but we could consider a dedicated package for common tags.

Kazark commented 2 years ago

I think trying to make this "just work" with existing org stuff would be really cool---I kind of DWIM default setup out of the box. org-todo-keywords is definitely a disappointment of a data structure, though. :/

rougier commented 2 years ago

So I think solution woudl be to add dedicated examples (e.g. one for org mode)