From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OGFENkI712KaGQEAbAwnHQ (envelope-from ) for ; Wed, 20 Jul 2022 01:16:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ePtuNkI712LYAAAA9RJhRA (envelope-from ) for ; Wed, 20 Jul 2022 01:16:18 +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 7C25E1CC3E for ; Wed, 20 Jul 2022 01:16:18 +0200 (CEST) Received: from localhost ([::1]:50674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDwRs-0000uy-Hp for larch@yhetil.org; Tue, 19 Jul 2022 19:16:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDwR4-0000um-EG for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 19:15:26 -0400 Received: from mail-4325.protonmail.ch ([185.70.43.25]:53257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDwQn-0000yF-Hg for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 19:15:25 -0400 Date: Tue, 19 Jul 2022 23:14:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658272500; x=1658531700; bh=M/82zH2ZePGiVG/1U7pSxdOFZHNXt0eRWYQfSNPgomo=; 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=NxjhVWYrsWy5Vm5oiUfA7dQddAwV+IPkLF9orDZiR6GnX2cT8ELcuT5agwAYlFIGN zXNeY1FgnjgSIG+gEtu1QGHh9J8G28F8gIoxri1tKhxKrKRtXhg3CeyF/lXCx+zCbz gJUJAnDUk15fMmKAV1T9P+2bK9P43626HD71xH+fiaeHITCfIF+lUmbajlei+T+ih9 xKJ6fKv9963BipHhnixarfT/RhjP5OuFhyQDnTeVgZTKx4I5+0+v/5mNApWKxRhohp +04VjlUaklElywGSyRediteaHkhmUa6+7Vss9w7U/ljOxxjiSRA0oG8aE5MfBgNR2T 6Xy06b+mKwjvw== To: Tim Cross From: "M. Pger" Cc: emacs-orgmode@gnu.org Subject: Re: no syntax highlighting for code blocks with org-publish Message-ID: In-Reply-To: <86edygg24y.fsf@gmail.com> 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.43.25; envelope-from=mpger@protonmail.com; helo=mail-4325.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, 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=1658272578; 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=M/82zH2ZePGiVG/1U7pSxdOFZHNXt0eRWYQfSNPgomo=; b=EZV94TFFK/gAvS3s1lWpuH9LHr/wOno1B9bnnsXdJROcRu7xj8EgqdYJNZ2Acc4aXQpzL1 4QFPIVCkDgc30QegA+wsf+l4ay7bbS9n8DXOkdt3Vi6m2XKDpDQxya+Y35OoeMaUYkbSgD EOBO3MN1Z5KtPcYc+ezTniSaF1q2WMiDPmL6bb8Gs664JbjK1GEgdkSkEE2pjFSbeFqol3 52tKmLT/f5zdeXa4VJQYxA0zxQM6r35F+j3VThkukjqvNfYsTBO6nbGAjRLaUZvewhPxHu CNzYYs/4HuF2wRCvPBPzYGwbNaSLGAii1hfgTgWeCFSqdfdHdRXAuDFuz1T7gQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658272578; a=rsa-sha256; cv=none; b=lIVvJxmhH9ZXL+e5y86UHAECv38vx58dZcC7BUC66jKesndBOjQgua59WDtmfLMP/JTHPK y041zQZYzf3leIq327U7oLcFDai0+J1BvFfdCW9foBwKprRP6LXfkpCYoIYUHDpJG2EGNi 0+06iSMa+Ot3G0s8f/0G9TCF/hxBwzSSgOmSTYsPqiD5DxTFj0G30OOoJC2mFH65hs1ADD VvN9XJni67a7Z4qL+OZJ8sE5u+RUrWurckHu5RfysxP0jbmE/qBBdHoXdi4DhLDGHqIIoB qmaBw4nrgkwR5bVAoB+kwata7OtcQGf1tLufokm+tlm8crwOH6DoTh2HSAu81Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=NxjhVWYr; 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: -9.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=NxjhVWYr; 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: 7C25E1CC3E X-Spam-Score: -9.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: oF+UOvJzBCGF I solved the issue by creating the following bash script in my project fold= er: #!/bin/sh TERM=3Dxterm export TERM emacs -q -nw --load=3Dbuild.el --eval=3D"(eval-buffer)" --eval=3D"(save-buf= fers-kill-terminal)" This avoid using --script (and thus batch) and thus allows font-lock to be = enabled when my publishing elisp script (build.el) is run. Thanks to `TERM= =3Dxterm export TERM`, this bash script can be run from the Emacs shell (ot= herwise problematic because of the -nw option). To have 'extended' syntax highlighting for R, note that I have to load ESS = 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 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 --scr= ipt build.el` (as a > > bash script) to publish the project. According to > > https://list.orgmode.org/AE5693F1-F63D-4383-8840-0FD2DBAAC5D6@gmail.com= / (rather old, but > > apparently this has not changed), font-lock-mode is not enabled by defa= ult in --batch > > mode. Since `--script` "run Emacs in batch mode, like =E2=80=98--batch= =E2=80=99, and then read and execute > > the Lisp code in file" (cf the doc), it seems that this is exactly my p= roblem. > > > > A workaround is suggested in > > https://list.orgmode.org/AE5693F1-F63D-4383-8840-0FD2DBAAC5D6@gmail.com= /, but > > unfortunately for me it does not work (yet). I am going to dig further = 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 from > multiple org files from different sources and I want to minimise editing > the sources, plus provide a simple way to update/change the styling > later.