all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: "David Lukeš" <dafydd.lukes@gmail.com>
Cc: Timothy <orgmode@tec.tecosaur.net>,
	 Max Nikulin <manikulin@gmail.com>,
	emacs-orgmode@gnu.org
Subject: Re: Code block syntax highlighting in async export
Date: Mon, 03 Oct 2022 21:58:37 +0800	[thread overview]
Message-ID: <87a66dvwj6.fsf@localhost> (raw)
In-Reply-To: <CAEPTPEwT4t3ve-ZudS2jUUP7NK-LYcV8wNrY5eqwiQqxofn+ng@mail.gmail.com>

David Lukeš <dafydd.lukes@gmail.com> writes:

>> I'll investigate if I can leverage any of the workarounds mentioned.
>
> So, for batch processing, avoiding --batch or --script and just using
> --load with a script that either ends by killing Emacs, or killing it
> via an additional --eval, works, i.e. syntax highlighting uses colors.
> This was suggested in [1]. As [2] points out, adding -nw removes the
> colors, and so does adding --daemon (suggested in [3]), so don't do
> either.
>
> Enabling font-lock-mode manually and defining all the fontification
> (see [4]) sounds like it would also work, but honestly, that's too
> involved, so I didn't try it.

To clarify, the latest Org version should not care about font-lock being
enabled. `font-lock-ensure' usually works in batch mode as well even
though font-lock-mode is technically disabled.

Except when it does not. Some major modes do fontification awkwardly,
which can be considered a bug in those major modes.
You can refer to https://yhetil.org/emacs-bugs/874jzdhh5m.fsf@localhost/

> Using an external colorizer (as shown in [5]), seems like a good
> alternative, if non-Emacs dependencies are acceptable.
>
> These two last options can also be made to work with async export (my
> original question), where you don't have control over how the batch
> instance of Emacs is invoked.
>
>> There’s a decent chance that `engrave-faces' (a package of mine that can now be
>> used for code blocks in LaTeX) will work in batch mode. Integrating it with
>> `ox-html', `ox-ansii', and `ox-odt' are all (distantly) on my todo list.
>
> Sounds great! If it will work in regular batch mode, then it should
> work with async as well :)

I would not be so sure. If the issue is major-mode not doing
fontification in batch mode, engrave-faces cannot do much.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2022-10-03 14:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02  3:24 Code block syntax highlighting in async export David Lukeš
2022-10-02  7:24 ` Ihor Radchenko
2022-10-02 12:13   ` Max Nikulin
2022-10-03 12:08     ` David Lukeš
2022-10-03 12:42       ` Timothy
2022-10-03 13:22         ` David Lukeš
2022-10-03 13:58           ` Ihor Radchenko [this message]
2022-10-03 14:40             ` Timothy
2022-10-04  4:10               ` Ihor Radchenko
2022-10-04  4:14                 ` Timothy
2022-10-03 15:57       ` Max Nikulin
2022-10-03 19:32         ` David Lukeš
2022-10-04  4:04       ` Ihor Radchenko

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a66dvwj6.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=dafydd.lukes@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    --cc=orgmode@tec.tecosaur.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.