Closed ckonstanski-olo closed 1 year ago
I familiarized myself with the edebug debugger. I set a breakpoint at the beginning of function org-fold-core-get-folding-spec-from-alias
. It ran quite a few times successfully. Every time the input argument spec-or-alias
had one of these values: "org-fold-visible" or "org-fold-hidden". But then the function ran with a value of "drawer", and that's when it returned nil and the error was thrown higher up in org-fold-core-region
when it explicitly tests for a nil result.
Perhaps I need to add an entry in org-fold-core--spec-symbols
for "drawer". Looking for something appropriate.
org-fold-core--spec-symbols
has the value:
((hidden . org-fold-hidden) (:alias . org-fold-hidden) (org-fold-hidden . org-fold-hidden) (visible . org-fold-visible) (:alias . org-fold-visible) (org-fold-visible . org-fold-visible))
But when a drawer wants to be added we call org-fold-core-get-folding-spec-from-alias
like this:
(org-fold-region (line-end-position 0) (point) t (if (eq org-fold-core-style 'text-properties) 'drawer 'outline))
It will pass in either 'drawer
or 'outline
, neither of which are valid given the alist they need to match against.
Still looking for how to customize org-fold-core--spec-symbols
.
I contacted the org-mode mailing list and got a reply. https://lists.gnu.org/archive/html/emacs-orgmode/2023-05/msg00460.html
The answer I got was that the buffer is not being properly put into org-mode
. So the bug does lie with the calling code, i.e. org-jira
. Looking higher up the stack trace to get an idea of which buffer we are talking about and where we should add a call to org-mode
.
Putting the buffer into org-mode
would cause the function org-fold-initialize
to be called, and org-fold-core--spec-symbols
would gain entries for 'drawer
and 'outline
.
I got the org-jira buffer to automatically enter org-mode
by adding '("\\.org\\'" . org-mode)
to my auto-mode-alist
.
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.8, Xaw3d scroll bars) of 2023-05-27
org-jira-20230413.441
When running
org-jira-get-issues
the following error occurs. I'm no elisp expert, but I think that the functionorg-fold-core-folding-spec-list
fails to return a folding spec for the buffer.The stacktrace: