Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Possible "hide entries" behavior bug. #418

Open
kizifumoli opened this issue Oct 20, 2023 · 2 comments
Open

[BUG] Possible "hide entries" behavior bug. #418

kizifumoli opened this issue Oct 20, 2023 · 2 comments

Comments

@kizifumoli
Copy link
Contributor

Describe the bug
When using the monthly org-journal mode, when org-journal-hide-entries-p is nil, running org-journal-new-entry hides any expanded sections that are not in the current date.

To Reproduce
Steps to reproduce the behavior:

  1. Set org-journal-file-type to monthly and org-journal-hide-entries-p to nil
  2. Create a couple of entries on different days (Alternatively, make several sections in the org-journal file, as below this list)
  3. Run org-journal-new-entry
* Thursday, 10/19/2023
:PROPERTIES:
:CREATED:  20231019
:END:
** 10:32
This is a test
Please don't hide me

* Friday, 10/20/2023
:PROPERTIES:
:CREATED:  20231020
:END:
** 10:36

This is a new entry

Running org-journal-new-entry leads to the Thursday entry being hidden, which shouldn't happen due to org-journal-hide-entries-p being nil.

Expected behavior
Expected behavior is to have none of the sections collapsed when creating a new entry. The documentation states:

If true all but the current entry will be hidden when creating a new one.

Which makes me assume that no entries will be hidden / collapsed when creating a new one.

One possible solution to this is to change the function org-jounal--finalize-view (which is called in org-journal-new-entry) to the following:

(defun org-journal--finalize-view ()
  "Finalize visability of entry."
  (org-journal--decrypt)
  (if (and (org-journal--is-date-prefix-org-heading-p) org-journal-hide-entries-p)
      (progn
        (org-up-heading-safe)
        (org-back-to-heading)
        (outline-hide-other)
        (outline-show-subtree))
    (outline-show-all)))

Which fixes my issue, but I'm not sure if it would mess with anything else.
Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Emacs Version: 29.1

Your Emacs Configuration
Using DOOM-Emacs. Downloaded org-journal via the package! macro.

@bastibe
Copy link
Owner

bastibe commented Oct 21, 2023

Thank you for the bug report. Would you like to contribute your solution as a pull request?

@kizifumoli
Copy link
Contributor Author

Yes. I modified the function slightly so that only outline-hide-other is affected by org-journal-hide-entries-p (just in case the other functions were necessary).

Pull request is here: #419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants