bastibe / org-journal

A simple org-mode based journaling mode
BSD 3-Clause "New" or "Revised" License
1.23k stars 122 forks source link

org-journal-mode loaded late #395

Closed jdek closed 4 months ago

jdek commented 2 years ago

Describe the bug

Journal mode only loads when file opened after journal-mode has been loaded manually at least one time.

To Reproduce

  1. Open a file under org-journal-dir using M-x find-file
  2. File is loaded automatically with org-mode as major mode
  3. M-x org-journal-mode
  4. Kill the buffer
  5. Open another file under org-journal-dir
  6. File is loaded with org-journal-mode as major mode

Expected behavior

org-journal-mode should load immediately the first time. Maybe it needs to be loaded with org-mode somehow in use-package (configuration error?).

Desktop (please complete the following information):

Emacs Configuration

(use-package org
  :straight (org-plus-contrib
             :type git
             :repo "https://code.orgmode.org/bzg/org-mode.git"
             :local-repo "org"
             :depth full
             :pre-build '(straight-recipes-org-elpa--build)
             :build (:not autoloads)
             :files (:defaults
                     "lisp/*.el"
                     ("etc/styles/" "etc/styles/*")
                     "contrib/lisp/*.el"))
  :bind (("C-c l" . org-store-link)
         ("C-c a" . org-agenda)
         ("C-c c" . org-capture))
  :init
  (unless (boundp 'org-directory) (setq org-directory (file-name-as-directory "~/Desktop/org"))))

(use-package org-journal
  :straight (:host github :repo "bastibe/org-journal")
  :bind (("C-c j" . org-journal-new-entry))
  :init
  (setq org-journal-dir (concat org-directory "/journal"))
  (setq org-journal-file-format "%Y%m%d.org")
  (setq org-journal-date-format "%A, %d/%m/%Y"))