emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Tyler Grinn <tylergrinn@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: contrib - ol-todo
Date: Tue, 20 Sep 2022 16:20:44 +0800	[thread overview]
Message-ID: <87y1ueqwwz.fsf@localhost> (raw)
In-Reply-To: <87edwax4nv.fsf@gmail.com>

Tyler Grinn <tylergrinn@gmail.com> writes:

> I've built this small package which registers a todo type link:
>
> [[todo:~/projects.org::#my-todo][My todo]]
>
> And it is displayed like this:
>
> <DONE> My todo
>
> Where DONE is the actual todo keyword on the target heading. The keyword
> on the link and target stay in sync, so setting a different todo keyword
> either on the link or the target will update both. The link does not
> show up in the agenda and can be placed anywhere an org link is valid.
>
> I'm using this to create a list of todos I want done today from a larger
> list of all my todos.

Why don't just modify :activate-func in the ordinary file links?

> Is this something that would be appropriate for org-contrib?

Note that org-contrib is obsolete. See
https://git.sr.ht/~bzg/org-contrib/.

I recommend submitting your package to GNU ELPA or NonGNU ELPA.

> When I tried to register a :store function which is valid for org buffers
> backed by a file, the desired behavior was that I could choose between
> storing a file link and a todo link, but instead, it simply stores a
> todo link without confirmation. Is this a known problem?

See org-store-link-functions docstring:

>> Each function will be called in turn until one returns a non-nil
>> value.  Each function should check if it is responsible for
>> creating this link (for example by looking at the major mode).
>> If not, it must exit and return nil.  If yes, it should return
>> a non-nil value after calling org-link-store-props with a list
>> of properties and values.

Your store function can provide interactive query and return nil if the
user does not want to create todo: link.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


  reply	other threads:[~2022-09-20  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 23:47 contrib - ol-todo Tyler Grinn
2022-09-20  8:20 ` Ihor Radchenko [this message]
2022-09-22 12:46   ` Tyler Grinn
2022-09-22 14:25     ` Max Nikulin
2022-09-22 22:28       ` Tyler Grinn

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87y1ueqwwz.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tylergrinn@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).