0

My current org-agenda-prefix-format looks like this:

(setq org-agenda-prefix-format
      '((agenda . "%?-2 i%12:c  %?-12 t%?12 s  ")
        (todo .   "%?-2 i%-12:c")
        (tags .   "%?-2 i%-12:c")
        (search . "%?-2 i%-12:c")))

This shows the entries in my agenda like this:

                08:20 ╌╌╌╌╌   ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
   work-notes:  08:30-09:00   Something important
                08:40 ╌╌╌╌╌   ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
      hide-me:  09:00-13:00   I will see this every day
                09:20 ╌╌╌╌╌   ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

There is a particular file in my org-agenda-files list, let's say hide-me.org, for which I would like not to see any information about its category (what is at the left of the time column). It should look like this:


                08:20 ╌╌╌╌╌   ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
   work-notes:  08:30-09:00   Something important
                08:40 ╌╌╌╌╌   ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
                09:00-13:00   I will see this every day
                09:20 ╌╌╌╌╌   ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Basically, I would like %c not to default to the filename if some condition is met, ideally some property I could set in the org-file itself. Is there any way of doing so? I am getting started with org-agenda, and elisp in general, so if the answer involves some code, I would appreciate a step by step explanation so I could learn.

  • I thought on leaving the :CATEGORY: property of the file empty, but it still defaults to the filename
:PROPERTIES:
:CATEGORY:
:END:
  • I thought about using (if test then else) in the org-agenda-prefix-format variable, but it seems not to make much sense, due to that being a simple string, so I have no way to get the filename to decide on it.

  • Also checked turn-off visibility of category, but that seems to be an "all-or-nothing" approach.

1 Answer 1

1

The simplest thing I think is to add an empty #+CATEGORY: definition in the file(s) whose category you want to ignore:

#+CATEGORY:

* TODO bar1
SCHEDULED: <2022-03-27>

would produce an agenda like this:

Sunday     27 March 2022
        foo:  Scheduled:    TODO foo1
              Scheduled:    TODO bar1
1
  • wow, that was in front of my nose... thanks a lot
    – onlycparra
    Mar 28 at 1:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.