purcell / emacs.d

An Emacs configuration bundle with batteries included
BSD 2-Clause "Simplified" License
6.87k stars 2.05k forks source link

org mode can't load agenda-files #713

Closed viscroad closed 5 years ago

viscroad commented 5 years ago

Hi,

Recently, I have problems in org mode after upgrade to Emcas 26, would you please help on following questions?

  1. Added (setq org-agenda-files (list "~/org")) in init-local.el, but there is nothing after hit agenda view. But it works when I added this line of code in init.el after (require 'init-local nil t)
  2. There are some org files reside in my ~/org folder. I want to add only directory name to or-agenda-files, but it does's work. I need to all files name to this variable separately to make agenda view show all task
  3. In your last version of org mode, there is a command > L Timeline for current buffer > , in agenda view, it is very useful view for me, it disappeared in latest version, how can I get it back or some alternative command?

Thank you very much!

purcell commented 5 years ago

org-agenda-files is a list of files, not directories.

viscroad commented 5 years ago

OK. that means I need to list all individual files to this value. but how can I add org-agenda-files to init-local.el not in init.el?

how can I add org directories ?

Thanks!

purcell commented 5 years ago

that means I need to list all individual files to this value

Actually no - I just looked at the docs for org-agenda-files (M-x describe-variable). Take a look at what it says there.

how can I add org-agenda-files to init-local.el not in init.el?

The README talks about how to use init-local.el. Alternatively, use the customize interface to configure org.

Hope that helps!

minostro commented 5 years ago

I actually run into this issue today. I use two different computers but I use the same configuration for both of them (init-local.el). The config that I had for org-mode is:

;;; Agenda settings
(setq org-agenda-files (list
                     "~/org/my-life.org"
                     "~/org/triage.org"))

;;; Refile settings
 (setq org-refile-targets '((nil :maxlevel . 3)
                        (org-agenda-files :maxlevel . 3)))

This configuration has been working for a couple years now. However in my new computer I noticed that the agenda wasn't loading my TODO items. I changed the configuration for:

;;; Agenda settings
(custom-set-variables
 '(org-agenda-files (list
                     "~/org/my-life.org"
                     "~/org/triage.org")))

;;; Refile settings
(custom-set-variables
 '(org-refile-targets '((nil :maxlevel . 3)
                        (org-agenda-files :maxlevel . 3))))

After doing this I started seeing the TODO items in my agenda...I am not sure why this is happening though. Maybe is because my new computer has a never org-mode version? (9.1.9)

purcell commented 5 years ago

@minostro It might be that you had different values for those vars in your custom.el, so that the setq values were subsequently overwritten when custom.el was loaded?

minostro commented 5 years ago

@purcell true! didn't think about it. Now I understand when some people say that it's safer to use custom-set-variables rather than setq

purcell commented 5 years ago

Now I understand when some people say that it's safer to use custom-set-variables rather than setq

I don't really agree with that, though. I think it's just a matter of understanding the startup process. It's always possible for one setting to override another if there are 2 such statements.

(You'll note that I generally use setq or setq-default in this config but in some cases I use custom-set-variables: this is mainly to ensure that any set function for the custom variable is called.)