emacs/etc
Yuan Fu ad500a13e4
Compile queries in treesit-f-l-recompute-features (bug#80108)
The direct cause of the problem in the bug report is that when
user runs treesit-font-lock-recompute-features to add the
emacs-devel feature in c-ts-mode's mode hook, the added query
for emacs-devel aren't compiled.

This change consists of two parts:
1. The immediate fix: validate and compile queries in
treesit-font-lock-recompute-features.
2. To make it more fool-proof, change treesit-font-lock-rules
back to compile the queries and make
treesit--compile-query-with-cache support compiled queries. This
way, as long as the query goes through treesit-font-lock-rules,
it'll be compiled eventually and not cause slow-down. I had to
add some c-level functions, but they're kind of overdue anyway,
so I don't have any problem adding them to the API.

* lisp/treesit.el (treesit--compile-query-with-cache): Support
compiled queries.
(treesit-font-lock-rules): Compile the queries (but not
eagerly).
(treesit-font-lock-recompute-features): Validate and compile
queries.
(treesit-major-mode-setup): Remove call to
treesit-validate-and-compile-font-lock-rules since it's now
called in treesit-font-lock-recompute-features.

* src/treesit.c (Ftreesit_query_eagerly_compiled_p):
(Ftreesit_query_source): New functions.

* doc/lispref/parsing.texi (Pattern Matching): Add manual
entries for the new functions.
2026-01-01 23:21:27 -08:00
..
charsets ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
e Add auto-margin enable/disable to term 2025-03-02 16:01:13 -05:00
forms ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
gnus
images ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
nxml
org ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
refcards ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
schema ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
srecode ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
themes ; * etc/themes/modus-themes.el: Update comment. 2026-01-02 07:45:14 +01:00
tutorials ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
AUTHORS Update files for Emacs 30.2 2025-08-14 04:05:28 -04:00
CALC-NEWS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ChangeLog.1 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
compilation.txt ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
COPYING
copyright-assign.txt Add assignment form as etc/copyright-assign.txt 2024-06-23 00:24:31 +02:00
DEBUG ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
DEVEL.HUMOR ; Fix punctuation in etc/* 2024-07-27 01:51:47 +02:00
DISTRIB ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
edt-user.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
EGLOT-NEWS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
emacs-buffer.gdb ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
emacs-mail.desktop Hide emacs-mail.desktop, emacsclient-mail.desktop from menus 2021-07-02 13:09:18 +02:00
emacs.desktop Drop redundant keywords in .desktop files. 2021-08-11 14:05:25 +02:00
emacs.icon
emacs.metainfo.xml ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
emacs.service * etc/emacs.service: 2020-12-14 17:59:58 +01:00
emacs_lldb.py ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
emacsclient-mail.desktop Add 'server-eval-args-left' to server.el 2023-10-29 14:10:23 +02:00
emacsclient.desktop Make emacsclient handle org-protocol:// links 2023-09-18 12:54:22 +02:00
enriched.txt ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ERC-NEWS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ETAGS.EBNF ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ETAGS.README ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
future-bug ; Fix typos 2025-01-23 03:14:37 +01:00
gnus-tut.txt ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
grep.txt ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
HELLO ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
HISTORY Update files for Emacs 30.2 2025-08-14 04:05:28 -04:00
JOKES
MACHINES ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
MH-E-NEWS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS Compile queries in treesit-f-l-recompute-features (bug#80108) 2026-01-01 23:21:27 -08:00
NEWS.1-17 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.18 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.19 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.20 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.21 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.22 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.23 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.24 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.25 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.26 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.27 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.28 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.29 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEWS.30 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NEXTSTEP ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
NXML-NEWS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ORG-NEWS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
org.gnu.emacs.defaults.gschema.xml ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
package-keyring.gpg * etc/package-keyring.gpg: Update expiration and add new key 2024-10-22 12:35:18 -04:00
PROBLEMS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ps-prin0.ps ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ps-prin1.ps ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
publicsuffix.txt ; * etc/publicsuffix.txt: Update from upstream. 2024-12-22 13:50:41 +02:00
README ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
rgb.txt Revert "Update etc/rgb.txt from X.Org upstream" 2023-10-16 08:56:53 +08:00
ses-example.ses ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
spook.lines Add more spook.lines 2019-07-13 05:09:45 +02:00
symbol-releases.eld ; * etc/symbol-releases.eld (dired-click-to-select-mode): Add. 2025-08-23 16:34:43 +03:00
TERMS ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
TODO ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
w32-feature.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00

This directory contains the architecture-independent files used by or
with Emacs.  This includes some text files of documentation for GNU
Emacs or of interest to Emacs users, and the file of dumped docstrings
for Emacs functions and variables.

COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES

File: emacs.icon
  Author: Sun Microsystems, Inc
  Copyright (C) 1999, 2001-2026 Free Software Foundation, Inc.
  License: GNU General Public License version 3 or later (see COPYING)