0

I've more .org files inserted on my init.el file at proper section. but when I press C-c a to show any type of agenda, all the TODO Item are showed at the proper day and time. Just the TODO Item stored in an .org file does not show on agenda. I've already done some proof (made another file, erased ad rewrite the entire TODO entry)

What can it be happen?

TIA Renato

0

1 Answer 1

3

You can have Org files anywhere in your filesystem, but only the files appearing in org-agenda-files contribute to the agenda. Do C-h v org-agenda-files to read about this variable and how to set it and read the Agenda files section in the manual for more information.

One common way to do that is to put all of the agenda-contributing files (and only those) in one directory and then set org-agenda-files appropriately to pick them up by adding this to your init file (change the path according to your circumstances):

(setq org-agenda-files '("/path/to/agenda/files/folder"))

Then every file in the named directory whose name matches a regular expression is added to the agenda files list/. By default, the regular expression matches files with a .org suffix, so if you name your Org mode files that way, you don't need to worry about it.

In addition, in order to appear in the agenda, an item has to have a timestamp (actually, an active timestamp - items with inactive timestamps are not shown in the agenda). Only items whose timestamps fall within the time span of the agenda are shown.

Here is an example file:

* a plain, active timestamp
  <2022-10-05>

* a plain, inactive timestamp
  [2022-10-05]

* a scheduled item
  SCHEDULED: <2022-10-06>

* a deadline item
  DEADLINE: <2022-10-05 Wed>

You can temporarily add the file to your agenda with C-c [ and then do C-c a a to show the weekly agenda (assuming you have followed the conventional wisdom in the manual, binding C-c a to org-agenda and that you have not changed the default weekly time span). All of the above items will show in the agenda, except for the inactive timestamp one. But if you do C-c a next week, none of them will show since their timestamps will not intersect the time span of the future agenda.

You can remove the file from org-agenda-files with C-c ]. C-c [ and C-c ] are useful for testing, so that you can temporarily add a file the org-agenda-files list and then remove it, but in order to add a file to org-agenda-files permanently, you must initialize the variable properly in your init file.


These are very basic questions that could be best answered by working diligently through an Org mode tutorial, e.g. this one or this one. Also the Org mode Wiki has a Tutorials section with more in-depth coverage.

4
  • to try to understand what's going on, I've created a new folder (under the main org folder) named 'agenda' where I do put all my .org files, then I open an .org file and with C-a a I try to obtain an agenda, but I obtain a message of file not found in the root folder, not in the new foldet I've just created. Im wondering: Do I have to set a variable to tell emacs (org-mode) where to watch for .org files?
    – RenatoP
    Commented Oct 4, 2022 at 14:52
  • 2
    You have to set org-agenda-files as described in the answer to tell Org mode which files contribute to the agenda (and you need to restart emacs to pick up the change). These are very basic questions that could be best answered by working diligently through an Org mode tutorial, e.g. this one or this one. Also the Org mode Wiki has a Tutorials section with more in-depth coverage.
    – NickD
    Commented Oct 4, 2022 at 16:28
  • Do any of your TODO entries have associated active timestamps (e.g added with C-c . or C-c s)? If not, they will not appear in the agenda, since they will never match the time span of the agenda.
    – NickD
    Commented Oct 4, 2022 at 17:24
  • I elaborated the answer a bit to address and incorporate the information from the comments.
    – NickD
    Commented Oct 4, 2022 at 17:46

Your Answer

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

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