From: Ship Mints <shipmints@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Add org-src-is-fontify-buffer-p (patch attached)
Date: Sat, 18 Jan 2025 04:27:51 -0500 [thread overview]
Message-ID: <CAN+1HbpDSZUqgFsnNgUzkCT5mNoWCy0Fqpgjt7bGF2sBT_SWcg@mail.gmail.com> (raw)
In-Reply-To: <87sepgr34g.fsf@localhost>
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
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 AM Ihor Radchenko <yantar92@posteo.net> wrote:
> Ship Mints <shipmints@gmail.com> 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 <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>
[-- Attachment #2: Type: text/html, Size: 2540 bytes --]
next prev parent reply other threads:[~2025-01-18 9:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-18 0:39 Add org-src-is-fontify-buffer-p (patch attached) Ship Mints
2025-01-18 7:29 ` Ihor Radchenko
2025-01-18 9:27 ` Ship Mints [this message]
2025-01-18 11:20 ` Ihor Radchenko
2025-01-18 11:28 ` Ship Mints
2025-01-18 11:38 ` Ihor Radchenko
2025-01-18 11:54 ` Ship Mints
2025-01-18 11:57 ` Ship Mints
2025-01-18 12:42 ` Ihor Radchenko
2025-01-18 12:53 ` Ship Mints
2025-01-18 12:59 ` Ihor Radchenko
2025-01-18 12:15 ` Jens Schmidt
2025-01-18 12:33 ` Ship Mints
2025-01-18 12:48 ` 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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAN+1HbpDSZUqgFsnNgUzkCT5mNoWCy0Fqpgjt7bGF2sBT_SWcg@mail.gmail.com \
--to=shipmints@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=yantar92@posteo.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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).