emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestion: refer to other scheduled tasks in DEADLINE/SCHEDULE
@ 2022-11-08 13:57 hugo
  2022-11-09  4:46 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: hugo @ 2022-11-08 13:57 UTC (permalink / raw)
  To: emacs-orgmode

Sorry if this has been asked on the list before -- I searched briefly
and couldn't find anything.

I use org mode for scheduling events (which are not tasks, and therefore
do not have a TODO status) as well as for logging tasks (which do have a
TODO status). Often, I find I want to set a deadline (less often, a
schedule) for a task identical to the timestamp of an event (e.g.
there's a seminar on Thursday, in time for which I need to read two
papers).

At the moment, I do this by looking up the event, copying the timestamp,
then setting the deadline in each task to that timestamp. This is
laborious, often quite fiddly, especially if the event's timestamp
repeats (as with weekly seminar), but the task only relates to a
specific instance of that repeat (the paper I need to read has to be
read in time for /this week's/ seminar, so I have to look up the
timestamp and check what the next match on the repeater will be, then
input that manually).

I think it would be great if other org headlines could be referenced in
DEADLINEs and SCHEDULEs. This would effectively solve my problem: I
could just add an id (or whatever identifier the implementation ends up
using) to the event headline, and then use that id in the DEADLINE or
SCHEDULE, thus:

,----
| * Important Seminar
| :PROPERTIES:
| :CUSTOM_ID: seminarid
| :END:
| <2022-10-27 Through +1w>
|
| * TODO Read Famous Paper
| DEADLINE: seminarid
|
| * TODO Read Other Paper
| DEADLINE: seminarid
`----

Then the tasks to read papers will show up in my agenda with deadlines
when the seminar starts. As far as I know, there isn't a way to do this
already (though if there is, I would be happy to use it!).

This would be great, but it still doesn't solve the repeater/specific
date problem. For this, we would need some sort of special syntax which
selects one out of the various correct dates. Perhaps:

,----
| * Important Seminar
| :PROPERTIES:
| :CUSTOM_ID: seminarid
| :END:
| <2022-10-27 Through +1w>
|
| * TODO Read Famous Paper
| DEADLINE: :id seminarid :after <2022-11-08 Tue>
|
| * TODO Read Other Paper
| DEADLINE: :id seminarid :after <2022-11-08 Tue>
`----

(This is only a suggestion, to demonstrate that some special syntax
would be necessary. I'm not wedded to the use of keys, or the specific
keys I have suggested, or anything like that.)

I don't have the knowledge of org, or the time at the moment to
implement any of this (though I wouldn't be upset if somebody else
did!). At least for now though, some questions:

- What do people think of this as an idea?
- What would be a good solution to the extra syntax problem?

(a similar question seems to have been asked before:
<https://emacs.stackexchange.com/questions/62590/org-mode-how-to-set-a-deadline-to-an-already-appointed-meeting-date>)

One day, I might find some time to look at the codebase and implement
this if nobody else does..

thanks,

Hugo


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Suggestion: refer to other scheduled tasks in DEADLINE/SCHEDULE
  2022-11-08 13:57 Suggestion: refer to other scheduled tasks in DEADLINE/SCHEDULE hugo
@ 2022-11-09  4:46 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2022-11-09  4:46 UTC (permalink / raw)
  To: hugo; +Cc: emacs-orgmode

hugo@heagren.com writes:

> I think it would be great if other org headlines could be referenced in
> DEADLINEs and SCHEDULEs. This would effectively solve my problem: I
> could just add an id (or whatever identifier the implementation ends up
> using) to the event headline, and then use that id in the DEADLINE or
> SCHEDULE, thus:
>
> ,----
> | * Important Seminar
> | :PROPERTIES:
> | :CUSTOM_ID: seminarid
> | :END:
> | <2022-10-27 Through +1w>
> |
> | * TODO Read Famous Paper
> | DEADLINE: seminarid
> |
> | * TODO Read Other Paper
> | DEADLINE: seminarid
> `----

Note that the above is ambiguous: The event may have multiple
timestamps, and it is unclear which one to select in general case.

> Then the tasks to read papers will show up in my agenda with deadlines
> when the seminar starts. As far as I know, there isn't a way to do this
> already (though if there is, I would be happy to use it!).

You can use diary-style timestamps like
DEADLINE: <%%(my/copy-date :id "seminarid" :after "2022-11-08 Tue")>

where `my/copy-date' is an arbitrary Elisp function that is executed in
Diary environment, with `date' and `entry' variables being set at
runtime. See `org-class' for a sample implementation.

Since `my/copy-date' can be anything, you can implement any logic you
need.

-- 
Ihor Radchenko // yantar92,
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>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-09  4:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 13:57 Suggestion: refer to other scheduled tasks in DEADLINE/SCHEDULE hugo
2022-11-09  4:46 ` Ihor Radchenko

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).