From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8EAiL6x0i2dNAwEAe85BDQ:P1 (envelope-from ) for ; Sat, 18 Jan 2025 09:30:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8EAiL6x0i2dNAwEAe85BDQ (envelope-from ) for ; Sat, 18 Jan 2025 10:30:20 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="I8M/0BkX"; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1737192620; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DjDO6PvkppQ4l/ZsdVUhwde1I5+4nideiJuSZN+SlGs=; b=n+rmUVhLzKFk5mI3aOXEyaQw3OAFvpJoSFKHxS4KTdEysD3q7O4QqrQMZEUppZI6szTzQy fLb32ARsnWga+BDVniJek15YA4u6pEEvGbotByO4CTwahxmmxubbIp2tiS7RQdffXX76sr p/9+zXPwGJ2cr4FEhjgqYFYhERsnwFtiilxU84d9ZwIxzgYuu/DQrDTMtix9Gr6VS8AS0v TxxI6MQGNBF4iG0MiJ7W8U3cG7sEg6mRE2gIa8Uh6cm2na4ENgajaNR6H5X5ZoT5lENkWt tGe/PGuRI5n1/uZdHcEW+KL3bN8KXuHE5Pwr4UL2WlMWQm+lLBquwXPRJtD+OQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="I8M/0BkX"; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1737192620; a=rsa-sha256; cv=none; b=cpa/pdkzPAhWaAFtnCC3jUcZVI65ECrntoGChT6zARCg3sM8G0DKPgSrXJkmGeY1RZlEOg kIP0X4wRBivv6Q0+VAfgR3CVsOxqpzoxLhes6Ck5I0FKIeCV2fAbQhVl+4ih9NG2qIIpiA Pel6R/MmhryHjw0Z+rzPfXrLTSSqzgISFNpmppSGrqMcGBEEw1pcAas1iFOJ8KHqbSOYk9 6GHr3gQ4lW8hm1y5NADTwq/vYGKouNm8P2/+OJZnowv73Mj9yauc9t2V9s9mt+bbCT17qf tzLbodmZgmTN74JhRD8DSLzekH9qOcp67q3F5fvSlGT9iCWlfpnDbsj/FHDd5A== 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 4353098E84 for ; Sat, 18 Jan 2025 10:30:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZ58z-0004qi-PF; Sat, 18 Jan 2025 04:29:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tZ58y-0004qX-CC for emacs-orgmode@gnu.org; Sat, 18 Jan 2025 04:29:28 -0500 Received: from mail-vk1-xa2d.google.com ([2607:f8b0:4864:20::a2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZ58w-0003ZS-Ht for emacs-orgmode@gnu.org; Sat, 18 Jan 2025 04:29:28 -0500 Received: by mail-vk1-xa2d.google.com with SMTP id 71dfb90a1353d-51c68d851feso842486e0c.2 for ; Sat, 18 Jan 2025 01:29:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737192565; x=1737797365; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DjDO6PvkppQ4l/ZsdVUhwde1I5+4nideiJuSZN+SlGs=; b=I8M/0BkXJSo2B+OBx43afIaqIAmKHKSE6ax/5omZ98jQC4/Qr2hzied4D9/paBt5ei deMA8+0RAgDCuwRBYn4VDGg5R8i/njmXFioB8U723ApIQcYCM9b/RTI1zXMbDyxLq5QJ cWYXpnzZEacDAPVbloxE8uU4LpgMNlQW9pOmhZvoeVl2joHlK/J/f9z1LKw0o3Rzqrqc 82rtXk4evAavBYZDG88KmXKXuXOFIV+Cmm/KYx8btAUNNU9NpxpqzA9CpVP8ij0P/837 RkIlA0RLgBSjLZsHWXvufR3Qgqq5MUhdnpxcHwyCfIfjRyNjCYd8Q7DnA3KSfslBqr9B IPoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737192565; x=1737797365; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DjDO6PvkppQ4l/ZsdVUhwde1I5+4nideiJuSZN+SlGs=; b=nTelHKIpVE3bJx4bdGq2wPz4oxLsvH+AGIMWD+XTSPWAGLHnHdtIBYRPOJb181/8Ku O8KHgyoQJxKDeWxwEcPIVsnRRjgtFbMFl8EUtKXu8QIutHGN5qMlH6+9GRdx9f3D4NDm g4Ww9usgaZd3nVAoZ7zaWsSzOkhioIwmU95Y+ofaWDKJch6iP4Lv35NEOf9v5I/D6XRX NZWFat6b2PFb3prS0pdP6qjPYfRY1BH9XY0fOQfFr8cfwnG5WEqZs/gkjMRXpwOXB0rK ddrNPUVU/5prYEBdjedXxEdxsaG+xcrbFATiuanqsiO5szmYUcW5tp2tIue9aWJr+uDY BZnA== X-Gm-Message-State: AOJu0YxJLj/9ZAI4PdCBPa5EWk/vibEh/gWuDAYGwAe9FZOlruxT/u9r TFHn9qWU0V10HOMDrn27v/zBmzSlgho8PjwuhtHwNDDLE9ZQVLK8NIAoXrZm90L0kIjj4B7tHyA 9dwS/3fm3k7H3jbyG5xSIoErTIajKYQ== X-Gm-Gg: ASbGnctFBCUdijlz18bdrWZtKLUqlty0v/bkPZzGji2tWKh8xgwtboztEMLz535msRX WgXhkYzVUJrayXADEuCsev8mEjZjjpI4m7QIRsQgohPjKQaWMVE0= X-Google-Smtp-Source: AGHT+IGBzO9OwuytJa1x/47K4ePDNRjzpne81Kr4WuK4I7mV+cLzoSxV/AYjTMEAFcrQnmbLO6tZkjR6wWYMGBIwgTc= X-Received: by 2002:a05:6122:370f:b0:514:eeba:517 with SMTP id 71dfb90a1353d-51d5b3768ccmr5392201e0c.10.1737192565277; Sat, 18 Jan 2025 01:29:25 -0800 (PST) MIME-Version: 1.0 References: <87sepgr34g.fsf@localhost> In-Reply-To: <87sepgr34g.fsf@localhost> From: Ship Mints Date: Sat, 18 Jan 2025 04:27:51 -0500 X-Gm-Features: AbW1kvYFgh2-gSy70MsGDuEKP9wZrE-u5Ch3VSbDJNFDfqLqXrdD6nCdcI2vSoo Message-ID: Subject: Re: Add org-src-is-fontify-buffer-p (patch attached) To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000c28b50062bf7a98c" Received-SPF: pass client-ip=2607:f8b0:4864:20::a2d; envelope-from=shipmints@gmail.com; helo=mail-vk1-xa2d.google.com 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, HTML_MESSAGE=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -8.50 X-Spam-Score: -8.50 X-Migadu-Queue-Id: 4353098E84 X-Migadu-Scanner: mx10.migadu.com X-TUID: y6is804aVf8C --000000000000c28b50062bf7a98c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eglot was the first request cited. For python programmers that rely on per project/directory-local or per-buffer virtual environment set up, this can be heavier than needed just for fontification. I enable eglot manually, but I do use python virtual environments and would disable initialization in fontification buffers. I'd prefer a more generic interface than propagating org internals like the format of the fortification buffer name. It's what I submitted to the markdown repo also. The buffer name scheme can change in the future without impacting this feature. -Stephane On Sat, Jan 18, 2025 at 2:27=E2=80=AFAM Ihor Radchenko wrote: > Ship Mints writes: > > > I've added the predicate function org-src-is-fontify-buffer-p which can > be > > used in a prog-mode hook to avoid resource-intensive features such as > eglot > > inside a fontification buffer. This short example should make it clear. > > > > (defun my/emacs-lisp-hook () > > (unless (and (featurep 'org) (org-src-is-fontify-buffer-p)) > > (eglot-ensure))) > > Thanks! > > Do you have other examples where the new predicate could be useful apart > from eglot? For eglot specifically, one can do a much simpler test - > check for `buffer-file-name'. > > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at . > Support Org development at , > or support my work at > --000000000000c28b50062bf7a98c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Eglot was the first request cited. For python programmers that rely on p= er project/directory-local or per-buffer virtual environment set up, this c= an be heavier than needed just for fontification. I enable eglot manually, = but I do use python virtual environments and would disable=C2=A0initializat= ion in fontification buffers.

I'd prefer a more generic interface than=C2=A0propagat= ing org internals like the format of the fortification=C2=A0buffer name. It= 's what I submitted to the markdown repo also. The buffer name scheme c= an change in the future without impacting this feature.

-Stephane

On Sat, Jan 18, 2025 at 2:27=E2=80=AFAM Ihor Radchenko <yantar92@posteo.net> wrote:
Ship Mints <shipmints@gmail.com> wri= tes:

> I've added the predicate function org-src-is-fontify-buffer-p whic= h can be
> used in a prog-mode hook to avoid resource-intensive features such as = eglot
> inside a fontification buffer. This short example should make it clear= .
>
> (defun my/emacs-lisp-hook ()
>=C2=A0 =C2=A0(unless (and (featurep 'org) (org-src-is-fontify-buffe= r-p))
>=C2=A0 =C2=A0 =C2=A0(eglot-ensure)))

Thanks!

Do you have other examples where the new predicate could be useful apart from eglot? For eglot specifically, one can do a much simpler test -
check for `buffer-file-name'.

--
Ihor Radchenko // yantar92,
Org mode maintainer,
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>
--000000000000c28b50062bf7a98c--