3

I am trying to define a custom agenda view that includes two agenda commands:

  • The first will list all unscheduled tasks with tag A (using standard view).
  • The second will list all scheduled tasks with tag A (using column view, one column of which is the SCHEDULED timestamp).

The following code (code v1) works but does not include column view for the second agenda command:

(setq org-agenda-custom-commands
  '(("c" "My Custom View"
    ((tags-todo "TAGA"
        ((org-agenda-overriding-header "Unscheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))
     (tags-todo "TAGA"
        ((org-agenda-overriding-header "Scheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled))))
 ))))

I am trying to implement org-agenda-view-columns-initially in the second agenda command (code v2):

(setq org-agenda-custom-commands
  '(("c" "My Custom View"
    ((tags-todo "TAGA"
        ((org-agenda-overriding-header "Unscheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))
     (tags-todo "TAGA"
        ((org-agenda-overriding-header "Scheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled))
         (org-agenda-overriding-columns-format "%TODO %ITEM %SCHEDULED")
         (org-agenda-view-columns-initially t)))
 ))))

When I evaluate code v2 and then open the custom agenda view, I get the same result as code v1. However, when applied to a single, simple command as described on worg and by Carsten Dominik on the mailing list, the result is as desired. I am also able to get column view for both scheduled and unscheduled results using code v1 and C-c C-x C-c (org-columns) but this is not my ideal outcome (I only want column view for the scheduled tasks).

Is this incorrect implementation on my part, or a limitation of org-agenda-view-columns-initially? Thanks in advance.

2
  • A non-nil org-agenda-view-columns-initially will call org-agenda-columns, which unfortunately does not narrow to a region like org-columns does. So, if I'm not mistaken, the columnview applies to the whole agenda buffer, unless you rewrite the function.
    – mutbuerger
    Jul 20, 2016 at 15:54
  • Thanks @mutbuerger. I was hoping it would behave like org-columns.
    – student
    Jul 23, 2016 at 22:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.