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 wB0sMpSR12LhRwAAbAwnHQ (envelope-from ) for ; Wed, 20 Jul 2022 07:24:36 +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 uF89MpSR12I6BQEA9RJhRA (envelope-from ) for ; Wed, 20 Jul 2022 07:24:36 +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 7092B35324 for ; Wed, 20 Jul 2022 07:24:36 +0200 (CEST) Received: from localhost ([::1]:39296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oE2CJ-0008IT-K5 for larch@yhetil.org; Wed, 20 Jul 2022 01:24:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oE2Ah-0008IF-Ef for emacs-orgmode@gnu.org; Wed, 20 Jul 2022 01:22:55 -0400 Received: from mail-4027.protonmail.ch ([185.70.40.27]:53257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oE2Ae-00088i-LJ for emacs-orgmode@gnu.org; Wed, 20 Jul 2022 01:22:54 -0400 Date: Wed, 20 Jul 2022 05:22:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658294570; x=1658553770; bh=YY/SoBPdZPXBMDw9IsTNlzJtqkoWkrXqsAv6Z32VXdA=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=pBvt4m8JD5uR3AoAZyne6VLdHPVRkDnOIq4uV6ronDHklDr9QU74u1UFEhnOKqSgQ gvXmFS93gxSXQuZWUX4bZNMOYid706Ppm2b93FC63s6e1IfwbC1hC+y3sC4Ro7pbEu yslkgkjWRgTM5e57eAYNgj2k6hjUqRYlPl6n6ftf06+NZI+LhqzFNnZP4HgMI6XD0N WDo0OWpmzypj9SVoLts2wq3MGRImqc5BS6+zDVoQiNq5+zpJKopvte2oOGH3w93p60 8QiZyCHjpBszhcWX4N1ELo4d7+ntkwDtp9mSJrvpxfM5s4BHojuHTZmgS6R4Mx9FEj 1ha9VqT79ZlZQ== To: "M. Pger" From: "M. Pger" Cc: Tim Cross , emacs-orgmode@gnu.org Subject: Re: no syntax highlighting for code blocks with org-publish Message-ID: In-Reply-To: References: <87zgh7i9vk.fsf@localhost> <864jzegk4q.fsf@gmail.com> <86v8rtfrxs.fsf@gmail.com> <86edygg24y.fsf@gmail.com> Feedback-ID: 44058556:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.27; envelope-from=mpger@protonmail.com; helo=mail-4027.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-To: "M. Pger" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658294676; h=from:from:sender:sender:reply-to: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=YY/SoBPdZPXBMDw9IsTNlzJtqkoWkrXqsAv6Z32VXdA=; b=mAnIqurVuvlJF78ua3hbDC4HnbPHVpPOqoqtg7ZSUQU/ulh0CpPzrmZwxmOTUUMY1NvQ/O ZBmNgvSUnvnIzuKS1OOMjOV3Kn4bYNkyCA5/03xWb32xfB0Dkf9HLPUmK9HuQDnPUHzRcI KLSGVPVHSGTWiSNZawctZAkhoswoRy7YM/Wwrp9GCPaQy48rWx2g/GjtGTYa4WhwWSU+pR LKY0ZfLomhT1GHhRICFkDTrlL1o5pICmCLZFTMvZPD8TwlaLAe9LhfYPSV9PKDAe0LFaGa Nml/EHaAH3wrKvzQIaYm1c8Aq5rEknbsmEU8mrGlurlTLS/Zm1sBPj+X6kok5A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658294676; a=rsa-sha256; cv=none; b=AKL+ILsx7wXhzV5nAjT7Ql842Iopy6riYc+bbfCrHHiPKkxG/O7gukErrx1d+Fpqzi9h3t yR/ggkwISBLE8VxId6ekUFV9d2GvP3YaUDw8/dy5qLHuBuysJnlDnwXGUe2nmgsJ7UbtqX ZujVsl7vlXodlMirwkVSXHCqiv5Y35fTG/86xDx0DYXFit9ZKc4qJhGq3p/2yfw4Q3j3Of opBq7J/mI8++DRystK/6Pt3H6+RGQLol71ZdyUil5O8yB4FS98JBlJzJGFKPgPSS06O3FX 6QAD8y/QMmoeUNGGrJg3XQmrl+JE5WLGBDafmIU5cxnu42vBGD5sE3lpBlXAFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=pBvt4m8J; dmarc=pass (policy=quarantine) header.from=protonmail.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: -7.44 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=pBvt4m8J; dmarc=pass (policy=quarantine) header.from=protonmail.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: 7092B35324 X-Spam-Score: -7.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: onzL9Wj4xg2L Actually, using -nw implies that no theme is loaded, so the face colors 'ex= tracted' by htmlize are the flashy default colors of Emacs in terminal. To have the colors associated with the theme I use, I had to load the theme= through build.el and to change my bash script to: #!/bin/sh emacs -q --load=3Dbuild.el --eval=3D"(eval-buffer)" --eval=3D"(save-buffers= -kill-terminal)" The advantage is of course to have the desired face colors; the minor disad= vantage is to see an Emacs frame appearing, loading the theme and then disa= ppearing. Best, M ------- Original Message ------- On Wednesday, July 20th, 2022 at 1:14 AM, M. Pger wr= ote: > I solved the issue by creating the following bash script in my project fo= lder: > > #!/bin/sh > TERM=3Dxterm export TERM > emacs -q -nw --load=3Dbuild.el --eval=3D"(eval-buffer)" --eval=3D"(save-b= uffers-kill-terminal)" > > This avoid using --script (and thus batch) and thus allows font-lock to b= e enabled when my publishing elisp script (build.el) is run. Thanks to `TER= M=3Dxterm export TERM`, this bash script can be run from the Emacs shell (o= therwise problematic because of the -nw option). > > To have 'extended' syntax highlighting for R, note that I have to load ES= S from build.el. > > Hope this will help! Thanks again for your feedback and your insights. > > Best, > > M > > ------- Original Message ------- > On Wednesday, July 20th, 2022 at 12:33 AM, Tim Cross theophilusx@gmail.co= m wrote: > > > > > "M. Pger" mpger@protonmail.com writes: > > > > > I tried to publish using `M-x org-publish RET RET` = as you suggested, and > > > syntax highlighting was actually implemented, thanks. > > > > > > Actually the problem is coming from the fact that I use `emacs -Q --s= cript build.el` (as a > > > bash script) to publish the project. According to > > > https://list.orgmode.org/AE5693F1-F63D-4383-8840-0FD2DBAAC5D6@gmail.c= om/ (rather old, but > > > apparently this has not changed), font-lock-mode is not enabled by de= fault in --batch > > > mode. Since `--script` "run Emacs in batch mode, like =E2=80=98--batc= h=E2=80=99, and then read and execute > > > the Lisp code in file" (cf the doc), it seems that this is exactly my= problem. > > > > > > A workaround is suggested in > > > https://list.orgmode.org/AE5693F1-F63D-4383-8840-0FD2DBAAC5D6@gmail.c= om/, but > > > unfortunately for me it does not work (yet). I am going to dig furthe= r into that. > > > > I would be interested to hear how you go. I have a use case coming up > > where I need to publish a large number of org files using a batch job, > > so expect to run into the same issue. Right now, I'm still getting my > > head around how to best get a consistent style when the input comes fro= m > > multiple org files from different sources and I want to minimise editin= g > > the sources, plus provide a simple way to update/change the styling > > later.