emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [BUG] Setting compile command causes fontification error [9.5 (relea


From: Christopher M. Miles
Subject: Re: [BUG] Setting compile command causes fontification error [9.5 (release_9.5-661-g5e0afb @ /home/quintus/.emacs.d/org-mode/lisp/)]
Date: Sun, 29 May 2022 15:17:28 +0800
User-agent: mu4e 1.6.10; emacs 28.1

Ihor Radchenko <yantar92@gmail.com> writes:

> "Christopher M. Miles" <numbchild@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

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