From: "Christopher M. Miles" <numbchild@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: numbchild@gmail.com, "Marvin Gülker" <post+orgmodeml@guelker.eu>,
emacs-orgmode@gnu.org
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 [thread overview]
Message-ID: <m21qwc3ivb.fsf@numbchild@gmail.com> (raw)
In-Reply-To: <87czfye6ty.fsf@localhost>
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
prev parent reply other threads:[~2022-05-29 7:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 11:02 [BUG] Setting compile command causes fontification error [9.5 (release_9.5-661-g5e0afb @ /home/quintus/.emacs.d/org-mode/lisp/)] Marvin Gülker
2022-05-28 1:52 ` Christopher M. Miles
[not found] ` <629180cb.1c69fb81.4263.8e2fSMTPIN_ADDED_BROKEN@mx.google.com>
2022-05-28 2:20 ` Ihor Radchenko
2022-05-29 7:17 ` Christopher M. Miles [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m21qwc3ivb.fsf@numbchild@gmail.com \
--to=numbchild@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=post+orgmodeml@guelker.eu \
--cc=yantar92@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).