bastibe / org-journal

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

Org-mode 9.7.x and warning: ‘org-element-at-point’ cannot be used in non-Org buffer #446

Open jackbaty opened 2 months ago

jackbaty commented 2 months ago

Describe the bug This feels like something that may not be org-journal specific, so apologies if this is misplaced, but...

The first time (and only the first time) I call org-journal-new-entry or org-journal-search, emacs generates nearly 3,000 warnings like this:

Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer 2016-12.org> (fundamental-mode)

This does not happen when using Org 9.6x with the same config. Tested also with a barebones (emacs -q) config.

To Reproduce When running Org-mode version 9.7.x, call org-journal-new-entry

Expected behavior No such warnings should appear

Desktop (please complete the following information):

Your Emacs Configuration

(use-package org-journal 
  :ensure t
  :defer t
  :bind
  ("C-c o j" . org-journal-new-entry)
  :config
  (setq org-journal-dir "~/Documents/Notes/OrgJournal"
    org-journal-file-type 'monthly
    org-journal-file-format "%Y-%m.org"
    org-journal-find-file #'find-file
    org-journal-time-prefix ""
    org-journal-time-format ""
    org-journal-enable-agenda-integration nil
    org-journal-enable-encryption nil
    org-journal-date-format "%A, %B %d %Y"))
jmay commented 2 months ago

@jackbaty I've seen messages like this when there is a PROPERTIES drawer that has invalid formatting. org-journal trusts that the formatting is perfect. Take a look in your 2016-12.org file and check the PROPERTIES entries there - even an extra newline can cause problems.

jackbaty commented 2 months ago

@jackbaty I've seen messages like this when there is a PROPERTIES drawer that has invalid formatting. org-journal trusts that the formatting is perfect. Take a look in your 2016-12.org file and check the PROPERTIES entries there - even an extra newline can cause problems.

Thanks, I'll investigate that. I hope that's not the cause, though, since I get a message line for every entry in every file, which would suggest that I've got a lot of invalid PROPERTIES drawers! :)

cands commented 2 months ago

I see a very similar behavior (with > 10 k such warnings generated). I checked the PROPERTIES drawers for invalid formatting, but cannot see any problems there so it appears the warnings are genereated although files are correctly formatted.