From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ihor Radchenko Subject: Re: Interaction of Agenda with DEADLINE & SCHEDULED Date: Sat, 20 Apr 2019 15:54:57 +0800 Message-ID: <87pnph5cxa.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <87ftr9ta3i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:44744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHkr1-0001Rw-Tf for emacs-orgmode@gnu.org; Sat, 20 Apr 2019 03:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHkr0-0005pp-Jw for emacs-orgmode@gnu.org; Sat, 20 Apr 2019 03:56:07 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:39216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHkr0-0005nK-Db for emacs-orgmode@gnu.org; Sat, 20 Apr 2019 03:56:06 -0400 Received: by mail-pl1-x62b.google.com with SMTP id e92so1767921plb.6 for ; Sat, 20 Apr 2019 00:56:05 -0700 (PDT) In-Reply-To: <87ftr9ta3i.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Stephan Fabel , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 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 > > > > --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEERZAHPFbUe3JemmzmZHB2Kn2hHYsFAly60FIACgkQZHB2Kn2h HYsx9AgAviRlVlUirPc0evewOViJPNxrB9itnAAu/MboLg0Tla/aptt1D+StpCo2 iKOtZ0v73uW2D1xbKVmkMxfsZU4FU+o/qUoz7CJOfnu7umGWCyWVH2yT/3vVVEvO 5/kqfil4PZUPNs0fsnACsDH9xkYqTm0ZDhKqgTqGXklZg8IjNEb+GkmQzWQuv9kU CQ4jmCCTqVJAzby8mZod984vpPJHxjrQTy1rHuK2SnIx7ufpIkn2l98ct9TB619L J+4wuSoxRz3G5nTTVavGAVx6WfgnNvhcqYyK+9ngccZWMFQ48aHFPIf/uQlOwMqk /gVDdHf1rjGsovSbg5TjbsRpoDVWYw== =DnbY -----END PGP SIGNATURE----- --=-=-=--