emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Stephan Fabel <stephan.fabel@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Interaction of Agenda with DEADLINE & SCHEDULED
Date: Sat, 20 Apr 2019 15:54:57 +0800	[thread overview]
Message-ID: <87pnph5cxa.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <87ftr9ta3i.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4426 bytes --]

Hi,

There seems to be not much interest about this email, so I doubt that
the described functionality will be added to org any time soon.
However, let me try to give you some hints, which might be useful for
your personal config.

> For example, how would one create a custom agenda view that
>
> - shows all accomplished tasks within the DEADLINE last week
> - shows all accomplished tasks that missed the DEADLINE last week
>
> Then does the same for the coming week, i.e.
>
> - show all tasks which are due in the next week, i.e., within the
>   DEADLINE
> - show all tasks which are overdue

There is org-super-agenda package
(https://github.com/alphapapa/org-super-agenda), which already have a
part of the functionality. You can use :scheduled and :deadline
selectors as a starting point to achieve what you want.

A more direct way to approach this is a custom skip function. As a
starting point, see my own skip function for filter todo items with
deadline, but scheduled in future:

#+begin_src emacs-lisp
(defun org-agenda-skip-deadlines-before-schedule ()
  "Skip tasks, with deadline and scheduled in future and tasks without deadline."
  (require 'org-agenda)
  (org-with-wide-buffer
   (let* ((tmp-deadline-time (flet ((org-back-to-heading (&rest args) t)) ; we should be at heading already and it consumes too much cpu time otherwise
			       (org-get-deadline-time (point))))
	  (tmp-scheduled-time (org-get-scheduled-time (point)))
	  (tmp-cur-deadline (time-to-days tmp-deadline-time))
	  (tmp-cur-schedule (time-to-days tmp-scheduled-time))
	  (tmp-cur-day (time-to-days (apply #'encode-time
					    (append '(0 0 0)
						    (list (nth 1 org-agenda-current-date))
						    (list (nth 0 org-agenda-current-date))
						    (list (nth 2 org-agenda-current-date)))))))
     (when (or
	    (not tmp-deadline-time)
	    (and
	     tmp-scheduled-time
	     tmp-deadline-time
	     (> tmp-cur-schedule tmp-cur-day)
	     ;;(> tmp-cur-deadline tmp-cur-day)
	     ))
       (re-search-forward (org-get-limited-outline-regexp) nil 'noerror)
       (point)))))
#+end_src

> Ideally, the interaction could even be more informational, so for
> example, analysis of the available work time next week (assuming 40
> hours for example) vs. the total estimated effort of all of the above
> tasks, helping to answer the question of whether all tasks are even
> achievable given the amount of available work time.
>
> Another potential -and very valuable- analysis could be a recommendation
> of order given DEADLINE, priority and effort over a period of time, for
> example the next week. What should one do first, then second, etc. to
> maximize output over a given period of time?

What you want here is actually quite a complicated optimization problem,
which probably deserves a separate full project of its own.
I cannot comment much on this part since effort estimates never worked
for me.

Best,
Ihor

Stephan Fabel <stephan.fabel@gmail.com> writes:

> When creating a custom agenda view, it is often desirable to express a
> relationship between a given task and meaningful dates, such as DEADLINE
> and SCHEDULED. It seems that with org-mode, and especially in the agenda
> view, it is not (yet?) possible to express that.
>
> For example, how would one create a custom agenda view that
>
> - shows all accomplished tasks within the DEADLINE last week
> - shows all accomplished tasks that missed the DEADLINE last week
>
> Then does the same for the coming week, i.e.
>
> - show all tasks which are due in the next week, i.e., within the
>   DEADLINE
> - show all tasks which are overdue
>
> Ideally, the interaction could even be more informational, so for
> example, analysis of the available work time next week (assuming 40
> hours for example) vs. the total estimated effort of all of the above
> tasks, helping to answer the question of whether all tasks are even
> achievable given the amount of available work time.
>
> Another potential -and very valuable- analysis could be a recommendation
> of order given DEADLINE, priority and effort over a period of time, for
> example the next week. What should one do first, then second, etc. to
> maximize output over a given period of time?
>
> I have been looking for a discussion of these type of questions in the
> documentation, worg and other places like EmacsWiki and haven't really
> found anything.
>
> Thanks for any pointers,
>
> Stephan
>
>
>
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2019-04-20  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27  0:49 Interaction of Agenda with DEADLINE & SCHEDULED Stephan Fabel
2019-04-20  7:54 ` Ihor Radchenko [this message]
2019-04-26 22:30   ` Stephan Fabel

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=87pnph5cxa.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=stephan.fabel@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).