meedstrom / org-node

GNU General Public License v3.0
74 stars 2 forks source link

[FR] TODO STATES #3

Closed Ypot closed 5 days ago

Ypot commented 2 months ago

When inserting links, I think it shouldn't add the TODO STATE to the link description.

meedstrom commented 2 months ago

Agreed. I assume you are using file-local #+todo: settings?

I've had an idea knocking around for a way to handle that. Newest master has an attempted fix!

Ypot commented 2 months ago

Agreed. I assume you are using file-local #+todo: settings?

Nope. In my init file, example: '(org-todo-keywords '((sequence "PROJ(P)" "|" "CANCELED(c@)")))

I've had an idea knocking around for a way to handle that. Newest master has an attempted fix!

Not working, I think.

meedstrom commented 2 months ago

Hmm. What does ~(org-node-cache--make-todo-regexp)~ return for you?

meedstrom commented 2 months ago

Updated syntax since I asked that.

Given your org-todo-keywords, the code uses this expression

(org-node-worker--make-todo-regexp
  (string-join (mapcan #'cdr '((sequence "PROJ(P)" "|" "CANCELED(c@)")))
               " "))

which is the same as this

(org-node-worker--make-todo-regexp "PROJ(P) | CANCELED(c@)")

which returns the regexp

"\\(?:CANCELED\\|PROJ\\)"

which should match your todo states if they are only CANCELED or PROJ.

So -- ohhhh wait. Do you have any text before the state? I think that's not Org syntax but I'm learning every day heh.