Closed kaushalmodi closed 2 years ago
After evaluating this:
(defun org-cite-basic--get-field (field entry-or-key &optional info raw)
"Return FIELD value for ENTRY-OR-KEY, or nil.
FIELD is a symbol. ENTRY-OR-KEY is either an association list, as returned by
`org-cite-basic--get-entry', or a string representing a citation key.
Optional argument INFO is the export state, as a property list.
Return value may be nil or a string. If current export back-end is derived
from `latex', return a raw string instead, unless optional argument RAW is
non-nil."
(message "field = %S" field)
(message " entry-or-key = %S" entry-or-key)
(let ((value
(cdr
(assq field
(pcase entry-or-key
((pred stringp)
(org-cite-basic--get-entry entry-or-key info))
((pred consp)
entry-or-key)
(_
(error "Wrong value for ENTRY-OR-KEY: %S" entry-or-key)))))))
(if (and value
(not raw)
(org-export-derived-backend-p (plist-get info :back-end) 'latex))
(org-export-raw-string value)
value)))
.. when attempting to export [[file:all-posts.org::*Org Cite Basic Example]]
..
emacs-28
branchno error
Output in *Messages* buffer:
[ox-hugo] Exporting ‘Org Cite Basic Example’ ..
org-babel-exp process org at position 199628...
org-babel-exp process org at position 199897...
field = author
entry-or-key = "OrgCitations"
field = author
entry-or-key = "OrgCitations"
field = year
entry-or-key = "OrgCitations"
field = author
entry-or-key = ((type . "article") (id . "OrgCitations") (author . #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent (paragraph nil #2 #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #("Journal of Plain Text Formats" 0 29 (:parent #4)) #("." 0 1 (:parent #4)))))) (journal . #("Journal of Plain Text Formats" 0 29 (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #4)) #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #2 #("." 0 1 (:parent #4)))))) (title . #("Elegant Citations with Org-Mode" 0 31 (:parent (italic (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #6)) #(" (" 0 2 (:parent #6)) #("2021" 0 4 (:parent #6)) #("). " 0 3 (:parent #6)) #4 #(", " 0 2 (:parent #6)) #("Journal of Plain Text Formats" 0 29 (:parent #6)) #("." 0 1 (:parent #6)))) #2)))) (year . "2021") (month . "7") (volume . "42") (number . "1") (pages . "2-3"))
field = title
entry-or-key = ((type . "article") (id . "OrgCitations") (author . #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent (paragraph nil #2 #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #("Journal of Plain Text Formats" 0 29 (:parent #4)) #("." 0 1 (:parent #4)))))) (journal . #("Journal of Plain Text Formats" 0 29 (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #4)) #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #2 #("." 0 1 (:parent #4)))))) (title . #("Elegant Citations with Org-Mode" 0 31 (:parent (italic (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #6)) #(" (" 0 2 (:parent #6)) #("2021" 0 4 (:parent #6)) #("). " 0 3 (:parent #6)) #4 #(", " 0 2 (:parent #6)) #("Journal of Plain Text Formats" 0 29 (:parent #6)) #("." 0 1 (:parent #6)))) #2)))) (year . "2021") (month . "7") (volume . "42") (number . "1") (pages . "2-3"))
field = publisher
entry-or-key = ((type . "article") (id . "OrgCitations") (author . #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent (paragraph nil #2 #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #("Journal of Plain Text Formats" 0 29 (:parent #4)) #("." 0 1 (:parent #4)))))) (journal . #("Journal of Plain Text Formats" 0 29 (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #4)) #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #2 #("." 0 1 (:parent #4)))))) (title . #("Elegant Citations with Org-Mode" 0 31 (:parent (italic (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #6)) #(" (" 0 2 (:parent #6)) #("2021" 0 4 (:parent #6)) #("). " 0 3 (:parent #6)) #4 #(", " 0 2 (:parent #6)) #("Journal of Plain Text Formats" 0 29 (:parent #6)) #("." 0 1 (:parent #6)))) #2)))) (year . "2021") (month . "7") (volume . "42") (number . "1") (pages . "2-3"))
field = journal
entry-or-key = ((type . "article") (id . "OrgCitations") (author . #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent (paragraph nil #2 #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #("Journal of Plain Text Formats" 0 29 (:parent #4)) #("." 0 1 (:parent #4)))))) (journal . #("Journal of Plain Text Formats" 0 29 (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #4)) #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #2 #("." 0 1 (:parent #4)))))) (title . #("Elegant Citations with Org-Mode" 0 31 (:parent (italic (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #6)) #(" (" 0 2 (:parent #6)) #("2021" 0 4 (:parent #6)) #("). " 0 3 (:parent #6)) #4 #(", " 0 2 (:parent #6)) #("Journal of Plain Text Formats" 0 29 (:parent #6)) #("." 0 1 (:parent #6)))) #2)))) (year . "2021") (month . "7") (volume . "42") (number . "1") (pages . "2-3"))
field = author
entry-or-key = ((type . "article") (id . "OrgCitations") (author . #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent (paragraph nil #2 #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #("Journal of Plain Text Formats" 0 29 (:parent #4)) #("." 0 1 (:parent #4)))))) (journal . #("Journal of Plain Text Formats" 0 29 (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #4)) #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #2 #("." 0 1 (:parent #4)))))) (title . #("Elegant Citations with Org-Mode" 0 31 (:parent (italic (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #6)) #(" (" 0 2 (:parent #6)) #("2021" 0 4 (:parent #6)) #("). " 0 3 (:parent #6)) #4 #(", " 0 2 (:parent #6)) #("Journal of Plain Text Formats" 0 29 (:parent #6)) #("." 0 1 (:parent #6)))) #2)))) (year . "2021") (month . "7") (volume . "42") (number . "1") (pages . "2-3"))
field = year
entry-or-key = ((type . "article") (id . "OrgCitations") (author . #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent (paragraph nil #2 #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #("Journal of Plain Text Formats" 0 29 (:parent #4)) #("." 0 1 (:parent #4)))))) (journal . #("Journal of Plain Text Formats" 0 29 (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #4)) #(" (" 0 2 (:parent #4)) #("2021" 0 4 (:parent #4)) #("). " 0 3 (:parent #4)) (italic (:parent #4) #("Elegant Citations with Org-Mode" 0 31 (:parent #5))) #(", " 0 2 (:parent #4)) #2 #("." 0 1 (:parent #4)))))) (title . #("Elegant Citations with Org-Mode" 0 31 (:parent (italic (:parent (paragraph nil #("org, mode and Syntax, Citation and List, Mailing and Effort, Time" 0 65 (:parent #6)) #(" (" 0 2 (:parent #6)) #("2021" 0 4 (:parent #6)) #("). " 0 3 (:parent #6)) #4 #(", " 0 2 (:parent #6)) #("Journal of Plain Text Formats" 0 29 (:parent #6)) #("." 0 1 (:parent #6)))) #2)))) (year . "2021") (month . "7") (volume . "42") (number . "1") (pages . "2-3"))
Wrote /home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/org-cite-basic-example.md
master
(emacs 29.x) branchError
Output in *Messages* buffer:
[ox-hugo] Exporting ‘Org Cite Basic Example’ ..
org-babel-exp process org at position 199572...
org-babel-exp process org at position 199841...
field = author
entry-or-key = "OrgCitations"
field = editor
entry-or-key = "OrgCitations"
field = author
entry-or-key = "OrgCitations"
field = editor
entry-or-key = "OrgCitations"
field = year
entry-or-key = "OrgCitations"
field = date
entry-or-key = "OrgCitations"
field = author
entry-or-key = nil
let: Wrong value for ENTRY-OR-KEY: nil
The regression was caused in bibtex.el
on emacs master in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c32e8b33f4fdd17856e5f7ae8e7e7c6d3b473342, and it's now fixed in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d221c02fa1db17e1275687f0bbce4ff1499119a1.
Update (2022-05-12)
The upstream bug in emacs master has been fixed in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d221c02fa1db17e1275687f0bbce4ff1499119a1, and verified.
This issue can be closed once the emacs snapshot version used by GHA gets updated. Ref: https://github.com/purcell/nix-emacs-ci/issues/75.
Emacs bug
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55342
More info
The CI fails when using emacs master (Emacs 29.0.50) build when exporting the "Org Cite Basic Example" post from the test suite.
https://github.com/kaushalmodi/ox-hugo/runs/6352764912?check_suite_focus=true#step:5:597