From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AN3SBNHrOmM0DwEAbAwnHQ (envelope-from ) for ; Mon, 03 Oct 2022 16:04:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kGvhBNHrOmP6EwEA9RJhRA (envelope-from ) for ; Mon, 03 Oct 2022 16:04:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8B6E53F8DD for ; Mon, 3 Oct 2022 16:04:00 +0200 (CEST) Received: from localhost ([::1]:57928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofM33-0006pM-FX for larch@yhetil.org; Mon, 03 Oct 2022 10:03:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofLx6-0003P7-EM for emacs-orgmode@gnu.org; Mon, 03 Oct 2022 09:57:48 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:41697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofLx4-0004EY-OL for emacs-orgmode@gnu.org; Mon, 03 Oct 2022 09:57:48 -0400 Received: by mail-pf1-x42a.google.com with SMTP id g130so9683349pfb.8 for ; Mon, 03 Oct 2022 06:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=HRCUCA6bjZXx0C3khe1NGMjTI96Y4FxCWtq4g0QBJ6U=; b=g3kWGz7zQ1rU5PFTiriyu1iSY8igyTH8evyU8k5EeEZOBakjWGefGfFgHLZjosHjXv jEP+kLJbhmAoHV+aHdikq6itdSnbQ1j71wzPeks98cAd8ZKB3wKxv8Gp2fRTHaGtdpTR qQVgqRpwWq37frIVtGKsIl6BCfwXp58JQ6TYV+2/6e0dsL42+3Z7ltSe9UF1+xUFDY3p d60TsSTs8NL/1KGh4CmagCU2EK4DM9KtE38XCPMSr09F74SPQAoz5o96Kfo5iVe0gyUp liZHOaGAeuOymVyu9YniLL1biRm39LLMWveT605w7/MI/cMPvd4DG3/7c2P0Uf/11fS0 UoQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=HRCUCA6bjZXx0C3khe1NGMjTI96Y4FxCWtq4g0QBJ6U=; b=avMRkxSE47Jk7ZUVx0lHq6WeZcfBDCncqyMPrq+2CAhJM9hzMnO5yWP3ddG/vU6Qwa OkmwHgXBqZ/8koq+e9V4gMLYGvalRdTIHzwvGV6WPlFwosz9e+qxEdJ8yMBTynvnZR/f IARbyZlAWqNbu1DLYKE2wehPDqSZLDnmoINw3T30YDugj/w6OOXshjTbtiGoUh1rsk3T SlpxHdv2Datvfy0VlKDkAdRRRBiz81RC0LXxt+0sV+Qe3SrSbo1LhjvCf1G6FEy2YxsK ArhaQp3OALRX83cHM56WyFJr2CXDqYarHrE7Be4E0z9Ok+bUtSZeTqcS6b+fU/wFzCVz 9OhQ== X-Gm-Message-State: ACrzQf1yzNu3uNr7HvuRl0YexSTlP3GtsUrsU0uzDF1KkYX2dIn53tKo ++GxhuSVYFLf+x74RH3F8sA= X-Google-Smtp-Source: AMsMyM50ioZZOPcMxAfCWWwO2K64yXN+n7wfTUTnAsFGbGdtNfLPmIGZX1jgaoVLHDUw25iafMujtA== X-Received: by 2002:a62:2985:0:b0:544:77d4:f43b with SMTP id p127-20020a622985000000b0054477d4f43bmr22923305pfp.9.1664805465316; Mon, 03 Oct 2022 06:57:45 -0700 (PDT) Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id m7-20020a170902bb8700b0017bdfbfcf8dsm7213629pls.63.2022.10.03.06.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 06:57:44 -0700 (PDT) From: Ihor Radchenko To: David =?utf-8?Q?Luke=C5=A1?= Cc: Timothy , Max Nikulin , emacs-orgmode@gnu.org Subject: Re: Code block syntax highlighting in async export In-Reply-To: References: <878rly1ydl.fsf@localhost> <87tu4ldqky.fsf@tec.tecosaur.net> Date: Mon, 03 Oct 2022 21:58:37 +0800 Message-ID: <87a66dvwj6.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664805840; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=HRCUCA6bjZXx0C3khe1NGMjTI96Y4FxCWtq4g0QBJ6U=; b=UfltgK3nkZeUKCTzUrDtYiQWspv2JPvbeBDMa3WUOMT2oRkVR0nzmXC0YnITAiZX9nucy1 14Hp1ZSa+81bvtyOGrSeWtjHIa4J3qmySBrojvIV+tvhaIpoPaiD/CTM/rolVrFOwdLPYR BWLk6PVBnGs0ifqsHqAMFUYExgHNa25PD+HRwv2B9DT3tkJg+l98/VFmR2cG/WDM0hC+uO gVnNG4OvTeeFwvqh7Tbb0iKHy+BnluwECwuAIDsz2GN3Qoby6Jqg/14NN5hb93/eSft/2n DX08ldCkzcacHtTsvWbFhy4xXOAOgCwueFlG6jLqglABjcEbI6bYbtWXiO/tYw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664805840; a=rsa-sha256; cv=none; b=TbWNSvexlC4KMVJClthHdILdoJX9P90G01J+RO/yP//PRJiqZy+JGLkxetGZBCCRoTCwZ/ bh3z3ae1MVNZ5WUA7uLZu3fOcxuzb2rDWC2lVqm9QBnm6+21Qvh0qgsxlJtTTAKkvab/bl DECfVbgleFfPBdR5SvDGNow+B77jG2mZP1a6yGeMIChHKr5P3u3HC/gjtaLJTh3VOnNvit +l7/BrLUMHjtv2qMsmdeXpGeiYCQyljCP3Kh9lZ0asr4tvuVLKjDSW9OxHtm5nAuwYEm9s GqEPabnnK3fkWL3A6iSgOGXU2ODv4QXDepRvh2OqKPB1fC/NRi8n/mnG+V6hVQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=g3kWGz7z; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.85 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=g3kWGz7z; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8B6E53F8DD X-Spam-Score: -1.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: o83QiCCR+hpB David Luke=C5=A1 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=E2=80=99s 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 w= ith >> `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. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at