Re: Bug: asynchronous export (org-mode 9.4.4, emacs 27.2)

2022-03-08 Thread M. Pger
Ok, thanks a lot for your suggestions. It seems that the problem comes from
poly-org mode. I've followed the following steps (copy-paste from my notes,
sorry for the wording):

+ I double-check the version of org (9.5.2, ok) and I check the function
=org-latex-export-to-pdf=. This is ok since the fix is there:
#+begin_example
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'latex outfile
async subtreep visible-only body-only ext-plist
#'org-latex-compile)))
#+end_example

+ Same error as before when trying to asynchronously export: the =*Org Export
Process*= buffer still gives ~Invalid read syntax: "#"~

+ However, I do these double-checks with my init file loaded. Contrary to ~emacs
-Q~, when I use ~M-x toggle-debug-on-error~ no =*Backtrace*= buffer opens. I
conclude that maybe something linked to my init file is interfering with the
process, preventing the debugger to correctly capture the error.

+ I thus decide to remove everything from my init file (except ~(use-package
org)~) and to try again. However, the issue is still there and the debugger
does not detect it. I note that =poly-org= mode is still (automatically)
loaded at startup, and I decide to use my other computer and to start with a
brand new installation of emacs.

+ On this new emacs version, the only package I install is =org=, in order to
get version 9.5.2. This time, it works: I am able to asynchronously export.

+ I have the impression that having =poly-org= mode installed could play a role
in my problem. I thus decide to get the init file from my other computer and
load it on my new installation of emacs, *except the =polymode= part*. And it
actually works: I am able to asynchronously export.

+ As a final test, I include the =polymode= part of my init file, and restart
Emacs. This time the asynchronous export process fails.

What I conclude from that (correct me if I am wrong): the issue should come from
=polymode= which, once installed, somehow modifies the standard org-export
function/process. I am going to report this issue on the polymode github.

Best,
MP

--- Original Message ---
On Tuesday, March 8th, 2022 at 3:51 PM, Sébastien Miquel 
 wrote:

> M. Pger writes:
>
>> Thx for your answer. I've just upgraded org-mode (elpa way) and I am now 
>> using version 9.5.2.
>
> Version 9.5.2 should indeed contain the fix I had in mind :
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c91271297dbbfc831874d7880343603881bdac9c
>
>> Unfortunately this does not work, I still end up with:
>>
>> Invalid read syntax: "#"
>
> Can you check that the right version of org-mode is picked-up, with
> `describe-function` `org-latex-export-to-pdf`, find the function
> definition by following the `ox-latex.el` link, and check that the
> source contains the linked patch ?
>
>> I would like to try the alternative, i.e. disabling native-comp (for the 
>> export function I guess). Would you mind telling me how to do that?
>
> `describe-function` should also tell you whether the function is
> native compiled. If it is, you can temporarily 'uncompile' by
> evaluating its source code. By disabling native compilation I meant as
> a compile flag, if you've built emacs from source. I cannot find an
> easy way to prevent native compilation of a single package/function.
>
> --
> Sébastien Miquel

Re: Bug: asynchronous export (org-mode 9.4.4, emacs 27.2)

2022-03-08 Thread Sébastien Miquel

M. Pger writes:
Thx for your answer. I've just upgraded org-mode (elpa way) and I am 
now using version 9.5.2.


Version 9.5.2 should indeed contain the fix I had in mind :

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c91271297dbbfc831874d7880343603881bdac9c


Unfortunately this does not work, I still end up with:

Invalid read syntax: "#"

Can you check that the right version of org-mode is picked-up, with
`describe-function` `org-latex-export-to-pdf`, find the function
definition by following the `ox-latex.el` link, and check that the
source contains the linked patch ?
I would like to try the alternative, i.e. disabling native-comp (for 
the export function I guess). Would you mind telling me how to do that?


`describe-function` should also tell you whether the function is
native compiled. If it is, you can temporarily 'uncompile' by
evaluating its source code. By disabling native compilation I meant as
a compile flag, if you've built emacs from source. I cannot find an
easy way to prevent native compilation of a single package/function.

--
Sébastien Miquel


Re: Bug: asynchronous export (org-mode 9.4.4, emacs 27.2)

2022-03-08 Thread M. Pger
Hi,
Thx for your answer. I've just upgraded org-mode (elpa way) and I am now using 
version 9.5.2.

Unfortunately this does not work, I still end up with:

Invalid read syntax: "#"

I would like to try the alternative, i.e. disabling native-comp (for the export 
function I guess). Would you mind telling me how to do that?

Best,
MP

--- Original Message ---
On Tuesday, March 8th, 2022 at 2:30 PM, Sébastien Miquel 
 wrote:

> Hi,
>
> M. Pger writes:
>
>> When trying to asynchronously export, I get the following error: "Process 
>> `org-export-process' exited abnormally".
>>
>> The *Org Export Process* buffer gives the following: Invalid read syntax: 
>> "#".
>
> A similar issue was fixed in master. Try the latest version of org-mode.
>
> Alternatively, disabling native-comp should also fix this.
>
> Regards,
>
> --
> Sébastien Miquel

Re: Bug: asynchronous export (org-mode 9.4.4, emacs 27.2)

2022-03-08 Thread Sébastien Miquel

Hi,

M. Pger writes:
When trying to asynchronously export, I get the following error: 
"Process `org-export-process'exited abnormally".


The *Org Export Process* buffer gives the following: Invalid read 
syntax: "#".


A similar issue was fixed in master. Try the latest version of org-mode.

Alternatively, disabling native-comp should also fix this.

Regards,

--
Sébastien Miquel


Bug: asynchronous export (org-mode 9.4.4, emacs 27.2)

2022-03-08 Thread M. Pger
Dear All,

When trying to asynchronously export, I get the following error: "Process 
`org-export-process' exited abnormally".

The *Org Export Process* buffer gives the following: Invalid read syntax: "#".

I tried setting org-export-async-init-file to a minimal init file, but the 
problem remains. I also tried with a minimal .org file to export (no code 
blocks, just some headings and some text), but this does not solve the problem.

I used emacs -Q to be sure that the problem was not coming from my init file. I 
started the debugger, and here is the content of the backtrace buffer:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
make-process(:name "org-export-process" :buffer "*Org Export Process*" :command 
("/usr/local/bin/emacs" "--batch" "-l" nil "-l" 
"/tmp/org-export-processRMXAfq"))
apply(make-process (:name "org-export-process" :buffer "*Org Export Process*" 
:command ("/usr/local/bin/emacs" "--batch" "-l" nil "-l" 
"/tmp/org-export-processRMXAfq")))
start-process("org-export-process" "*Org Export Process*" 
"/usr/local/bin/emacs" "--batch" "-l" nil "-l" "/tmp/org-export-processRMXAfq")

apply(start-process ("org-export-process" "*Org Export Process*" 
"/usr/local/bin/emacs" "--batch" "-l" nil "-l" "/tmp/org-export-processRMXAfq"))
org-export-to-file(latex "bug_asynchronous_export.tex" t nil nil nil nil 
#f(compiled-function (file) #