emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: 420actionunits@gmail.com
To: emacs-orgmode@gnu.org
Subject: org-fold-core-region error: missing SPEC
Date: Sun, 28 May 2023 22:50:12 -0600	[thread overview]
Message-ID: <a9caf4859b8ab748e0b942af9dce652a8aaebcdb.camel@gmail.com> (raw)

I get the following stack trace when calling ORG-JIRA-GET-ISSUES from
org-jira I also get it from similar calls from ejira. After looking at
the code I think it's a problem in org and org-fold.

Debugger entered--Lisp error: (error "Calling ‘org-fold-core-region’ with missing SPEC")
  signal(error ("Calling ‘org-fold-core-region’ with missing SPEC"))
  error("Calling `org-fold-core-region' with missing SPEC")
  org-fold-region(1312 1318 t outline)
  org-insert-property-drawer()
  org-get-property-block(1222 force)
  org-entry-put(1286 "assignee" "Carlos Konstanski")
  org-jira-entry-put(1286 "assignee" "Carlos Konstanski")
  org-jira--render-issue(#<org-jira-sdk-issue org-jira-sdk-issue-156a386e429c>)
  mapc(org-jira--render-issue (#<org-jira-sdk-issue org-jira-sdk-issue-156a386e429c> ...))
  org-jira--render-issues-from-issue-list((#<org-jira-sdk-issue org-jira-sdk-issue-156a386e429c> ...))
  org-jira-get-issues((#<org-jira-sdk-issue org-jira-sdk-issue-156a386e429c> ...))
  #f(compiled-function (&rest rest) "Callback for async, DATA is the response from the request call.\n\nWill send a list of org-jira-sdk-issue objects to the list printer." #<bytecode 0x155bd04851c94e33>)(:data (... ... ... ... ...) :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history nil :data ... :error-thrown nil :symbol-status success :url "https://ololab..." :done-p nil :settings ... :-buffer #<killed buffer> :-raw-header "HTTP/2 200 \nda..." :-timer nil :-backend curl))
  apply(#f(compiled-function (&rest rest) "Callback for async, DATA is the response from the request call.\n\nWill send a list of org-jira-sdk-issue objects to the list printer." #<bytecode 0x155bd04851c94e33>) (:data ... :symbol-status success :error-thrown nil :response ...))
  request--callback(#<killed buffer> :sync nil :headers (... ...) :parser jiralib--json-read :complete #f(compiled-function (&rest rest) "Callback for async, DATA is the response from the request call.\n\nWill send a list of org-jira-sdk-issue objects to the list printer." #<bytecode 0x155bd04851c94e33>) :error (lambda ... "\n\n(fn &key DAT..." ...) :type "POST" :data ...)
  apply(request--callback #<killed buffer> (:sync nil :headers (("Authorization" . "Basic Y2FybG9zLmtvbnN0YW5z...") ("Content-Type" . "application/json")) :parser jiralib--json-read :complete #f(compiled-function (&rest rest) "Callback for async, DATA is the response from the request call.\n\nWill send a list of org-jira-sdk-issue objects to the list printer." #<bytecode 0x155bd04851c94e33>) :error (lambda (&rest --cl-rest--) "\n\n(fn &key DATA &allow-oth..." (apply ... ... ... --cl-rest--)) :type "POST" :data "{\"jql\":\"assignee = current..." :url "https://ololabs.atlassian...." :response #s(request-response :status-code 200 :history nil :data (... ... ... ... ...) :error-thrown nil :symbol-status success :url "https://ololabs.atlassian...." :done-p nil :settings #3 :-buffer #<killed buffer> :-raw-header "HTTP/2 200 \ndate: Sat, 27 ..." :-timer nil :-backend curl) :encoding utf-8))
  request--curl-callback("https://ololabs.atlassian.net/rest/api/2/search" #<process request curl<9>> "finished\n")
  apply(request--curl-callback ("https://ololabs.atlassian.net/rest/api/2/search" #<process request curl<9>> "finished\n"))
  #f(compiled-function (&rest args2) #<bytecode -0x190ba810c79ff01c>)(#<process request curl<9>> "finished\n")

I set a breakpoint at the beginning of function
ORG-FOLD-CORE-GET-FOLDING-SPEC-FROM-ALIAS. It runs quite a few times
successfully. Every time the input argument SPEC-OR-ALIAS has one of
these values: 'ORG-FOLD-VISIBLE or 'ORG-FOLD-HIDDEN. But at some point
the function runs with a value of 'DRAWER, and that's when it returns
NIL and the error is thrown higher up in ORG-FOLD-CORE-REGION when it
explicitly tests for a NIL result.

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-REGION 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.

It would seem that any execution path that goes through
ORG-INSERT-PROPERTY-DRAWER is going to fail.

I'm still unclear on how ORG-FOLD-CORE--SPEC-SYMBOLS gets set with
this alist. Is there is an opportunity for callers to customize it?
What would be appropriate values to add for 'DRAWER and 'OUTLINE?


Emacs  : 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
Package: Org mode version 9.6.6 (release_9.6.6 @ /usr/share/emacs/30.0.50/lisp/org/)

current state:
==============
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
                  org-cycle-optimize-window-after-visibility-change org-cycle-display-inline-images)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-fold-show-all append local] 5]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes
                 #[0 "\301\211\x10\207" [imenu-create-index-function org-imenu-get-tree] 2])
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link)
                       ("eww" :follow org-eww-open :store org-eww-store-link)
                       ("rmail" :follow org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export)
                       ("info" :follow org-info-open :export org-info-export :store org-info-store-link
                        :insert-description org-info-description-as-command)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link
                        :store org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link)
                       ("doi" :follow org-link-doi-open :export org-link-doi-export)
                       ("jira" :follow org-jira-open :export nil) ("id" :follow org-id-open) ("file+sys")
                       ("file+emacs") ("shell" :follow org-link--open-shell)
                       ("news" :follow
                        #[514 "\301\300\302\x04Q\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("mailto" :follow
                        #[514 "\301\300\302\x04Q\"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("https" :follow
                        #[514 "\301\300\302\x04Q\"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("http" :follow
                        #[514 "\301\300\302\x04Q\"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("ftp" :follow #[514 "\301\300\302\x04Q\"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("help" :follow org-link--open-help :store org-link--store-help)
                       ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-fold-core-style 'text-properties
)


             reply	other threads:[~2023-05-29  4:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29  4:50 420actionunits [this message]
2023-05-29  7:22 ` org-fold-core-region error: missing SPEC Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9caf4859b8ab748e0b942af9dce652a8aaebcdb.camel@gmail.com \
    --to=420actionunits@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).