Closed lailamor closed 3 years ago
Thanks for the detailed report, will try to look into this in the next few days. I've transferred the issue to citeproc-org, because at first sight it looks most probably an org-related problem.
Unfortunately, I couldn't reproduce it so far, but it might be a problem with the -if-let macro on your system. Could you check what happens if the -if-let is omitted from the function definition, that is, could you redefine the function citeproc-formatter-for-format
after encountering the problem by running
(defun citeproc-formatter-for-format (format) (alist-get format citeproc-fmt--formatters-alist))
(You can run it with M-: (eval expression) or from IELM, for instance.) Does this change anything?
After redefining citeproc-formatter-for-format
and running C-c C-e H A
, I get:
[ox-hugo] 1/ Exporting ‘ox-hugo won't export because formatter is void’ ..
Symbol’s function definition is void: fmt-fun
I can't reproduce the issue on another machine of mine (Manjaro Linux) with emacs 28.0.50 master
branch. Later I may try installing the feature/native-comp
on that machine to test if I can reproduce.
I'm using a relatively simple init.el
to test it.
I may try installing the feature/native-comp on that machine to test if I can reproduce.
I did, but couldn't reproduce. Below the detailed backtraces.
citeproc-formatter-for-format: Symbol’s function definition is void: formatter
Symbol’s function definition is void: fmt-fun
Thanks, and apologies for responding that late. Unfortunately the only thing I can think of is that the problems come somehow from macro-expansion failures related to native compilation -- for instance, it seems that the -if-let
macro (from the dash package) used in the function citeproc-formatter-for-format
is not expanded properly and Emacs tries to evaluate the binding form
(formatter (alist-get format citeproc-fmt--formatters-alist))
as a function call. The second trace seems to show a similar problem with expanding the -when-let
macro. If you want to experiment further you can try to replace all occurrences of -when-let
and -if-let
with the equivalent if-let
and when-let
macros and see whether this changes things (the code uses the dash variants only for historical reasons), but the problem seems to be very general, not specific to citeproc-el or citeproc-org.
Meanwhile I managed to reproduce the issue with the native-comp branch, and it seems to be solved by using the internal Emacs versions of the if-let and when-let macros. I've pushed the changes (https://github.com/andras-simonyi/citeproc-el/commit/f6268ab07de45ba6a324f8cbb6b6fec99ba6472b) to the citeproc-el repo -- could you check whether it fixes the problem on your system?
could you check whether it fixes the problem on your system?
Just made some tests, and it fixed the problem.
but the problem seems to be very general, not specific to citeproc-el or citeproc-org.
Yes, seems like an upstream issue indeed by your explanation. I'd report there but I'm not familiar with mailing lists at all...
Thank you so much András!
Description
ox-hugo won't export org-mode file to markdown when using org-ref + citeproc-org because
formatter
definition is void.Replication
Create hugo blog.
Create main org file
blog/blog.org
. Add below toblog.org
blog.org
``` #+AUTHOR: Me #+STARTUP: content #+HUGO_BASE_DIR: . #+HUGO_AUTO_SET_LASTMOD: t * Posts :post: :PROPERTIES: :EXPORT_HUGO_SECTION: posts :END: ** Issue :@issue: *** DONE ox-hugo won't export because formatter is void CLOSED: [2020-10-01 Mon 02:08] :PROPERTIES: :EXPORT_DATE: 2020-10-01 :EXPORT_FILE_NAME: issue :END: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl. cite:dominik-2010-tom7rm * References bibliography:static/references.bib ```Create bibtex file in
blog/static/references.bib
. Add below doreferences.bib
.references.bib
``` @book{dominik-2010-tom7rm, author = {Dominik, Carsten}, publisher = {Network Theory Ltd}, title = {{The Org Mode 7 Reference Manual}}, url = {https://web.archive.org/web/20160426062148/http://www.network-theory.co.uk/org/manual}, year = {2010} } ```Open
blog.org
and run export to hugo markdown compatible file (e.g.C-c C-e H A
). See Emacs Messages buffer.Error stack
When trying to create a post with org-ref citations and exporting it (with
C-c C-e H A
).Other comments
I didn't have this issue before. I've made some updates and also switched to using Emacs 28.0.50
feature/native-comp
branch; no idea if it's related.Debug information
Debug Info
## Emacs Version GNU Emacs 28.0.50 (feature/native-comp, build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.17.3) of 2020-09-24 (commit e5b052d60d905209c6cefcf18c620167ed946301) ## Org Version Org mode version N/A (N/A !!check installation!! @ /home/lailamor/.emacs.d/straight/build/org/) ## citeproc-el version citeproc-el 0.1.2-2-g0ad1f97 0 0 ~/.emacs.d/straight/repos/citeproc-el/ ## citeproc-org version citeproc-org 0.2.4-25-g22a759c 0 0 ~/.emacs.d/straight/repos/citeproc-org/ ## org-ref version org-ref v1.1.1-431-g71f4eb7 0 0 ~/.emacs.d/straight/repos/org-ref/ ## Hugo Version Hugo Static Site Generator v0.75.1/extended linux/amd64 BuildDate: unknown ### Org `load-path` shadows **Warning**: Possible mixed installation of Org /home/lailamor/.emacs.d/straight/build/org/ox-beamer hides /usr/share/emacs/28.0.50/lisp/org/ox-beamer /home/lailamor/.emacs.d/straight/build/org/ox-icalendar hides /usr/share/emacs/28.0.50/lisp/org/ox-icalendar /home/lailamor/.emacs.d/straight/build/org/ob-stan hides /usr/share/emacs/28.0.50/lisp/org/ob-stan /home/lailamor/.emacs.d/straight/build/org/ob-sed hides /usr/share/emacs/28.0.50/lisp/org/ob-sed /home/lailamor/.emacs.d/straight/build/org/ob-clojure hides /usr/share/emacs/28.0.50/lisp/org/ob-clojure /home/lailamor/.emacs.d/straight/build/org/ob-core hides /usr/share/emacs/28.0.50/lisp/org/ob-core /home/lailamor/.emacs.d/straight/build/org/org-colview hides /usr/share/emacs/28.0.50/lisp/org/org-colview /home/lailamor/.emacs.d/straight/build/org/ob-js hides /usr/share/emacs/28.0.50/lisp/org/ob-js /home/lailamor/.emacs.d/straight/build/org/ol-mhe hides /usr/share/emacs/28.0.50/lisp/org/ol-mhe /home/lailamor/.emacs.d/straight/build/org/org-macro hides /usr/share/emacs/28.0.50/lisp/org/org-macro /home/lailamor/.emacs.d/straight/build/org/ob-org hides /usr/share/emacs/28.0.50/lisp/org/ob-org /home/lailamor/.emacs.d/straight/build/org/ol-w3m hides /usr/share/emacs/28.0.50/lisp/org/ol-w3m /home/lailamor/.emacs.d/straight/build/org/ox-publish hides /usr/share/emacs/28.0.50/lisp/org/ox-publish /home/lailamor/.emacs.d/straight/build/org/org-clock hides /usr/share/emacs/28.0.50/lisp/org/org-clock /home/lailamor/.emacs.d/straight/build/org/ob-makefile hides /usr/share/emacs/28.0.50/lisp/org/ob-makefile /home/lailamor/.emacs.d/straight/build/org/ol-bibtex hides /usr/share/emacs/28.0.50/lisp/org/ol-bibtex /home/lailamor/.emacs.d/straight/build/org/org-faces hides /usr/share/emacs/28.0.50/lisp/org/org-faces /home/lailamor/.emacs.d/straight/build/org/ob-ebnf hides /usr/share/emacs/28.0.50/lisp/org/ob-ebnf /home/lailamor/.emacs.d/straight/build/org/org-keys hides /usr/share/emacs/28.0.50/lisp/org/org-keys /home/lailamor/.emacs.d/straight/build/org/ob-emacs-lisp hides /usr/share/emacs/28.0.50/lisp/org/ob-emacs-lisp /home/lailamor/.emacs.d/straight/build/org/ox-org hides /usr/share/emacs/28.0.50/lisp/org/ox-org /home/lailamor/.emacs.d/straight/build/org/ob-lilypond hides /usr/share/emacs/28.0.50/lisp/org/ob-lilypond /home/lailamor/.emacs.d/straight/build/org/ob-ditaa hides /usr/share/emacs/28.0.50/lisp/org/ob-ditaa /home/lailamor/.emacs.d/straight/build/org/org-compat hides /usr/share/emacs/28.0.50/lisp/org/org-compat /home/lailamor/.emacs.d/straight/build/org/org-loaddefs hides /usr/share/emacs/28.0.50/lisp/org/org-loaddefs /home/lailamor/.emacs.d/straight/build/org/ob-dot hides /usr/share/emacs/28.0.50/lisp/org/ob-dot /home/lailamor/.emacs.d/straight/build/org/ob-C hides /usr/share/emacs/28.0.50/lisp/org/ob-C /home/lailamor/.emacs.d/straight/build/org/ob-matlab hides /usr/share/emacs/28.0.50/lisp/org/ob-matlab /home/lailamor/.emacs.d/straight/build/org/org-macs hides /usr/share/emacs/28.0.50/lisp/org/org-macs /home/lailamor/.emacs.d/straight/build/org/org-src hides /usr/share/emacs/28.0.50/lisp/org/org-src /home/lailamor/.emacs.d/straight/build/org/ob-picolisp hides /usr/share/emacs/28.0.50/lisp/org/ob-picolisp /home/lailamor/.emacs.d/straight/build/org/ox-man hides /usr/share/emacs/28.0.50/lisp/org/ox-man /home/lailamor/.emacs.d/straight/build/org/org-archive hides /usr/share/emacs/28.0.50/lisp/org/org-archive /home/lailamor/.emacs.d/straight/build/org/ob-hledger hides /usr/share/emacs/28.0.50/lisp/org/ob-hledger /home/lailamor/.emacs.d/straight/build/org/org-mobile hides /usr/share/emacs/28.0.50/lisp/org/org-mobile /home/lailamor/.emacs.d/straight/build/org/ob-comint hides /usr/share/emacs/28.0.50/lisp/org/ob-comint /home/lailamor/.emacs.d/straight/build/org/ob-sass hides /usr/share/emacs/28.0.50/lisp/org/ob-sass /home/lailamor/.emacs.d/straight/build/org/ol-irc hides /usr/share/emacs/28.0.50/lisp/org/ol-irc /home/lailamor/.emacs.d/straight/build/org/ol hides /usr/share/emacs/28.0.50/lisp/org/ol /home/lailamor/.emacs.d/straight/build/org/ob-ref hides /usr/share/emacs/28.0.50/lisp/org/ob-ref /home/lailamor/.emacs.d/straight/build/org/org-num hides /usr/share/emacs/28.0.50/lisp/org/org-num /home/lailamor/.emacs.d/straight/build/org/ob-python hides /usr/share/emacs/28.0.50/lisp/org/ob-python /home/lailamor/.emacs.d/straight/build/org/ox-odt hides /usr/share/emacs/28.0.50/lisp/org/ox-odt /home/lailamor/.emacs.d/straight/build/org/ob-java hides /usr/share/emacs/28.0.50/lisp/org/ob-java /home/lailamor/.emacs.d/straight/build/org/org-datetree hides /usr/share/emacs/28.0.50/lisp/org/org-datetree /home/lailamor/.emacs.d/straight/build/org/ox hides /usr/share/emacs/28.0.50/lisp/org/ox /home/lailamor/.emacs.d/straight/build/org/ob-fortran hides /usr/share/emacs/28.0.50/lisp/org/ob-fortran /home/lailamor/.emacs.d/straight/build/org/ob-coq hides /usr/share/emacs/28.0.50/lisp/org/ob-coq /home/lailamor/.emacs.d/straight/build/org/org-entities hides /usr/share/emacs/28.0.50/lisp/org/org-entities /home/lailamor/.emacs.d/straight/build/org/ox-texinfo hides /usr/share/emacs/28.0.50/lisp/org/ox-texinfo /home/lailamor/.emacs.d/straight/build/org/ol-gnus hides /usr/share/emacs/28.0.50/lisp/org/ol-gnus /home/lailamor/.emacs.d/straight/build/org/ox-md hides /usr/share/emacs/28.0.50/lisp/org/ox-md /home/lailamor/.emacs.d/straight/build/org/ob-latex hides /usr/share/emacs/28.0.50/lisp/org/ob-latex /home/lailamor/.emacs.d/straight/build/org/ol-eshell hides /usr/share/emacs/28.0.50/lisp/org/ol-eshell /home/lailamor/.emacs.d/straight/build/org/ox-ascii hides /usr/share/emacs/28.0.50/lisp/org/ox-ascii /home/lailamor/.emacs.d/straight/build/org/ob-lisp hides /usr/share/emacs/28.0.50/lisp/org/ob-lisp /home/lailamor/.emacs.d/straight/build/org/ob-calc hides /usr/share/emacs/28.0.50/lisp/org/ob-calc /home/lailamor/.emacs.d/straight/build/org/ob-table hides /usr/share/emacs/28.0.50/lisp/org/ob-table /home/lailamor/.emacs.d/straight/build/org/org-indent hides /usr/share/emacs/28.0.50/lisp/org/org-indent /home/lailamor/.emacs.d/straight/build/org/ob-shell hides /usr/share/emacs/28.0.50/lisp/org/ob-shell /home/lailamor/.emacs.d/straight/build/org/ob-abc hides /usr/share/emacs/28.0.50/lisp/org/ob-abc /home/lailamor/.emacs.d/straight/build/org/ob-R hides /usr/share/emacs/28.0.50/lisp/org/ob-R /home/lailamor/.emacs.d/straight/build/org/ob-octave hides /usr/share/emacs/28.0.50/lisp/org/ob-octave /home/lailamor/.emacs.d/straight/build/org/ob-plantuml hides /usr/share/emacs/28.0.50/lisp/org/ob-plantuml /home/lailamor/.emacs.d/straight/build/org/ob-forth hides /usr/share/emacs/28.0.50/lisp/org/ob-forth /home/lailamor/.emacs.d/straight/build/org/org-crypt hides /usr/share/emacs/28.0.50/lisp/org/org-crypt /home/lailamor/.emacs.d/straight/build/org/org-inlinetask hides /usr/share/emacs/28.0.50/lisp/org/org-inlinetask /home/lailamor/.emacs.d/straight/build/org/ob-processing hides /usr/share/emacs/28.0.50/lisp/org/ob-processing /home/lailamor/.emacs.d/straight/build/org/ol-docview hides /usr/share/emacs/28.0.50/lisp/org/ol-docview /home/lailamor/.emacs.d/straight/build/org/ob-maxima hides /usr/share/emacs/28.0.50/lisp/org/ob-maxima /home/lailamor/.emacs.d/straight/build/org/ob-perl hides /usr/share/emacs/28.0.50/lisp/org/ob-perl /home/lailamor/.emacs.d/straight/build/org/org-pcomplete hides /usr/share/emacs/28.0.50/lisp/org/org-pcomplete /home/lailamor/.emacs.d/straight/build/org/ox-html hides /usr/share/emacs/28.0.50/lisp/org/ox-html /home/lailamor/.emacs.d/straight/build/org/ol-eww hides /usr/share/emacs/28.0.50/lisp/org/ol-eww /home/lailamor/.emacs.d/straight/build/org/org-attach-git hides /usr/share/emacs/28.0.50/lisp/org/org-attach-git /home/lailamor/.emacs.d/straight/build/org/ob hides /usr/share/emacs/28.0.50/lisp/org/ob /home/lailamor/.emacs.d/straight/build/org/org-id hides /usr/share/emacs/28.0.50/lisp/org/org-id /home/lailamor/.emacs.d/straight/build/org/ob-ocaml hides /usr/share/emacs/28.0.50/lisp/org/ob-ocaml /home/lailamor/.emacs.d/straight/build/org/ob-io hides /usr/share/emacs/28.0.50/lisp/org/ob-io /home/lailamor/.emacs.d/straight/build/org/org-attach hides /usr/share/emacs/28.0.50/lisp/org/org-attach /home/lailamor/.emacs.d/straight/build/org/ob-eval hides /usr/share/emacs/28.0.50/lisp/org/ob-eval /home/lailamor/.emacs.d/straight/build/org/ob-groovy hides /usr/share/emacs/28.0.50/lisp/org/ob-groovy /home/lailamor/.emacs.d/straight/build/org/org-protocol hides /usr/share/emacs/28.0.50/lisp/org/org-protocol /home/lailamor/.emacs.d/straight/build/org/ob-tangle hides /usr/share/emacs/28.0.50/lisp/org/ob-tangle /home/lailamor/.emacs.d/straight/build/org/org-footnote hides /usr/share/emacs/28.0.50/lisp/org/org-footnote /home/lailamor/.emacs.d/straight/build/org/ob-lua hides /usr/share/emacs/28.0.50/lisp/org/ob-lua /home/lailamor/.emacs.d/straight/build/org/org-lint hides /usr/share/emacs/28.0.50/lisp/org/org-lint /home/lailamor/.emacs.d/straight/build/org/ob-gnuplot hides /usr/share/emacs/28.0.50/lisp/org/ob-gnuplot /home/lailamor/.emacs.d/straight/build/org/org-timer hides /usr/share/emacs/28.0.50/lisp/org/org-timer /home/lailamor/.emacs.d/straight/build/org/ob-eshell hides /usr/share/emacs/28.0.50/lisp/org/ob-eshell /home/lailamor/.emacs.d/straight/build/org/ob-awk hides /usr/share/emacs/28.0.50/lisp/org/ob-awk /home/lailamor/.emacs.d/straight/build/org/ol-bbdb hides /usr/share/emacs/28.0.50/lisp/org/ol-bbdb /home/lailamor/.emacs.d/straight/build/org/ol-rmail hides /usr/share/emacs/28.0.50/lisp/org/ol-rmail /home/lailamor/.emacs.d/straight/build/org/org-goto hides /usr/share/emacs/28.0.50/lisp/org/org-goto /home/lailamor/.emacs.d/straight/build/org/org-element hides /usr/share/emacs/28.0.50/lisp/org/org-element /home/lailamor/.emacs.d/straight/build/org/org-table hides /usr/share/emacs/28.0.50/lisp/org/org-table /home/lailamor/.emacs.d/straight/build/org/ob-shen hides /usr/share/emacs/28.0.50/lisp/org/ob-shen /home/lailamor/.emacs.d/straight/build/org/org-tempo hides /usr/share/emacs/28.0.50/lisp/org/org-tempo /home/lailamor/.emacs.d/straight/build/org/org-mouse hides /usr/share/emacs/28.0.50/lisp/org/org-mouse /home/lailamor/.emacs.d/straight/build/org/ob-sqlite hides /usr/share/emacs/28.0.50/lisp/org/ob-sqlite /home/lailamor/.emacs.d/straight/build/org/ob-ruby hides /usr/share/emacs/28.0.50/lisp/org/ob-ruby /home/lailamor/.emacs.d/straight/build/org/org-agenda hides /usr/share/emacs/28.0.50/lisp/org/org-agenda /home/lailamor/.emacs.d/straight/build/org/org-list hides /usr/share/emacs/28.0.50/lisp/org/org-list /home/lailamor/.emacs.d/straight/build/org/ob-lob hides /usr/share/emacs/28.0.50/lisp/org/ob-lob /home/lailamor/.emacs.d/straight/build/org/ob-asymptote hides /usr/share/emacs/28.0.50/lisp/org/ob-asymptote /home/lailamor/.emacs.d/straight/build/org/ob-mscgen hides /usr/share/emacs/28.0.50/lisp/org/ob-mscgen /home/lailamor/.emacs.d/straight/build/org/org-ctags hides /usr/share/emacs/28.0.50/lisp/org/org-ctags /home/lailamor/.emacs.d/straight/build/org/org hides /usr/share/emacs/28.0.50/lisp/org/org /home/lailamor/.emacs.d/straight/build/org/org-habit hides /usr/share/emacs/28.0.50/lisp/org/org-habit /home/lailamor/.emacs.d/straight/build/org/org-plot hides /usr/share/emacs/28.0.50/lisp/org/org-plot /home/lailamor/.emacs.d/straight/build/org/ob-haskell hides /usr/share/emacs/28.0.50/lisp/org/ob-haskell /home/lailamor/.emacs.d/straight/build/org/ob-vala hides /usr/share/emacs/28.0.50/lisp/org/ob-vala /home/lailamor/.emacs.d/straight/build/org/org-capture hides /usr/share/emacs/28.0.50/lisp/org/org-capture /home/lailamor/.emacs.d/straight/build/org/ox-latex hides /usr/share/emacs/28.0.50/lisp/org/ox-latex /home/lailamor/.emacs.d/straight/build/org/ob-screen hides /usr/share/emacs/28.0.50/lisp/org/ob-screen /home/lailamor/.emacs.d/straight/build/org/org-feed hides /usr/share/emacs/28.0.50/lisp/org/org-feed /home/lailamor/.emacs.d/straight/build/org/org-duration hides /usr/share/emacs/28.0.50/lisp/org/org-duration /home/lailamor/.emacs.d/straight/build/org/ob-scheme hides /usr/share/emacs/28.0.50/lisp/org/ob-scheme /home/lailamor/.emacs.d/straight/build/org/ob-sql hides /usr/share/emacs/28.0.50/lisp/org/ob-sql /home/lailamor/.emacs.d/straight/build/org/ob-ledger hides /usr/share/emacs/28.0.50/lisp/org/ob-ledger /home/lailamor/.emacs.d/straight/build/org/ob-css hides /usr/share/emacs/28.0.50/lisp/org/ob-css /home/lailamor/.emacs.d/straight/build/org/ol-info hides /usr/share/emacs/28.0.50/lisp/org/ol-info /home/lailamor/.emacs.d/straight/build/org/ob-J hides /usr/share/emacs/28.0.50/lisp/org/ob-J /home/lailamor/.emacs.d/straight/build/org/ob-exp hides /usr/share/emacs/28.0.50/lisp/org/ob-exp /home/lailamor/.emacs.d/straight/build/org/org-install hides /usr/share/emacs/28.0.50/lisp/org/org-install