Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting by priorities broken in orq-ql-block #38

Open
mz-pdm opened this issue Aug 25, 2019 · 7 comments · May be fixed by #325
Open

Sorting by priorities broken in orq-ql-block #38

mz-pdm opened this issue Aug 25, 2019 · 7 comments · May be fixed by #325

Comments

@mz-pdm
Copy link

mz-pdm commented Aug 25, 2019

When I use org-ql-block, apparently org-agenda-sorting-strategy is used to sort the entries. However, there is something wrong with sorting by priorities, when using `priority-down' in org-agenda-sorting-strategy. Entries with defined properties are sorted in the opposite direction, e.g. C-B-A rather than A-B-C. This is different from sorting in standard agendas, without org-ql-block. Entries without defined priorities are put last, which is correct.

@alphapapa
Copy link
Owner

Thanks for reporting this. You're right, I see this behavior myself, but I don't know why. The priority text property used by org-entries-lessp and org-cmp-values seems to be correct in each entry, so it seems like sorting should work properly. Looks like this will require more tracing and debugging.

In the meantime, I went ahead and added query preambles for the priority predicate, so those queries can be much faster now.

@alphapapa alphapapa self-assigned this Aug 26, 2019
@mz-pdm
Copy link
Author

mz-pdm commented Aug 26, 2019

In org-ql-block agendas, priority properties correspond to the priority letters, such as 66 (for #B) or 67 (#C) in my case. In standard Org agendas, the numbers are different and in the opposite order, such as 2001 for #B and 1001 for #C. So the issue apparently is that Org makes different numbers for priorities.

@alphapapa
Copy link
Owner

alphapapa commented Aug 26, 2019

Ah, yes, I forgot about Org adding 1000 to priorities:

(defun org-get-priority (s)
  "Find priority cookie and return priority."
  (save-match-data
    (if (functionp org-get-priority-function)
	(funcall org-get-priority-function)
      (if (not (string-match org-priority-regexp s))
	  (* 1000 (- org-lowest-priority org-default-priority))
	(* 1000 (- org-lowest-priority
		   (string-to-char (match-string 2 s))))))))

Because it also modifies the internal priority number based on other criteria:

(defun org-show-priority ()
  "Show the priority of the current item.
This priority is composed of the main priority given with the [#A] cookies,
and by additional input from the age of a schedules or deadline entry."
  (interactive)
  (let ((pri (if (eq major-mode 'org-agenda-mode)
		 (org-get-at-bol 'priority)
	       (save-excursion
		 (save-match-data
		   (beginning-of-line)
		   (and (looking-at org-heading-regexp)
			(org-get-priority (match-string 0))))))))
    (message "Priority is %d" (if pri pri -1000))))

That's confusing and one of the reasons I made org-ql, so each attribute is treated independently.

@alphapapa
Copy link
Owner

Not sure how best to fix this, so will work on it in the future. Contributions and discussion are welcome. :)

@rieje
Copy link

rieje commented Aug 2, 2020

Entries without defined priorities are put last, which is correct.

Currently using the WIP branch--priorities seem to sort priority with :sort (priority). However, entries without an explicit priority set are always on the bottom (i.e. only tasks with priorities explicitly set are sorted), even with org-default-priority set to 66 or "B". Is this correct? I want to set some entries to priority "C" to put them at the end of the list but this is not possible with the current behavior.

@alphapapa
Copy link
Owner

@rieje That is how I designed org-ql to work with regard to priorities. I realize that it's different than how org-agenda works, but it makes more sense to me for entries without an explicit priority to be sorted below entries with priority C (IOW, for entries without an explicit priority to not have priority B).

I may consider changing this in the future to work more like org-agenda does, but I probably won't work on that soon.

@alphapapa alphapapa modified the milestones: 0.5, 0.6 Nov 20, 2020
@alphapapa alphapapa modified the milestones: 0.6, Future Jun 17, 2021
anpandey added a commit to anpandey/org-ql that referenced this issue Jan 22, 2023
@maikol-solis
Copy link

Hi!

I'm having the same issue after calling org-super-agenda with a custom org-ql-block

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p [org-element-deferred org-element--headline-parse-title (nil) nil])
  >([org-element-deferred org-element--headline-parse-title (nil) nil] [org-element-deferred org-element--headline-parse-title (nil) nil])
  (cond ((> pa pb) 1) ((< pa pb) -1))
  (let ((pa (or (get-text-property (1- (length a)) property a) 0)) (pb (or (get-text-property (1- (length b)) property b) 0))) (cond ((> pa pb) 1) ((< pa pb) -1)))
  org-cmp-values(#("  NEXT Enviar a regi..." 0 2 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...) 2 6 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...) 6 61 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...) 61 69 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...)) #("  NEXT Hacer carta s..." 0 2 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...) 2 6 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...) 6 73 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...) 73 81 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... ...)) priority)
  (and (org-em 'priority-up 'priority-down ss) (org-cmp-values a b 'priority))
  (let* ((timestamp-up (and (org-em 'timestamp-up 'timestamp-down ss) (org-cmp-ts a b ""))) (timestamp-down (if timestamp-up (- timestamp-up) nil)) (scheduled-up (and (org-em 'scheduled-up 'scheduled-down ss) (org-cmp-ts a b "scheduled"))) (scheduled-down (if scheduled-up (- scheduled-up) nil)) (deadline-up (and (org-em 'deadline-up 'deadline-down ss) (org-cmp-ts a b "deadline"))) (deadline-down (if deadline-up (- deadline-up) nil)) (tsia-up (and (org-em 'tsia-up 'tsia-down ss) (org-cmp-ts a b "timestamp_ia"))) (tsia-down (if tsia-up (- tsia-up) nil)) (ts-up (and (org-em 'ts-up 'ts-down ss) (org-cmp-ts a b "timestamp"))) (ts-down (if ts-up (- ts-up) nil)) (time-up (and (org-em 'time-up 'time-down ss) (org-cmp-time a b))) (time-down (if time-up (- time-up) nil)) (stats-up (and (org-em 'stats-up 'stats-down ss) (org-cmp-values a b 'org-stats))) (stats-down (if stats-up (- stats-up) nil)) (priority-up (and (org-em 'priority-up 'priority-down ss) (org-cmp-values a b 'priority))) (priority-down (if priority-up (- priority-up) nil)) (urgency-up (and (org-em 'urgency-up 'urgency-down ss) (org-cmp-values a b 'urgency))) (urgency-down (if urgency-up (- urgency-up) nil)) (effort-up (and (org-em 'effort-up 'effort-down ss) (org-cmp-effort a b))) (effort-down (if effort-up (- effort-up) nil)) (category-up (and (or (org-em 'category-up 'category-down ss) (memq 'category-keep ss)) (org-cmp-category a b))) (category-down (if category-up (- category-up) nil)) (category-keep (if category-up 1 nil)) (tag-up (and (org-em 'tag-up 'tag-down ss) (org-cmp-tag a b))) (tag-down (if tag-up (- tag-up) nil)) (todo-state-up (and (org-em 'todo-state-up 'todo-state-down ss) (org-cmp-todo-state a b))) (todo-state-down (if todo-state-up (- todo-state-up) nil)) (habit-up (and (org-em 'habit-up 'habit-down ss) (org-cmp-habit-p a b))) (habit-down (if habit-up (- habit-up) nil)) (alpha-up (and (org-em 'alpha-up 'alpha-down ss) (org-cmp-alpha a b))) (alpha-down (if alpha-up (- alpha-up) nil)) (need-user-cmp (org-em 'user-defined-up 'user-defined-down ss)) user-defined-up user-defined-down) (if (and need-user-cmp org-agenda-cmp-user-defined (functionp org-agenda-cmp-user-defined)) (progn (progn (setq user-defined-up (funcall org-agenda-cmp-user-defined a b)) (setq user-defined-down (if user-defined-up (- user-defined-up) nil))))) (cdr (assoc (eval (cons 'or org-agenda-sorting-strategy-selected) t) '((-1 . t) (1) (nil)))))
  (progn (with-no-warnings (defvar timestamp-up) (defvar timestamp-down) (defvar scheduled-up) (defvar scheduled-down) (defvar deadline-up) (defvar deadline-down) (defvar tsia-up) (defvar tsia-down) (defvar ts-up) (defvar ts-down) (defvar time-up) (defvar time-down) (defvar stats-up) (defvar stats-down) (defvar priority-up) (defvar priority-down) (defvar urgency-up) (defvar urgency-down) (defvar effort-up) (defvar effort-down) (defvar category-up) (defvar category-down) (defvar category-keep) (defvar tag-up) (defvar tag-down) (defvar todo-state-up) (defvar todo-state-down) (defvar habit-up) (defvar habit-down) (defvar alpha-up) (defvar alpha-down) (defvar need-user-cmp) (defvar user-defined-up) (defvar user-defined-down)) (let* ((timestamp-up (and (org-em 'timestamp-up 'timestamp-down ss) (org-cmp-ts a b ""))) (timestamp-down (if timestamp-up (- timestamp-up) nil)) (scheduled-up (and (org-em 'scheduled-up 'scheduled-down ss) (org-cmp-ts a b "scheduled"))) (scheduled-down (if scheduled-up (- scheduled-up) nil)) (deadline-up (and (org-em 'deadline-up 'deadline-down ss) (org-cmp-ts a b "deadline"))) (deadline-down (if deadline-up (- deadline-up) nil)) (tsia-up (and (org-em 'tsia-up 'tsia-down ss) (org-cmp-ts a b "timestamp_ia"))) (tsia-down (if tsia-up (- tsia-up) nil)) (ts-up (and (org-em 'ts-up 'ts-down ss) (org-cmp-ts a b "timestamp"))) (ts-down (if ts-up (- ts-up) nil)) (time-up (and (org-em 'time-up 'time-down ss) (org-cmp-time a b))) (time-down (if time-up (- time-up) nil)) (stats-up (and (org-em 'stats-up 'stats-down ss) (org-cmp-values a b 'org-stats))) (stats-down (if stats-up (- stats-up) nil)) (priority-up (and (org-em 'priority-up 'priority-down ss) (org-cmp-values a b 'priority))) (priority-down (if priority-up (- priority-up) nil)) (urgency-up (and (org-em 'urgency-up 'urgency-down ss) (org-cmp-values a b 'urgency))) (urgency-down (if urgency-up (- urgency-up) nil)) (effort-up (and (org-em 'effort-up 'effort-down ss) (org-cmp-effort a b))) (effort-down (if effort-up (- effort-up) nil)) (category-up (and (or (org-em 'category-up 'category-down ss) (memq 'category-keep ss)) (org-cmp-category a b))) (category-down (if category-up (- category-up) nil)) (category-keep (if category-up 1 nil)) (tag-up (and (org-em 'tag-up 'tag-down ss) (org-cmp-tag a b))) (tag-down (if tag-up (- tag-up) nil)) (todo-state-up (and (org-em 'todo-state-up 'todo-state-down ss) (org-cmp-todo-state a b))) (todo-state-down (if todo-state-up (- todo-state-up) nil)) (habit-up (and (org-em 'habit-up 'habit-down ss) (org-cmp-habit-p a b))) (habit-down (if habit-up (- habit-up) nil)) (alpha-up (and (org-em 'alpha-up 'alpha-down ss) (org-cmp-alpha a b))) (alpha-down (if alpha-up (- alpha-up) nil)) (need-user-cmp (org-em 'user-defined-up 'user-defined-down ss)) user-defined-up user-defined-down) (if (and need-user-cmp org-agenda-cmp-user-defined (functionp org-agenda-cmp-user-defined)) (progn (progn (setq user-defined-up (funcall org-agenda-cmp-user-defined a b)) (setq user-defined-down (if user-defined-up (- user-defined-up) nil))))) (cdr (assoc (eval (cons 'or org-agenda-sorting-strategy-selected) t) '((-1 . t) (1) (nil))))))
  (let ((ss org-agenda-sorting-strategy-selected)) (progn (with-no-warnings (defvar timestamp-up) (defvar timestamp-down) (defvar scheduled-up) (defvar scheduled-down) (defvar deadline-up) (defvar deadline-down) (defvar tsia-up) (defvar tsia-down) (defvar ts-up) (defvar ts-down) (defvar time-up) (defvar time-down) (defvar stats-up) (defvar stats-down) (defvar priority-up) (defvar priority-down) (defvar urgency-up) (defvar urgency-down) (defvar effort-up) (defvar effort-down) (defvar category-up) (defvar category-down) (defvar category-keep) (defvar tag-up) (defvar tag-down) (defvar todo-state-up) (defvar todo-state-down) (defvar habit-up) (defvar habit-down) (defvar alpha-up) (defvar alpha-down) (defvar need-user-cmp) (defvar user-defined-up) (defvar user-defined-down)) (let* ((timestamp-up (and (org-em 'timestamp-up 'timestamp-down ss) (org-cmp-ts a b ""))) (timestamp-down (if timestamp-up (- timestamp-up) nil)) (scheduled-up (and (org-em 'scheduled-up 'scheduled-down ss) (org-cmp-ts a b "scheduled"))) (scheduled-down (if scheduled-up (- scheduled-up) nil)) (deadline-up (and (org-em 'deadline-up 'deadline-down ss) (org-cmp-ts a b "deadline"))) (deadline-down (if deadline-up (- deadline-up) nil)) (tsia-up (and (org-em 'tsia-up 'tsia-down ss) (org-cmp-ts a b "timestamp_ia"))) (tsia-down (if tsia-up (- tsia-up) nil)) (ts-up (and (org-em 'ts-up 'ts-down ss) (org-cmp-ts a b "timestamp"))) (ts-down (if ts-up (- ts-up) nil)) (time-up (and (org-em 'time-up 'time-down ss) (org-cmp-time a b))) (time-down (if time-up (- time-up) nil)) (stats-up (and (org-em 'stats-up 'stats-down ss) (org-cmp-values a b 'org-stats))) (stats-down (if stats-up (- stats-up) nil)) (priority-up (and (org-em 'priority-up 'priority-down ss) (org-cmp-values a b 'priority))) (priority-down (if priority-up (- priority-up) nil)) (urgency-up (and (org-em 'urgency-up 'urgency-down ss) (org-cmp-values a b 'urgency))) (urgency-down (if urgency-up (- urgency-up) nil)) (effort-up (and (org-em 'effort-up 'effort-down ss) (org-cmp-effort a b))) (effort-down (if effort-up (- effort-up) nil)) (category-up (and (or (org-em ... ... ss) (memq ... ss)) (org-cmp-category a b))) (category-down (if category-up (- category-up) nil)) (category-keep (if category-up 1 nil)) (tag-up (and (org-em 'tag-up 'tag-down ss) (org-cmp-tag a b))) (tag-down (if tag-up (- tag-up) nil)) (todo-state-up (and (org-em 'todo-state-up 'todo-state-down ss) (org-cmp-todo-state a b))) (todo-state-down (if todo-state-up (- todo-state-up) nil)) (habit-up (and (org-em 'habit-up 'habit-down ss) (org-cmp-habit-p a b))) (habit-down (if habit-up (- habit-up) nil)) (alpha-up (and (org-em 'alpha-up 'alpha-down ss) (org-cmp-alpha a b))) (alpha-down (if alpha-up (- alpha-up) nil)) (need-user-cmp (org-em 'user-defined-up 'user-defined-down ss)) user-defined-up user-defined-down) (if (and need-user-cmp org-agenda-cmp-user-defined (functionp org-agenda-cmp-user-defined)) (progn (progn (setq user-defined-up (funcall org-agenda-cmp-user-defined a b)) (setq user-defined-down (if user-defined-up ... nil))))) (cdr (assoc (eval (cons 'or org-agenda-sorting-strategy-selected) t) '((-1 . t) (1) (nil)))))))
  (closure (diary-display-function diary-file-name-prefix diary-modify-entry-list-string-function diary-time-regexp diary-list-entries-hook crm-separator org-agenda-show-log-scoped org-depend-tag-blocked org-local-columns-format org-mobile-creating-agendas org-agenda-multi org-agenda-menu original-date org-agenda-overriding-header org-habit-scheduled-past-days org-habit-show-all-today org-habit-show-habits-only-for-today org-habit-show-habits org-mobile-force-id-on-agenda-items org-clock-current-task t) (a b) "Predicate for sorting agenda entries." (let ((ss org-agenda-sorting-strategy-selected)) (progn (with-no-warnings (defvar timestamp-up) (defvar timestamp-down) (defvar scheduled-up) (defvar scheduled-down) (defvar deadline-up) (defvar deadline-down) (defvar tsia-up) (defvar tsia-down) (defvar ts-up) (defvar ts-down) (defvar time-up) (defvar time-down) (defvar stats-up) (defvar stats-down) (defvar priority-up) (defvar priority-down) (defvar urgency-up) (defvar urgency-down) (defvar effort-up) (defvar effort-down) (defvar category-up) (defvar category-down) (defvar category-keep) (defvar tag-up) (defvar tag-down) (defvar todo-state-up) (defvar todo-state-down) (defvar habit-up) (defvar habit-down) (defvar alpha-up) (defvar alpha-down) (defvar need-user-cmp) (defvar user-defined-up) (defvar user-defined-down)) (let* ((timestamp-up ...) (timestamp-down ...) (scheduled-up ...) (scheduled-down ...) (deadline-up ...) (deadline-down ...) (tsia-up ...) (tsia-down ...) (ts-up ...) (ts-down ...) (time-up ...) (time-down ...) (stats-up ...) (stats-down ...) (priority-up ...) (priority-down ...) (urgency-up ...) (urgency-down ...) (effort-up ...) (effort-down ...) (category-up ...) (category-down ...) (category-keep ...) (tag-up ...) (tag-down ...) (todo-state-up ...) (todo-state-down ...) (habit-up ...) (habit-down ...) (alpha-up ...) (alpha-down ...) (need-user-cmp ...) user-defined-up user-defined-down) (if (and need-user-cmp org-agenda-cmp-user-defined ...) (progn ...)) (cdr (assoc ... ...))))))(#("  NEXT Enviar a regime..." 0 2 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...) 2 6 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...) 6 61 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...) 61 69 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 872 in actionable.org> org-marker #<marker at 872 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...)) #("  NEXT Hacer carta sob..." 0 2 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...) 2 6 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...) 6 73 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...) 73 81 (org-habit-p nil todo-state ... org-agenda-type search org-hd-marker #<marker at 712 in actionable.org> org-marker #<marker at 712 in actionable.org> commentedp ... archivedp ... footnote-section-p ... todo-type ... todo-keyword ... tags ... ...)))
  sort((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) org-entries-lessp)
  (mapcar #'identity (sort list #'org-entries-lessp))
  (setq list (mapcar #'identity (sort list #'org-entries-lessp)))
  (progn (setq list (mapcar #'org-agenda-highlight-todo list)) (setq list (mapcar #'identity (sort list #'org-entries-lessp))))
  (let ((max-effort (cond ((listp org-agenda-max-effort) (cdr (assoc type org-agenda-max-effort))) (t org-agenda-max-effort))) (max-todo (cond ((listp org-agenda-max-todos) (cdr (assoc type org-agenda-max-todos))) (t org-agenda-max-todos))) (max-tags (cond ((listp org-agenda-max-tags) (cdr (assoc type org-agenda-max-tags))) (t org-agenda-max-tags))) (max-entries (cond ((listp org-agenda-max-entries) (cdr (assoc type org-agenda-max-entries))) (t org-agenda-max-entries)))) (if org-agenda-before-sorting-filter-function (progn (setq list (delq nil (mapcar org-agenda-before-sorting-filter-function list))))) (progn (setq list (mapcar #'org-agenda-highlight-todo list)) (setq list (mapcar #'identity (sort list #'org-entries-lessp)))) (if max-effort (progn (setq list (org-agenda-limit-entries list 'effort-minutes max-effort #'(lambda (e) (or e ...)))))) (if max-todo (progn (setq list (org-agenda-limit-entries list 'todo-state max-todo)))) (if max-tags (progn (setq list (org-agenda-limit-entries list 'tags max-tags)))) (if max-entries (progn (setq list (org-agenda-limit-entries list 'org-hd-marker max-entries)))) (if (and org-agenda-dim-blocked-tasks org-blocker-hook) (progn (setq list (mapcar #'org-agenda--mark-blocked-entry list)))) (mapconcat #'identity list "\n"))
  (closure (diary-display-function diary-file-name-prefix diary-modify-entry-list-string-function diary-time-regexp diary-list-entries-hook crm-separator org-agenda-show-log-scoped org-depend-tag-blocked org-local-columns-format org-mobile-creating-agendas org-agenda-multi org-agenda-menu original-date org-agenda-overriding-header org-habit-scheduled-past-days org-habit-show-all-today org-habit-show-habits-only-for-today org-habit-show-habits org-mobile-force-id-on-agenda-items org-clock-current-task t) (list &optional type) "Sort, limit and concatenate the LIST of agenda ite..." (let ((max-effort (cond ((listp org-agenda-max-effort) (cdr ...)) (t org-agenda-max-effort))) (max-todo (cond ((listp org-agenda-max-todos) (cdr ...)) (t org-agenda-max-todos))) (max-tags (cond ((listp org-agenda-max-tags) (cdr ...)) (t org-agenda-max-tags))) (max-entries (cond ((listp org-agenda-max-entries) (cdr ...)) (t org-agenda-max-entries)))) (if org-agenda-before-sorting-filter-function (progn (setq list (delq nil (mapcar org-agenda-before-sorting-filter-function list))))) (progn (setq list (mapcar #'org-agenda-highlight-todo list)) (setq list (mapcar #'identity (sort list #'org-entries-lessp)))) (if max-effort (progn (setq list (org-agenda-limit-entries list 'effort-minutes max-effort #'...)))) (if max-todo (progn (setq list (org-agenda-limit-entries list 'todo-state max-todo)))) (if max-tags (progn (setq list (org-agenda-limit-entries list 'tags max-tags)))) (if max-entries (progn (setq list (org-agenda-limit-entries list 'org-hd-marker max-entries)))) (if (and org-agenda-dim-blocked-tasks org-blocker-hook) (progn (setq list (mapcar #'org-agenda--mark-blocked-entry list)))) (mapconcat #'identity list "\n")))((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
  apply((closure ... ... "Sort, limit an..." ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
  org-agenda-finalize-entries((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
  (insert (org-agenda-finalize-entries (-map #'org-ql-view--format-element items)))
  (progn (if narrow-p (progn (save-current-buffer (set-buffer from) (narrow-to-region old-beg old-end)))) (org-agenda-prepare) (insert (org-add-props (or org-ql-block-header (org-ql-view--header-line-format :buffers-files from :query query)) nil 'face 'org-agenda-structure) "\n") (insert (org-agenda-finalize-entries (-map #'org-ql-view--format-element items))) (insert "\n"))
  (if items (progn (if narrow-p (progn (save-current-buffer (set-buffer from) (narrow-to-region old-beg old-end)))) (org-agenda-prepare) (insert (org-add-props (or org-ql-block-header (org-ql-view--header-line-format :buffers-files from :query query)) nil 'face 'org-agenda-structure) "\n") (insert (org-agenda-finalize-entries (-map #'org-ql-view--format-element items))) (insert "\n")))
  (let* ((from (and t (if (null org-agenda-restrict) (let nil (org-agenda-files nil 'ifmode)) (let nil (prog1 org-agenda-restrict (save-current-buffer ... ... ...)))))) (items (and from (org-ql-select from query :action 'element-with-markers :narrow narrow-p)))) (if items (progn (if narrow-p (progn (save-current-buffer (set-buffer from) (narrow-to-region old-beg old-end)))) (org-agenda-prepare) (insert (org-add-props (or org-ql-block-header (org-ql-view--header-line-format :buffers-files from :query query)) nil 'face 'org-agenda-structure) "\n") (insert (org-agenda-finalize-entries (-map #'org-ql-view--format-element items))) (insert "\n"))))
  (let (narrow-p old-beg old-end) (let* ((from (and t (if (null org-agenda-restrict) (let nil (org-agenda-files nil ...)) (let nil (prog1 org-agenda-restrict ...))))) (items (and from (org-ql-select from query :action 'element-with-markers :narrow narrow-p)))) (if items (progn (if narrow-p (progn (save-current-buffer (set-buffer from) (narrow-to-region old-beg old-end)))) (org-agenda-prepare) (insert (org-add-props (or org-ql-block-header (org-ql-view--header-line-format :buffers-files from :query query)) nil 'face 'org-agenda-structure) "\n") (insert (org-agenda-finalize-entries (-map #'org-ql-view--format-element items))) (insert "\n")))))
  org-ql-block((todo "NEXT"))
  funcall(org-ql-block (todo "NEXT"))
  (let nil (funcall type match))
  (cond ((eq type 'agenda) (let nil (call-interactively 'org-agenda-list))) ((eq type 'agenda*) (let nil (funcall 'org-agenda-list nil nil nil t))) ((eq type 'alltodo) (let nil (call-interactively 'org-todo-list))) ((eq type 'search) (let nil (org-search-view current-prefix-arg match nil))) ((eq type 'stuck) (let nil (call-interactively 'org-agenda-list-stuck-projects))) ((eq type 'tags) (let nil (org-tags-view current-prefix-arg match))) ((eq type 'tags-todo) (let nil (org-tags-view '(4) match))) ((eq type 'todo) (let nil (org-todo-list match))) ((fboundp type) (let nil (funcall type match))) (t (let nil (error "Invalid type in command series"))))
  (closure ((type . org-ql-block)) nil (cond ((eq type 'agenda) (let nil (call-interactively 'org-agenda-list))) ((eq type 'agenda*) (let nil (funcall 'org-agenda-list nil nil nil t))) ((eq type 'alltodo) (let nil (call-interactively 'org-todo-list))) ((eq type 'search) (let nil (org-search-view current-prefix-arg match nil))) ((eq type 'stuck) (let nil (call-interactively 'org-agenda-list-stuck-projects))) ((eq type 'tags) (let nil (org-tags-view current-prefix-arg match))) ((eq type 'tags-todo) (let nil (org-tags-view '(4) match))) ((eq type 'todo) (let nil (org-todo-list match))) ((fboundp type) (let nil (funcall type match))) (t (let nil (error "Invalid type in command series")))))()
  funcall((closure ((type . org-ql-block)) nil (cond ((eq type 'agenda) (let nil (call-interactively 'org-agenda-list))) ((eq type 'agenda*) (let nil (funcall 'org-agenda-list nil nil nil t))) ((eq type 'alltodo) (let nil (call-interactively 'org-todo-list))) ((eq type 'search) (let nil (org-search-view current-prefix-arg match nil))) ((eq type 'stuck) (let nil (call-interactively 'org-agenda-list-stuck-projects))) ((eq type 'tags) (let nil (org-tags-view current-prefix-arg match))) ((eq type 'tags-todo) (let nil (org-tags-view '(4) match))) ((eq type 'todo) (let nil (org-todo-list match))) ((fboundp type) (let nil (funcall type match))) (t (let nil (error "Invalid type in command series"))))))
  (let ((org-ql-block-header '#("NEXT ACTIONS" 0 12 (face org-agenda-structure))) (org-super-agenda-groups '((:auto-planning t) (:auto-tags t)))) (funcall '(closure ((type . org-ql-block)) nil (cond ((eq type 'agenda) (let nil (call-interactively ...))) ((eq type 'agenda*) (let nil (funcall ... nil nil nil t))) ((eq type 'alltodo) (let nil (call-interactively ...))) ((eq type 'search) (let nil (org-search-view current-prefix-arg match nil))) ((eq type 'stuck) (let nil (call-interactively ...))) ((eq type 'tags) (let nil (org-tags-view current-prefix-arg match))) ((eq type 'tags-todo) (let nil (org-tags-view ... match))) ((eq type 'todo) (let nil (org-todo-list match))) ((fboundp type) (let nil (funcall type match))) (t (let nil (error "Invalid type in command series")))))))
  eval((let ((org-ql-block-header '#("NEXT ACTIONS" 0 12 (face org-agenda-structure))) (org-super-agenda-groups '((:auto-planning t) (:auto-tags t)))) (funcall '(closure ((type . org-ql-block)) nil (cond ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((fboundp type) (let nil ...)) (t (let nil ...)))))))
  (let* ((syms (append gvars lvars)) (vals (append gvals lvals)) (body #'(lambda nil (cond ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((eq type ...) (let nil ...)) ((fboundp type) (let nil ...)) (t (let nil ...))))) (binds nil)) (while syms (setq binds (cons (list (car-safe (prog1 syms (setq syms ...))) (list 'quote (car-safe (prog1 vals ...)))) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list 'quote body)))))
  (progn (let* ((syms (append gvars lvars)) (vals (append gvals lvals)) (body #'(lambda nil (cond (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (t ...)))) (binds nil)) (while syms (setq binds (cons (list (car-safe (prog1 syms ...)) (list 'quote (car-safe ...))) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list 'quote body))))))
  (let ((org-agenda-overriding-arguments (if (eq org-agenda-overriding-cmd org-cmd) (or org-agenda-overriding-arguments org-agenda-overriding-cmd-arguments))) (lvars (mapcar #'car lprops)) (lvals (mapcar #'(lambda (binding) (eval (car ...) t)) lprops))) (progn (let* ((syms (append gvars lvars)) (vals (append gvals lvals)) (body #'(lambda nil (cond ... ... ... ... ... ... ... ... ... ...))) (binds nil)) (while syms (setq binds (cons (list (car-safe ...) (list ... ...)) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list 'quote body)))))))
  (while (setq org-cmd (car-safe (prog1 cmds (setq cmds (cdr cmds))))) (setq type (car org-cmd)) (setq match (eval (nth 1 org-cmd) t)) (setq lprops (nth 2 org-cmd)) (let ((org-agenda-overriding-arguments (if (eq org-agenda-overriding-cmd org-cmd) (or org-agenda-overriding-arguments org-agenda-overriding-cmd-arguments))) (lvars (mapcar #'car lprops)) (lvals (mapcar #'(lambda (binding) (eval ... t)) lprops))) (progn (let* ((syms (append gvars lvars)) (vals (append gvals lvals)) (body #'(lambda nil ...)) (binds nil)) (while syms (setq binds (cons (list ... ...) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list ... body))))))))
  (let* ((org-agenda-multi t) (redo (list 'org-agenda-run-series name (list 'quote series))) (cmds (car series)) match org-cmd type lprops) (while (setq org-cmd (car-safe (prog1 cmds (setq cmds (cdr cmds))))) (setq type (car org-cmd)) (setq match (eval (nth 1 org-cmd) t)) (setq lprops (nth 2 org-cmd)) (let ((org-agenda-overriding-arguments (if (eq org-agenda-overriding-cmd org-cmd) (or org-agenda-overriding-arguments org-agenda-overriding-cmd-arguments))) (lvars (mapcar #'car lprops)) (lvals (mapcar #'(lambda ... ...) lprops))) (progn (let* ((syms (append gvars lvars)) (vals (append gvals lvals)) (body #'...) (binds nil)) (while syms (setq binds (cons ... binds))) (eval (list 'let (nreverse binds) (list ... ...))))))) (widen) (let ((inhibit-read-only t)) (add-text-properties (point-min) (point-max) (list 'org-series t 'org-series-redo-cmd redo))) (setq org-agenda-redo-command redo) (goto-char (point-min)))
  (let* ((gprops (nth 1 series)) (gvars (mapcar #'car gprops)) (gvals (mapcar #'(lambda (binding) (eval (car ...) t)) gprops))) (progn (let* ((syms gvars) (vals gvals) (body #'(lambda nil (org-agenda-prepare name))) (binds nil)) (while syms (setq binds (cons (list (car-safe ...) (list ... ...)) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list 'quote body)))))) (org-agenda-reset-markers) (with-no-warnings (defvar match)) (let* ((org-agenda-multi t) (redo (list 'org-agenda-run-series name (list 'quote series))) (cmds (car series)) match org-cmd type lprops) (while (setq org-cmd (car-safe (prog1 cmds (setq cmds (cdr cmds))))) (setq type (car org-cmd)) (setq match (eval (nth 1 org-cmd) t)) (setq lprops (nth 2 org-cmd)) (let ((org-agenda-overriding-arguments (if (eq org-agenda-overriding-cmd org-cmd) (or org-agenda-overriding-arguments org-agenda-overriding-cmd-arguments))) (lvars (mapcar #'car lprops)) (lvals (mapcar #'... lprops))) (progn (let* ((syms ...) (vals ...) (body ...) (binds nil)) (while syms (setq binds ...)) (eval (list ... ... ...)))))) (widen) (let ((inhibit-read-only t)) (add-text-properties (point-min) (point-max) (list 'org-series t 'org-series-redo-cmd redo))) (setq org-agenda-redo-command redo) (goto-char (point-min))) (org-agenda-fit-window-to-buffer) (progn (let* ((syms gvars) (vals gvals) (body #'(lambda nil (org-agenda-finalize))) (binds nil)) (while syms (setq binds (cons (list (car-safe ...) (list ... ...)) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list 'quote body)))))))
  org-agenda-run-series("scheduled today and all next items" (((agenda "" ((org-agenda-span 'day) (org-agenda-start-on-weekday 1) (org-habit-graph-column 1) (org-habit-preceding-days 5) (org-habit-following-days 5) (org-habit-show-habits-only-for-today nil) (org-habit-show-all-today nil) (org-habit-show-done-always-green t) (org-deadline-warning-days 10) (org-agenda-start-day nil) (org-agenda-show-log t) (org-agenda-sorting-strategy '(... ... ... ...)) (org-super-agenda-groups '(...)))) (org-ql-block '(todo "DOING") ((org-ql-block-header #("MUST FINISH NOW" 0 15 (face org-agenda-structure))) (org-super-agenda-groups '(...)))) (org-ql-block '(todo "NEXT") ((org-ql-block-header #("NEXT ACTIONS" 0 12 (face org-agenda-structure))) (org-super-agenda-groups '(... ...)))) (org-ql-block '(and (or (property "ORG_GTD" "Projects") (property "ORG_GTD" "Actions")) (todo "WAIT")) ((org-ql-block-header #("WAIT ITEMS" 0 10 (face org-agenda-structure))) (org-use-property-inheritance t))))))
  (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn (progn (setq type (nth 2 entry)) (setq org-match (eval (nth 3 entry) t)) (setq lprops (nth 4 entry))) (if org-agenda-sticky (progn (setq org-agenda-buffer-name (or (and (stringp org-match) (format "*Org Agenda(%s:%s)*" org-keys org-match)) (format "*Org Agenda(%s)*" org-keys))))) (progn (let* ((syms (mapcar #'car lprops)) (vals (mapcar #'... lprops)) (body #'(lambda nil ...)) (binds nil)) (while syms (setq binds (cons (list ... ...) binds))) (eval (list 'let (nreverse binds) (list 'funcall (list ... body)))))) (let ((inhibit-read-only t)) (add-text-properties (point-min) (point-max) (list 'org-lprops lprops)))) (org-agenda-run-series (nth 1 entry) (cdr (cdr entry))))
  (cond ((setq entry (assoc org-keys org-agenda-custom-commands)) (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn (progn (setq type (nth 2 entry)) (setq org-match (eval (nth 3 entry) t)) (setq lprops (nth 4 entry))) (if org-agenda-sticky (progn (setq org-agenda-buffer-name (or ... ...)))) (progn (let* ((syms ...) (vals ...) (body ...) (binds nil)) (while syms (setq binds ...)) (eval (list ... ... ...)))) (let ((inhibit-read-only t)) (add-text-properties (point-min) (point-max) (list 'org-lprops lprops)))) (org-agenda-run-series (nth 1 entry) (cdr (cdr entry))))) ((equal org-keys "C") (setq org-agenda-custom-commands org-agenda-custom-commands-orig) (customize-variable 'org-agenda-custom-commands)) ((equal org-keys "a") (call-interactively 'org-agenda-list)) ((equal org-keys "s") (call-interactively 'org-search-view)) ((equal org-keys "S") (org-call-with-arg 'org-search-view (or arg '(4)))) ((equal org-keys "t") (call-interactively 'org-todo-list)) ((equal org-keys "T") (org-call-with-arg 'org-todo-list (or arg '(4)))) ((equal org-keys "m") (call-interactively 'org-tags-view)) ((equal org-keys "M") (org-call-with-arg 'org-tags-view (or arg '(4)))) ((equal org-keys "e") (call-interactively 'org-store-agenda-views)) ((equal org-keys "?") (org-tags-view nil "+FLAGGED") (add-hook 'post-command-hook #'(lambda nil (if (current-message) nil (let* (... ...) (if note ...)))) t t)) ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) ((equal org-keys "!") (customize-variable 'org-stuck-projects)) (t (user-error "Invalid agenda key")))
  (let* ((org-keys keys) (prefix-descriptions nil) (org-agenda-buffer-name org-agenda-buffer-name) (org-agenda-window-setup (if (equal (buffer-name) org-agenda-buffer-name) 'current-window org-agenda-window-setup)) (org-agenda-custom-commands-orig org-agenda-custom-commands) (org-agenda-custom-commands (delq nil (mapcar #'(lambda (x) (cond ... ... ... ...)) org-agenda-custom-commands))) (org-agenda-custom-commands (org-contextualize-keys org-agenda-custom-commands org-agenda-custom-commands-contexts)) (bfn (buffer-file-name (buffer-base-buffer))) entry type org-match lprops ans) (if org-agenda-overriding-restriction nil (if org-agenda-keep-restricted-file-list nil (put 'org-agenda-files 'org-restrict nil)) (setq org-agenda-restrict nil) (move-marker org-agenda-restrict-begin nil) (move-marker org-agenda-restrict-end nil)) (if org-keys nil (progn (setq ans (org-agenda-get-restriction-and-command prefix-descriptions)) (setq org-keys (car ans)) (setq restriction (cdr ans)))) (if org-agenda-sticky (progn (setq org-agenda-buffer-name (format "*Org Agenda(%s)*" org-keys)))) (if (and (not org-agenda-overriding-restriction) restriction) (progn (put 'org-agenda-files 'org-restrict (list bfn)) (cond ((eq restriction 'region) (setq org-agenda-restrict (current-buffer)) (move-marker org-agenda-restrict-begin (region-beginning)) (move-marker org-agenda-restrict-end (region-end))) ((eq restriction 'subtree) (save-excursion (setq org-agenda-restrict (current-buffer)) (org-back-to-heading t) (move-marker org-agenda-restrict-begin (point)) (move-marker org-agenda-restrict-end (progn ...)))) ((eq restriction 'buffer) (if (not (buffer-narrowed-p)) (setq org-agenda-restrict t) (setq org-agenda-restrict (current-buffer)) (move-marker org-agenda-restrict-begin (point-min)) (move-marker org-agenda-restrict-end (point-max))))))) (cond ((setq entry (assoc org-keys org-agenda-custom-commands)) (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn (progn (setq type (nth 2 entry)) (setq org-match (eval ... t)) (setq lprops (nth 4 entry))) (if org-agenda-sticky (progn (setq org-agenda-buffer-name ...))) (progn (let* (... ... ... ...) (while syms ...) (eval ...))) (let ((inhibit-read-only t)) (add-text-properties (point-min) (point-max) (list ... lprops)))) (org-agenda-run-series (nth 1 entry) (cdr (cdr entry))))) ((equal org-keys "C") (setq org-agenda-custom-commands org-agenda-custom-commands-orig) (customize-variable 'org-agenda-custom-commands)) ((equal org-keys "a") (call-interactively 'org-agenda-list)) ((equal org-keys "s") (call-interactively 'org-search-view)) ((equal org-keys "S") (org-call-with-arg 'org-search-view (or arg '(4)))) ((equal org-keys "t") (call-interactively 'org-todo-list)) ((equal org-keys "T") (org-call-with-arg 'org-todo-list (or arg '(4)))) ((equal org-keys "m") (call-interactively 'org-tags-view)) ((equal org-keys "M") (org-call-with-arg 'org-tags-view (or arg '(4)))) ((equal org-keys "e") (call-interactively 'org-store-agenda-views)) ((equal org-keys "?") (org-tags-view nil "+FLAGGED") (add-hook 'post-command-hook #'(lambda nil (if (current-message) nil (let* ... ...))) t t)) ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) ((equal org-keys "!") (customize-variable 'org-stuck-projects)) (t (user-error "Invalid agenda key"))))
  (catch 'exit (let* ((org-keys keys) (prefix-descriptions nil) (org-agenda-buffer-name org-agenda-buffer-name) (org-agenda-window-setup (if (equal (buffer-name) org-agenda-buffer-name) 'current-window org-agenda-window-setup)) (org-agenda-custom-commands-orig org-agenda-custom-commands) (org-agenda-custom-commands (delq nil (mapcar #'(lambda ... ...) org-agenda-custom-commands))) (org-agenda-custom-commands (org-contextualize-keys org-agenda-custom-commands org-agenda-custom-commands-contexts)) (bfn (buffer-file-name (buffer-base-buffer))) entry type org-match lprops ans) (if org-agenda-overriding-restriction nil (if org-agenda-keep-restricted-file-list nil (put 'org-agenda-files 'org-restrict nil)) (setq org-agenda-restrict nil) (move-marker org-agenda-restrict-begin nil) (move-marker org-agenda-restrict-end nil)) (if org-keys nil (progn (setq ans (org-agenda-get-restriction-and-command prefix-descriptions)) (setq org-keys (car ans)) (setq restriction (cdr ans)))) (if org-agenda-sticky (progn (setq org-agenda-buffer-name (format "*Org Agenda(%s)*" org-keys)))) (if (and (not org-agenda-overriding-restriction) restriction) (progn (put 'org-agenda-files 'org-restrict (list bfn)) (cond ((eq restriction 'region) (setq org-agenda-restrict (current-buffer)) (move-marker org-agenda-restrict-begin (region-beginning)) (move-marker org-agenda-restrict-end (region-end))) ((eq restriction 'subtree) (save-excursion (setq org-agenda-restrict ...) (org-back-to-heading t) (move-marker org-agenda-restrict-begin ...) (move-marker org-agenda-restrict-end ...))) ((eq restriction 'buffer) (if (not ...) (setq org-agenda-restrict t) (setq org-agenda-restrict ...) (move-marker org-agenda-restrict-begin ...) (move-marker org-agenda-restrict-end ...)))))) (cond ((setq entry (assoc org-keys org-agenda-custom-commands)) (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn (progn (setq type ...) (setq org-match ...) (setq lprops ...)) (if org-agenda-sticky (progn ...)) (progn (let* ... ... ...)) (let (...) (add-text-properties ... ... ...))) (org-agenda-run-series (nth 1 entry) (cdr (cdr entry))))) ((equal org-keys "C") (setq org-agenda-custom-commands org-agenda-custom-commands-orig) (customize-variable 'org-agenda-custom-commands)) ((equal org-keys "a") (call-interactively 'org-agenda-list)) ((equal org-keys "s") (call-interactively 'org-search-view)) ((equal org-keys "S") (org-call-with-arg 'org-search-view (or arg '(4)))) ((equal org-keys "t") (call-interactively 'org-todo-list)) ((equal org-keys "T") (org-call-with-arg 'org-todo-list (or arg '(4)))) ((equal org-keys "m") (call-interactively 'org-tags-view)) ((equal org-keys "M") (org-call-with-arg 'org-tags-view (or arg '(4)))) ((equal org-keys "e") (call-interactively 'org-store-agenda-views)) ((equal org-keys "?") (org-tags-view nil "+FLAGGED") (add-hook 'post-command-hook #'(lambda nil (if ... nil ...)) t t)) ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) ((equal org-keys "!") (customize-variable 'org-stuck-projects)) (t (user-error "Invalid agenda key")))))
  org-agenda(nil "g")
  (let ((org-agenda-custom-commands '(("g" "scheduled today and all next items" ((agenda "" ...) (org-ql-block ... ...) (org-ql-block ... ...) (org-ql-block ... ...)))))) (org-agenda nil "g") (goto-char (point-min)))
  (progn (advice-add 'org-agenda-files :filter-return #'org-gtd-core--uniq) (let ((org-agenda-custom-commands '(("g" "scheduled today and all next items" (... ... ... ...))))) (org-agenda nil "g") (goto-char (point-min))))
  (unwind-protect (progn (advice-add 'org-agenda-files :filter-return #'org-gtd-core--uniq) (let ((org-agenda-custom-commands '(("g" "scheduled today and all next items" ...)))) (org-agenda nil "g") (goto-char (point-min)))) (progn (advice-remove 'org-agenda-files #'org-gtd-core--uniq)))
  (let* ((org-use-property-inheritance "ORG_GTD") (org-todo-keywords (list (list 'sequence (string-join (list org-gtd-next org-gtd-next-suffix)) (string-join (list org-gtd-todo org-gtd-todo-suffix)) (string-join (list org-gtd-wait org-gtd-wait-suffix)) "|" (string-join (list org-gtd-done org-gtd-done-suffix)) (string-join (list org-gtd-canceled org-gtd-canceled-suffix))))) (org-archive-location (funcall org-gtd-archive-location)) (org-stuck-projects org-gtd-stuck-projects) (org-odd-levels-only nil) (org-agenda-files (org-gtd-core--agenda-files)) (org-agenda-property-list (list org-gtd-delegate-property))) (unwind-protect (progn (advice-add 'org-agenda-files :filter-return #'org-gtd-core--uniq) (let ((org-agenda-custom-commands '(...))) (org-agenda nil "g") (goto-char (point-min)))) (progn (advice-remove 'org-agenda-files #'org-gtd-core--uniq))))
  my/org-gtd-engage()
  apply(my/org-gtd-engage nil)
  org-gtd-engage()
  funcall-interactively(org-gtd-engage)
  command-execute(org-gtd-engage)

The relevant part in the org-agenda-custom-commands is this:

                   (org-ql-block '(todo "DOING")
                                 ((org-ql-block-header "MUST FINISH NOW")
                                  (org-super-agenda-groups
                                   '((:name ""
                                      :todo "DOING"
                                      :face (:inverse-video t))))
                                  ))
                   (org-ql-block '(todo "NEXT")
                                 ((org-ql-block-header "NEXT ACTIONS")
                                  (org-super-agenda-groups
                                   '((:auto-planning t)
                                     (:auto-tags t)))))
                   (org-ql-block '(and (or (property "ORG_GTD" "Projects")
                                           (property "ORG_GTD" "Actions"))
                                       (todo "WAIT"))
                                 ((org-ql-block-header "WAIT ITEMS")
                                  (org-use-property-inheritance t)
                                  ))

The weird thing is that after calling the org-agenda command three or more times, it looks exactly the way it should.

Versions:

  • org-super-agenda: 1.3-pre
  • org-ql: 0.7.1-pre

Best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants