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

:discard breaks org-agenda-redo when processing the time grid #215

Open
stites opened this issue Feb 3, 2022 · 2 comments
Open

:discard breaks org-agenda-redo when processing the time grid #215

stites opened this issue Feb 3, 2022 · 2 comments
Assignees
Milestone

Comments

@stites
Copy link

stites commented Feb 3, 2022

I have the following configuration at the top level of my configs (I removed irrelevant agenda commands, so beware of unbalanced parens).

(setq org-agenda-custom-commands
      '(
      ;; ...
      ("x" "Overview/span1"
         ((agenda ""
                  ((org-agenda-start-day "0d")
                   (org-agenda-span 1)
                   (org-super-agenda-groups
                    `((:discard (:deadline (after ,(org-read-date nil nil "+14d"))))
                      ))))))
      ;; ...
       ))

This configuration works on the first load; however, when I refresh the page, I get the following stack trace (from emacs --debug-init) which crashes my agenda view.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  org-super-agenda--group-deadline((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (after "2022-02-17"))
  org-super-agenda--group-dispatch-discard((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (:deadline ...))
  org-super-agenda--group-dispatch((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (:discard ...))
  org-super-agenda--group-items((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
  org-super-agenda--filter-finalize-entries(#("  northeastern..." 0 28 ... 28 29 ... 29 47 ... 48 50 ... ...))
  org-agenda-finalize-entries((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) agenda)
  org-agenda-list(nil)
  funcall-interactively(org-agenda-list nil)
  call-interactively(org-agenda-list)
  #f(compiled-function () #<bytecode 0x295546313818daa>)()
  funcall(#f(compiled-function () #<bytecode 0x295546313818daa>))
  (let ((org-agenda-start-day '"0d") (org-agenda-span '1) (org-super-agenda-groups '((:discard (:deadline (after "2022-02-17")))))) (funcall '#f(compiled-function () #<bytecode 0x295546313818daa>)))
  org-agenda-run-series("Overview/span1" (((agenda "" ((org-agenda-start-day "0d") (org-agenda-span 1) (org-super-agenda-groups `(...)))))))
  org-agenda-redo(nil)
  funcall-interactively(org-agenda-redo nil)
  command-execute(org-agenda-redo)

I am currently using org-super-agenda at the current head of master: fb5e2ef.

I understand that relative date support is in the hands of the user (re: #59) -- as an elisp novice, I could easily be doing something wrong. Any help with this bug or my configuration would be appreciated!

@stites
Copy link
Author

stites commented Feb 3, 2022

Rubber-ducking this a little. I /think/ it trying to discard the non-header lines from the agenda view and discard them, but it's reading them as strings and not org elements. the " northeastern..." is coming from the expected view of my agenda:

Thursday    3 February 2022

 Today
  northeastern: 8:00am...... calendar event 
               8:00am...... ----------------
               9:48am...... now - - - - - - - - - - - - - - - - - - - - - - - - -
              10:00am...... ----------------
              12:00pm...... ----------------
  northeastern: 2:00pm...... calendar event
               2:00pm...... ----------------
               4:00pm...... ----------------
  seminars:    5:00pm...... a seminar title 
               6:00pm...... ----------------
               8:00pm...... ----------------
  todo:       Deadline:   TODO [#A] ...removed...
  todo:       Deadline:   TODO ...removed...

If this intuition is correct, then I would expect this to be a bug with a simple fix of swallowing the error when discarding in a time-grid (with more or less work done verifying that the discard is happening in a time grid). Looking at the codebase, however, I have no idea how to start tackling this problem.

I think this also means there must be a more convenient way to discard events this way. I, personally, couldn't figure this out from the documentation so if this is expected behavior please let me know and I can submit an update to the README.

Attempting to work in an org-super-agenda-only mode returns the same error with the following configuration:

("x" "Overview/span1"
         ((agenda ""
                  ((org-super-agenda-groups
                    `((:discard (:deadline (before ,(org-read-date nil nil "-1d")) ))
                      (:discard (:deadline (after ,(org-read-date nil nil "+1d")) ))
                      ))))

          ))

@stites stites changed the title org-agenda-redo breaks with :discard (after "<date>") :discard breaks org-agenda-redo when processing the time grid Feb 3, 2022
@alphapapa alphapapa self-assigned this Sep 24, 2023
@alphapapa alphapapa added this to the 1.4 milestone Sep 24, 2023
@alphapapa
Copy link
Owner

Thanks for reporting this. I probably won't have time to debug this soon, so patches welcome.

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

No branches or pull requests

2 participants