When I open an org file before opening the agenda, my habits show up as regular 
tasks,
rather than with the consistency graph. Additionally, many CANCELed tasks still 
show up in
the agenda. When I open the agenda first however, everything goes fine.

Interestingly, this only happens when I bind 'org-agenda' to a key. To show 
this, I have
attached bad.el and good.el which reproduce the issue on current main (Org mode 
version
9.7-pre (release_9.6.21-1295-g46909a @ /opt/org-mode/lisp/)).

Note that they set

    (setq org-directory "/tmp/tmp.emacs/notes")

and they expect '/tmp/tmp.emacs/notes/file.org' to exist, see attachment.

Reproduce with:

  emacs -Q -l bad.el /tmp/tmp.emacs/notes/file.org

so that it definitely opens an org-file before the org-agenda. After opening 
the agenda,
my habits do not show up as habits. My habits do show up with:

  emacs -Q -l bad.el --eval="(org-agenda-list)"

and with they also show up:

  emacs -Q -l good.el /tmp/tmp.emacs/notes/file.org

I am running Emacs 29.2. Am I doing something wrong here?

(use-package org
  :load-path "/opt/org-mode/lisp"
  :init
  (setq org-directory "/tmp/tmp.emacs/notes"))

(use-package org-agenda
  :ensure nil
  :load-path "/opt/org-mode/lisp"
  :config
  (add-to-list 'org-modules 'org-habit t)
  (setq org-agenda-files '("file.org"))

  :bind (("C-c a" . org-agenda)))
(use-package org
  :load-path "/opt/org-mode/lisp"
  :init
  (setq org-directory "/tmp/tmp.emacs/notes"))

(use-package org-agenda
  :ensure nil
  :load-path "/opt/org-mode/lisp"
  :config
  (add-to-list 'org-modules 'org-habit t)
  (setq org-agenda-files '("file.org")))

Attachment: file.org
Description: Lotus Organizer

Reply via email to