Ihor Radchenko <yanta...@gmail.com> writes:

> "Christopher M. Miles" <numbch...@gmail.com> writes:
>
>> From the backtrace, seems (buffer-file-name) returned nil, I guess you
>> first created a new buffer and have not saved it to file. That caused it
>> return nil. Not Org Mode problem. Not saving file is a common problem in
>> young programmer as I experienced. No offence.
>
> To clarify, the problem is in the user-defined hook:
>
>     (add-hook 'latex-mode-hook (lambda()
>                                (set (make-local-variable 'compile-command)
>                                     (concat "lualatex " (shell-quote-argument 
> (buffer-file-name))))))
>
> The hook does not work when (buffer-file-name) returns nil, which is
> exactly what happens when Org mode tries to fontify the source block.
> Org does it inside a temporary buffer not associated with any real file.
>

That's why you are senior developer, I haven't fount the hook in his error 
report.
Good job.

> One way to fix the problem would be
>
>     (add-hook 'latex-mode-hook (lambda()
>                                  (when (buffer-file-name)
>                                (set (make-local-variable 'compile-command)
>                                     (concat "lualatex " (shell-quote-argument 
> (buffer-file-name)))))))
>
> Best,
> Ihor


-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

Attachment: signature.asc
Description: PGP signature

Reply via email to