From ab3ac3667be72f010a456aabe98ce7f1c402b31d Mon Sep 17 00:00:00 2001 From: shipmints Date: Sat, 18 Jan 2025 06:50:57 -0500 Subject: [PATCH] Document markdown-toggle-fontify-code-blocks-natively usage hint This can help users avoid expensive resource invocations in their prog-mode hooks for fontification buffers. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 8fcddea2..7c5e3a59 100644 --- a/README.md +++ b/README.md @@ -915,6 +915,18 @@ provides an interface to all of the possible customizations: interactively by pressing C-c C-x C-f (`markdown-toggle-fontify-code-blocks-natively`). + To avoid the cost of expensive resources in `prog-mode` hooks + which are invoked whenever a markdown fontification buffer is + created for each language mode, consider adding something like + the following to your hook: + +```elisp + (when (or buffer-file-name + (not (string-prefix-p " " (buffer-name)))) + ;; do something expensive, such as + (eglot-ensure)) +``` + * `markdown-gfm-uppercase-checkbox` - When non-nil, complete GFM task list items with `[X]` instead of `[x]` (default: `nil`). This is useful for compatibility with `org-mode`, which doesn't