emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[kisara.moe] Re: [kisara.moe] Re: [kisara.moe] Bug: async latex export f


From: Mohsin Kaleem
Subject: [kisara.moe] Re: [kisara.moe] Re: [kisara.moe] Bug: async latex export fails due to post-process lambda [9.4.4 (release_9.4.4-188-ga8df76 @ /home/mohkale/.config/emacs/lisp/straight/build/org/)]
Date: Sun, 30 May 2021 17:43:08 +0100

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> mohsin kaleem <mohkale@kisara.moe> writes:
>
>> I've been trying to get async-export setup for the past day and I've
>> found it keeps failing due to an unexpected # in the compilation script
>> generated by org-export.
>>
>> After doing a little debugging I found the script contained
>> ~(funcall '#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_77> 
>> "foo.tex")~
>> so at some point in the export org-mode is including an evaluated lambda
>> when a quoted one is required.
>
> Your bug sounds plausible, but I cannot reproduce it.

Hmmm... that's strange. Running:
1. `emacs -nw`
2. `C-x C-f ~/foo.org`
3. Insert some text
4. `M-: (setq org-export-in-background t)`
5. `M-: (setq org-export-async-init-file "/path/to/some/file.el")` For some 
reason async export fails when this is nil.
6. `M-x org-export-dispatch lp`

Ends with the export process failing and the `*Org Export Process*`
buffer containing:
```
Loading /home/mohkale/.config/emacs/early-init.el (source)...
Debugger entered--Lisp error: (invalid-read-syntax "#" 1 0)
  read(#<buffer  *load*>)
  eval-buffer(#<buffer  *load*> nil "/tmp/org-export-processv2hIqF" nil t)  ; 
Reading at buffer position 3743
  load-with-code-conversion("/tmp/org-export-processv2hIqF" 
"/tmp/org-export-processv2hIqF" nil t)
  load("/tmp/org-export-processv2hIqF" nil t)
  command-line-1(("-l" "/home/mohkale/.config/emacs/lisp/+org-async-init.e..." 
"-l" "/tmp/org-export-processv2hIqF"))
  command-line()
  normal-top-level()
```

This might be related to newer versions of emacs and how they treat
lambdas internally, could you retry with emacs 28.0.5 if you still can't
reproduce it.

>> -      (lambda (file) (org-latex-compile file)))))
>> +      `(lambda (file) (org-latex-compile file)))))
>
> Anyhow, would #'org-latex-compile fix the issue, too?

Apologies if my explanation wasn't sufficient, I've attached a copy of
the build script that org-export generates to this email.

Attachment: build.el
Description: build script

At the very end of the script you can see where the callback is called.

The issue is fixed because with the quoted lambda when org tries to
write it into the async build script (I.E. `(message "%s" callback-function)`)
it'll be outputted verbatim (as a lisp expression).
Instead my emacs atm represents the lambda as some anonymous function object
(resembling `#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_77>`)
so when org tries to print it out it'll just print this garbage
representation instead of the function it should call.

---
Mohsin K.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]