Greetings, org-mode maintainers,

I've become an occasional contributor over on the Emacs side. I thought I'd give an org-mode contribution a try.

The attached patch came out of the discussion here https://www.reddit.com/r/emacs/comments/1i3mk6m/disable_eglot_in_orgmode_source_blocks/

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)))

I made a similar patch, submitted via a github pull request, to the markdown-mode maintainers for the same functionality in their fontification buffers.

The patch was tested against today's main. I hope you find this useful. Let me know your feedback.

Thanks for org-mode,

-Stephane Marks

P.S. I am on record with the FSF.