sunnyhasija / Academic-Doom-Emacs-Config

My doom emacs configuration files
300 stars 31 forks source link

[SOLVED] ERROR: void-variable org-journal-mode-map #3

Closed zenny closed 4 years ago

zenny commented 4 years ago

Hi,

Doom-doctor tells that org-journal-mode-map is a void-variable with latest master repo (https://github.com/sunnyhasija/DOOMEmacs/commit/902c49a8399cdaae7add0dc996602dd3e2d2b6a2).

! Attempt to load DOOM failed
  (config.el (void-variable org-journal-mode-map))

Thanks, and stay safe, /z

sunnyhasija commented 4 years ago

Thank you for bringing this to my attention.

org-journal-mode-map does not get loaded til org-journal mode is activated. I used that particular function to close the buffer after saving it. I have removed it from the laster master repo, and I will work on getting it to behave nicely.

zenny commented 4 years ago

Thank you for bringing this to my attention.

org-journal-mode-map does not get loaded til org-journal mode is activated. I used that particular function to close the buffer after saving it. I have removed it from the laster master repo, and I will work on getting it to behave nicely.

Methought it was problem with the org-journal itself and also opened an issue in https://github.com/bastibe/org-journal/issues/282.

zenny commented 4 years ago

Thank you for bringing this to my attention.

org-journal-mode-map does not get loaded til org-journal mode is activated. I used that particular function to close the buffer after saving it. I have removed it from the laster master repo, and I will work on getting it to behave nicely.

The org-jurnal-mode-map issue was solved by appending a after! org-journal part in doom:

(defun org-journal-save-entry-and-exit()
  "Save buffer of the current day's entry and kill the window."
  (interactive)
  (save-buffer)
  (kill-buffer-and-window))
(after! org-journal
    (define-key org-journal-mode-map (kbd "C-c n s") 'org-journal-save-entry-and-exit))

Thanks to @cslux in https://github.com/bastibe/org-journal/issues/282#issuecomment-669263392 for the useful pointer. :D

Cheers,

sunnyhasija commented 4 years ago

Great! I will update the master repo after testing this!

sunnyhasija commented 4 years ago

@zenny I was not able to successfully test this. Would you mind sharing the entire org-journal section from your config?

zenny commented 4 years ago

@zenny I was not able to successfully test this. Would you mind sharing the entire org-journal section from your config?

There is hardly any changes in your configuration. Anyway, here it looks like:

(use-package org-journal
      :bind
      ("C-c n j" . org-journal-new-entry)
      :custom
      (org-journal-dir "~/Downloads/Org/Daily/")
      (org-journal-date-prefix "#+TITLE: ")
      (org-journal-file-format "%Y-%m-%d.org")
      (org-journal-date-format "%A, %d %B %Y"))
(setq org-journal-enable-agenda-integration t)

;; https://github.com/bastibe/org-journal/issues/282
(defun org-journal-save-entry-and-exit()
  "Save buffer of the current day's entry and kill the window."
  (interactive)
  (save-buffer)
  (kill-buffer-and-window))
(after! org-journal
(define-key org-journal-mode-map (kbd "C-c n s") 'org-journal-save-entry-and-exit))
sunnyhasija commented 4 years ago

Thank you!

The master repo is fixed, tested and updated! Closing this issue.

zenny commented 4 years ago

Thank you!

The master repo is fixed, tested and updated! Closing this issue.

Glad that it worked for you, too! Cheers,

sunnyhasija commented 4 years ago

@zenny just to give you a heads up.

I worked with the creator of DOOM to streamline the configs for using org-journal.

Here are the big changes:

1) I removed the package from packages.el 2) I did so because DOOM has org-journal built in, you can enable it in init.el by adding the +journal flag to org. 3) The short cut to start a new journal entry is SPC n j j and to close and save the buffer is C-c n s

Hope this helps.