From 75773e660603e84459a0a2d3cea63de711fe76b1 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Tue, 9 Sep 2025 14:39:40 +0100 Subject: [PATCH 01/17] Rebuild against tree-sitter-0.25.9-1.fc44 From 2004733785acf791eec0810e513ba1dbcf700721 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Wed, 24 Sep 2025 15:20:36 +0100 Subject: [PATCH 02/17] Rebuild against tree-sitter-0.25.10-1.fc44 From 6156d97ca7ee47e3f44d5bc57ab4eb634e51f5a0 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Tue, 14 Oct 2025 14:08:43 +0100 Subject: [PATCH 03/17] Recent vanilla ~/.emacs defaults to lexical binding. --- dotemacs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotemacs.el b/dotemacs.el index e1bee17..f7ddcf9 100644 --- a/dotemacs.el +++ b/dotemacs.el @@ -1,4 +1,4 @@ -;; .emacs +;;; -*- lexical-binding: t -*- (custom-set-variables ;; uncomment to always end a file with a newline From 3b2d62a20fdf74256caee7f696a8999aca16441e Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Tue, 14 Oct 2025 14:12:58 +0100 Subject: [PATCH 04/17] Enable lexical binding in `site-start.el` and `default.el` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emacs 31 will warn when loading an Elisp file that does not specify whether to use lexical binding. We don’t use dynamic binding in these files, so we may as well switch it on now. While we’re here, keep `checkdoc` happy. --- default.el | 16 +++++++++++----- site-start.el | 11 +++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/default.el b/default.el index 7df4cee..7ec900f 100644 --- a/default.el +++ b/default.el @@ -1,7 +1,13 @@ -;;; default.el - loaded after ".emacs" on startup -;;; -;;; Setting `inhibit-default-init' non-nil in "~/.emacs" -;;; prevents loading of this file. Also the "-q" option to emacs -;;; prevents both "~/.emacs" and this file from being loaded at startup. +;;; default.el --- loaded after ".emacs" on startup -*- lexical-binding: t -*- + +;;; Commentary: +;; +;; Setting `inhibit-default-init' non-nil in "~/.emacs" +;; prevents loading of this file. Also the "-q" option to "emacs" +;; prevents both "~/.emacs" and this file from being loaded at startup. + +;;; Code: (setq-default smime-CA-directory "/etc/ssl/certs") + +;;; default.el ends here diff --git a/site-start.el b/site-start.el index efbb75b..87b3b13 100644 --- a/site-start.el +++ b/site-start.el @@ -1,9 +1,16 @@ -;;; loaded before user's ".emacs" file and default.el +;;; site-start.el --- loaded before user's ".emacs" file and default.el -*- lexical-binding: t -*- + +;;; Commentary: +;; +;; Load *.el and *.elc in /usr/share/emacs/site-lisp/site-start.d on startup + +;;; Code: -;; load *.el and *.elc in /usr/share/emacs/site-lisp/site-start.d on startup (mapc 'load (delete-dups (mapcar 'file-name-sans-extension (directory-files "/usr/share/emacs/site-lisp/site-start.d" t "\\.elc?\\'")))) + +;;; site-start.el ends here From cacdc924c5e8ef86afb7cd95a6ea0903eddd36b9 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 24 Oct 2025 01:15:07 +0100 Subject: [PATCH 05/17] Ensure on upgrade from F42/F41 that emacs-pgtk replaces emacs (rhbz#2406058) --- emacs.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.spec b/emacs.spec index cfc9f9a..8b085d8 100644 --- a/emacs.spec +++ b/emacs.spec @@ -191,6 +191,7 @@ Requires(posttrans): /usr/sbin/alternatives Requires: emacs-common = %{epoch}:%{version}-%{release} Requires: libpixbufloader-xpm.so%{?marker} Supplements: ((libwayland-server and emacs) unless emacs-nw) +Obsoletes: emacs < 1:30.2-4 %description pgtk %desc From 99ee50d29a52efb3ca1c91ba4229063f672978bd Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 24 Oct 2025 01:16:27 +0100 Subject: [PATCH 06/17] Bump release until F43 overtakes F41. From e3ea4602117fb2f6743531113ad9512af3b58555 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 24 Oct 2025 01:16:28 +0100 Subject: [PATCH 07/17] Bump release until F43 overtakes F41. From 038733a4d2d9e2ee76011fc5409e4f790219a744 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 14 Nov 2025 17:07:45 +0000 Subject: [PATCH 08/17] Own etags and man page (rhbz#2414055). --- emacs.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs.spec b/emacs.spec index cfc9f9a..99c0e02 100644 --- a/emacs.spec +++ b/emacs.spec @@ -779,6 +779,7 @@ fi %license build-pgtk/etc/COPYING %doc build-pgtk/doc/NEWS build-pgtk/BUGS build-pgtk/README %{_bindir}/ebrowse +%ghost %{_bindir}/etags %{_bindir}/etags.emacs %{_bindir}/gctags %{_datadir}/applications/emacs.desktop @@ -791,6 +792,7 @@ fi %{_mandir}/man1/ebrowse.1* %{_mandir}/man1/emacs.1* %{_mandir}/man1/etags.emacs.1* +%ghost %{_mandir}/man1/etags.1* %{_mandir}/man1/gctags.1* %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc From 8baaa786dfe29a7b01fa46d040155326fe653170 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 14 Nov 2025 17:18:11 +0000 Subject: [PATCH 09/17] Drop alternatives for etags Since ctags-5.9, there is no-longer any other provider in Fedora, so we can simplify. --- emacs.spec | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/emacs.spec b/emacs.spec index 99c0e02..0d44537 100644 --- a/emacs.spec +++ b/emacs.spec @@ -532,10 +532,9 @@ install -p -m 0644 %SOURCE6 %{buildroot}%{site_lisp} echo "(setq source-directory \"%{_datadir}/emacs/%{version}/\")" \ >> %{buildroot}%{site_lisp}/site-start.el -mv %{buildroot}%{_bindir}/{etags,etags.emacs} mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz} -mv %{buildroot}%{_mandir}/man1/{etags.1.gz,etags.emacs.1.gz} mv %{buildroot}%{_bindir}/{ctags,gctags} + # BZ 927996 mv %{buildroot}%{_infodir}/{info.info.gz,info.gz} @@ -725,13 +724,7 @@ fi %endif %preun common -if [ $1 = 0 ]; then - /usr/sbin/alternatives --remove emacs.etags %{_bindir}/etags.emacs || : -fi - -%posttrans common -/usr/sbin/alternatives --install %{_bindir}/etags emacs.etags %{_bindir}/etags.emacs 80 \ - --slave %{_mandir}/man1/etags.1.gz emacs.etags.man %{_mandir}/man1/etags.emacs.1.gz || : +/usr/sbin/alternatives --remove emacs.etags %{_bindir}/etags.emacs || : %files @@ -779,8 +772,7 @@ fi %license build-pgtk/etc/COPYING %doc build-pgtk/doc/NEWS build-pgtk/BUGS build-pgtk/README %{_bindir}/ebrowse -%ghost %{_bindir}/etags -%{_bindir}/etags.emacs +%{_bindir}/etags %{_bindir}/gctags %{_datadir}/applications/emacs.desktop %{_datadir}/applications/emacs-mail.desktop @@ -791,8 +783,7 @@ fi %{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document.svg %{_mandir}/man1/ebrowse.1* %{_mandir}/man1/emacs.1* -%{_mandir}/man1/etags.emacs.1* -%ghost %{_mandir}/man1/etags.1* +%{_mandir}/man1/etags.1* %{_mandir}/man1/gctags.1* %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc From 931a607be304f16513daf9d92054014bdde8709d Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 14 Nov 2025 17:07:45 +0000 Subject: [PATCH 10/17] Own etags and man page (rhbz#2414055). --- emacs.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs.spec b/emacs.spec index 8b085d8..cde2711 100644 --- a/emacs.spec +++ b/emacs.spec @@ -780,6 +780,7 @@ fi %license build-pgtk/etc/COPYING %doc build-pgtk/doc/NEWS build-pgtk/BUGS build-pgtk/README %{_bindir}/ebrowse +%ghost %{_bindir}/etags %{_bindir}/etags.emacs %{_bindir}/gctags %{_datadir}/applications/emacs.desktop @@ -792,6 +793,7 @@ fi %{_mandir}/man1/ebrowse.1* %{_mandir}/man1/emacs.1* %{_mandir}/man1/etags.emacs.1* +%ghost %{_mandir}/man1/etags.1* %{_mandir}/man1/gctags.1* %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc From 48ed87e8201c63cefb0d0f45ecfbef78ef571e72 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 14 Nov 2025 22:30:35 +0000 Subject: [PATCH 11/17] =?UTF-8?q?Glob=20doesn=E2=80=99t=20work=20with=20th?= =?UTF-8?q?e=20%ghost=20macro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardcode the manpage compression format to .gz, here. --- emacs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.spec b/emacs.spec index cde2711..904c54b 100644 --- a/emacs.spec +++ b/emacs.spec @@ -793,7 +793,7 @@ fi %{_mandir}/man1/ebrowse.1* %{_mandir}/man1/emacs.1* %{_mandir}/man1/etags.emacs.1* -%ghost %{_mandir}/man1/etags.1* +%ghost %{_mandir}/man1/etags.1.gz %{_mandir}/man1/gctags.1* %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc From 585fcc155adcd1afa2c210c9feb0f709b8394af6 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 21 Nov 2025 14:39:04 +0000 Subject: [PATCH 12/17] Set source-directory via site-start.d dropin. --- emacs.spec | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/emacs.spec b/emacs.spec index 0d44537..e6903e6 100644 --- a/emacs.spec +++ b/emacs.spec @@ -469,6 +469,18 @@ cat > macros.emacs << EOF %%_emacs_bytecompile(W) /usr/bin/emacs -batch --no-init-file --no-site-file --eval '(push nil load-path)' %%{-W:--eval '(setq byte-compile-error-on-warn t)' }-f batch-byte-compile %%* EOF +cat > 10-source-directory.el << 'EOF' +;;; 10-source-directory.el --- Set source-directory -*- lexical-binding: t -*- + +;;; Commentary: +;; +;; This solves rhbz#474958; Function `update-directory-autoloads' now +;; finally works. + +(setq source-directory "%{_datadir}/emacs/%{version}/") + +;;; 10-source-directory.el ends here +EOF %install %if %{with nw} @@ -523,14 +535,10 @@ ln -s emacs-%{version}-nw %{buildroot}%{_bindir}/emacs-nox # Make sure movemail isn't setgid chmod 755 %{buildroot}%{emacs_libexecdir}/movemail -mkdir -p %{buildroot}%{site_lisp} +mkdir -p %{buildroot}%{site_lisp} %{buildroot}%{site_start_d} install -p -m 0644 %SOURCE5 %{buildroot}%{site_lisp}/site-start.el install -p -m 0644 %SOURCE6 %{buildroot}%{site_lisp} - -# This solves bz#474958, "update-directory-autoloads" now finally -# works the path is different each version, so we'll generate it here -echo "(setq source-directory \"%{_datadir}/emacs/%{version}/\")" \ - >> %{buildroot}%{site_lisp}/site-start.el +install -p -m 0644 10-source-directory.el %{buildroot}%{site_start_d}/ mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz} mv %{buildroot}%{_bindir}/{ctags,gctags} @@ -538,8 +546,6 @@ mv %{buildroot}%{_bindir}/{ctags,gctags} # BZ 927996 mv %{buildroot}%{_infodir}/{info.info.gz,info.gz} -mkdir -p %{buildroot}%{site_lisp}/site-start.d - # Default initialization file mkdir -p %{buildroot}%{_sysconfdir}/skel install -p -m 0644 %SOURCE4 %{buildroot}%{_sysconfdir}/skel/.emacs @@ -800,6 +806,7 @@ fi %{_userunitdir}/emacs.service %attr(0644,root,root) %config(noreplace) %{site_lisp}/default.el %attr(0644,root,root) %config %{site_lisp}/site-start.el +%{site_start_d}/10-source-directory.el %{pkgconfig}/emacs.pc From 514c0430fbe86afa48c02debdc96f379dc65ad62 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 21 Nov 2025 14:39:52 +0000 Subject: [PATCH 13/17] New RPM macro %_emacs_archsitelispdir for Emacs dynamic modules. --- emacs.spec | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/emacs.spec b/emacs.spec index e6903e6..35937e0 100644 --- a/emacs.spec +++ b/emacs.spec @@ -264,7 +264,7 @@ License: GPL-3.0-or-later AND GFDL-1.3-no-invariants-or-later AND BSD-3-Cl Requires(preun): /usr/sbin/alternatives Requires(posttrans): /usr/sbin/alternatives Requires: /usr/bin/readlink -Requires: %{name}-filesystem +Requires: %{name}-filesystem >= 1:30.1 Requires: emacsclient Requires: libgccjit Recommends: emacs = %{epoch}:%{version}-%{release} @@ -464,11 +464,25 @@ cat > macros.emacs << EOF %%_emacs_version %{version} %%_emacs_ev %{?epoch:%{epoch}:}%{version} %%_emacs_evr %{?epoch:%{epoch}:}%{version}-%{release} +%%_emacs_archsitelispdir %%{_libdir}/emacs/site-lisp %%_emacs_sitelispdir %{site_lisp} %%_emacs_sitestartdir %{site_start_d} %%_emacs_bytecompile(W) /usr/bin/emacs -batch --no-init-file --no-site-file --eval '(push nil load-path)' %%{-W:--eval '(setq byte-compile-error-on-warn t)' }-f batch-byte-compile %%* EOF +cat > 00-dynamic-module-dir.el << 'EOF' +;;; 00-dynamic-module-dir.el --- Add arch-specifc dir to load-path -*- lexical-binding: t -*- + +;;; Commentary: +;; +;; This directory is for installing Emacs dynamic modules into. See +;; also RPM macro %%_emacs_archsitelispdir. + +(add-to-list 'load-path "%{_libdir}/emacs/site-lisp") + +;;; 00-dynamic-module-dir.el ends here +EOF + cat > 10-source-directory.el << 'EOF' ;;; 10-source-directory.el --- Set source-directory -*- lexical-binding: t -*- @@ -538,6 +552,7 @@ chmod 755 %{buildroot}%{emacs_libexecdir}/movemail mkdir -p %{buildroot}%{site_lisp} %{buildroot}%{site_start_d} install -p -m 0644 %SOURCE5 %{buildroot}%{site_lisp}/site-start.el install -p -m 0644 %SOURCE6 %{buildroot}%{site_lisp} +install -p -m 0644 00-dynamic-module-dir.el %{buildroot}%{site_start_d}/ install -p -m 0644 10-source-directory.el %{buildroot}%{site_start_d}/ mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz} @@ -806,6 +821,7 @@ fi %{_userunitdir}/emacs.service %attr(0644,root,root) %config(noreplace) %{site_lisp}/default.el %attr(0644,root,root) %config %{site_lisp}/site-start.el +%{site_start_d}/00-dynamic-module-dir.el %{site_start_d}/10-source-directory.el %{pkgconfig}/emacs.pc From b4c76f9a5356cd0ee5c8089cedb255b25e3897f4 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Tue, 25 Nov 2025 13:17:25 +0000 Subject: [PATCH 14/17] Move ownership of %{_libdir}/emacs to emacs-filesystem package. --- emacs.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs.spec b/emacs.spec index 35937e0..11a717a 100644 --- a/emacs.spec +++ b/emacs.spec @@ -264,7 +264,7 @@ License: GPL-3.0-or-later AND GFDL-1.3-no-invariants-or-later AND BSD-3-Cl Requires(preun): /usr/sbin/alternatives Requires(posttrans): /usr/sbin/alternatives Requires: /usr/bin/readlink -Requires: %{name}-filesystem >= 1:30.1 +Requires: %{name}-filesystem >= 1:30.2 Requires: emacsclient Requires: libgccjit Recommends: emacs = %{epoch}:%{version}-%{release} @@ -809,7 +809,6 @@ fi %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc %{_datadir}/emacs/%{version}/site-lisp -%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/%{version} %dir %{native_lisp} %dir %{_libexecdir}/emacs From 3b048fcb3792a89b3ebff278543ebaa2878a3579 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Wed, 10 Dec 2025 12:05:42 +0000 Subject: [PATCH 15/17] Support Tree-sitter version 0.26 and later (rhbz#2420305). --- ...t-Tree-sitter-version-0.26-and-later.patch | 115 ++++++++++++++++++ emacs.spec | 5 + 2 files changed, 120 insertions(+) create mode 100644 0001-Support-Tree-sitter-version-0.26-and-later.patch diff --git a/0001-Support-Tree-sitter-version-0.26-and-later.patch b/0001-Support-Tree-sitter-version-0.26-and-later.patch new file mode 100644 index 0000000..b6def99 --- /dev/null +++ b/0001-Support-Tree-sitter-version-0.26-and-later.patch @@ -0,0 +1,115 @@ +From d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166 Mon Sep 17 00:00:00 2001 +From: Eli Zaretskii +Date: Fri, 17 Oct 2025 14:15:41 +0300 +Subject: [PATCH] Support Tree-sitter version 0.26 and later + +* src/treesit.c (init_treesit_functions) +[TREE_SITTER_LANGUAGE_VERSION >= 15]: Define prototype for, and +load 'ts_language_abi_version' instead of the deprecated (and +removed in tree-sitter 0.26) 'ts_language_version'. +(ts_language_abi_version) [TREE_SITTER_LANGUAGE_VERSION >= 15]: +Define on WINDOWSNT, instead of 'ts_language_version'. +(treesit_language_abi_version): New compatibility function. +(treesit_load_language, Ftreesit_language_abi_version): Use +'treesit_language_abi_version' instead of 'ts_language_version'. +(Bug#79627) +--- + src/treesit.c | 36 ++++++++++++++++++++++++++++++++++-- + 1 file changed, 34 insertions(+), 2 deletions(-) + +diff --git a/src/treesit.c b/src/treesit.c +index bf982de580b..69751b5ea10 100644 +--- a/src/treesit.c ++++ b/src/treesit.c +@@ -35,7 +35,11 @@ Copyright (C) 2021-2025 Free Software Foundation, Inc. + # include "w32common.h" + + /* In alphabetical order. */ ++#if TREE_SITTER_LANGUAGE_VERSION >= 15 ++#undef ts_language_abi_version ++#else + #undef ts_language_version ++#endif + #undef ts_node_child + #undef ts_node_child_by_field_name + #undef ts_node_child_count +@@ -90,7 +94,11 @@ Copyright (C) 2021-2025 Free Software Foundation, Inc. + #undef ts_tree_get_changed_ranges + #undef ts_tree_root_node + ++#if TREE_SITTER_LANGUAGE_VERSION >= 15 ++DEF_DLL_FN (uint32_t, ts_language_abi_version, (const TSLanguage *)); ++#else + DEF_DLL_FN (uint32_t, ts_language_version, (const TSLanguage *)); ++#endif + DEF_DLL_FN (TSNode, ts_node_child, (TSNode, uint32_t)); + DEF_DLL_FN (TSNode, ts_node_child_by_field_name, + (TSNode, const char *, uint32_t)); +@@ -167,7 +175,11 @@ init_treesit_functions (void) + if (!library) + return false; + ++#if TREE_SITTER_LANGUAGE_VERSION >= 15 ++ LOAD_DLL_FN (library, ts_language_abi_version); ++#else + LOAD_DLL_FN (library, ts_language_version); ++#endif + LOAD_DLL_FN (library, ts_node_child); + LOAD_DLL_FN (library, ts_node_child_by_field_name); + LOAD_DLL_FN (library, ts_node_child_count); +@@ -225,7 +237,11 @@ init_treesit_functions (void) + return true; + } + ++#if TREE_SITTER_LANGUAGE_VERSION >= 15 ++#define ts_language_abi_version fn_ts_language_abi_version ++#else + #define ts_language_version fn_ts_language_version ++#endif + #define ts_node_child fn_ts_node_child + #define ts_node_child_by_field_name fn_ts_node_child_by_field_name + #define ts_node_child_count fn_ts_node_child_count +@@ -711,6 +727,22 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name, + } + } + ++/* This function is a compatibility shim. Tree-sitter 0.25 introduced ++ ts_language_abi_version as a replacement for ts_language_version, and ++ tree-sitter 0.26 removed ts_language_version. Here we use the fact ++ that 0.25 bumped TREE_SITTER_LANGUAGE_VERSION to 15, to use the new ++ function instead of the old one, when Emacs is compiled against ++ tree-sitter version 0.25 or newer. */ ++static uint32_t ++treesit_language_abi_version (const TSLanguage *ts_lang) ++{ ++#if TREE_SITTER_LANGUAGE_VERSION >= 15 ++ return ts_language_abi_version (ts_lang); ++#else ++ return ts_language_version (ts_lang); ++#endif ++} ++ + /* Load the dynamic library of LANGUAGE_SYMBOL and return the pointer + to the language definition. + +@@ -832,7 +864,7 @@ treesit_load_language (Lisp_Object language_symbol, + build_string ("%s's ABI version is %d, but supported versions are %d-%d"); + Lisp_Object formatted_msg = + CALLN (Fformat_message, fmt, loaded_lib, +- make_fixnum (ts_language_version (lang)), ++ make_fixnum (treesit_language_abi_version (lang)), + make_fixnum (TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION), + make_fixnum (TREE_SITTER_LANGUAGE_VERSION)); + *signal_symbol = Qtreesit_load_language_error; +@@ -914,7 +946,7 @@ DEFUN ("treesit-language-abi-version", Ftreesit_language_abi_version, + TSLanguage *ts_language = lang.lang; + if (ts_language == NULL) + return Qnil; +- uint32_t version = ts_language_version (ts_language); ++ uint32_t version = treesit_language_abi_version (ts_language); + return make_fixnum((ptrdiff_t) version); + } + } +-- +2.52.0 + diff --git a/emacs.spec b/emacs.spec index 11a717a..70f3d6d 100644 --- a/emacs.spec +++ b/emacs.spec @@ -57,6 +57,11 @@ Patch: 0002-Fall-back-to-the-terminal-from-pure-GTK-when-no-disp.patch # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49505#67 Patch: 0001-Don-t-specify-StartupWMClass-in-emacs.desktop.patch +# Don't wait for Emacs 31 before updating to Tree-sitter 0.26. +# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63555 +# https://bugzilla.redhat.com/show_bug.cgi?id=2420305 +Patch: 0001-Support-Tree-sitter-version-0.26-and-later.patch + BuildRequires: alsa-lib-devel BuildRequires: atk-devel BuildRequires: autoconf From 91bcd98e446c016850c32ab9ea66ba1077bd48fb Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Wed, 10 Dec 2025 13:03:09 +0000 Subject: [PATCH 16/17] Fix Tree-sitter 0.26 patch for Emacs 30. --- ...t-Tree-sitter-version-0.26-and-later.patch | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/0001-Support-Tree-sitter-version-0.26-and-later.patch b/0001-Support-Tree-sitter-version-0.26-and-later.patch index b6def99..936ca2e 100644 --- a/0001-Support-Tree-sitter-version-0.26-and-later.patch +++ b/0001-Support-Tree-sitter-version-0.26-and-later.patch @@ -1,4 +1,4 @@ -From d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166 Mon Sep 17 00:00:00 2001 +From 16f0be6354ea13331859c861fa7d423a0b54bec7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 17 Oct 2025 14:15:41 +0300 Subject: [PATCH] Support Tree-sitter version 0.26 and later @@ -14,14 +14,14 @@ Define on WINDOWSNT, instead of 'ts_language_version'. 'treesit_language_abi_version' instead of 'ts_language_version'. (Bug#79627) --- - src/treesit.c | 36 ++++++++++++++++++++++++++++++++++-- - 1 file changed, 34 insertions(+), 2 deletions(-) + src/treesit.c | 34 +++++++++++++++++++++++++++++++++- + 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/treesit.c b/src/treesit.c -index bf982de580b..69751b5ea10 100644 +index e2986c186b8..4d6bf9a5dbd 100644 --- a/src/treesit.c +++ b/src/treesit.c -@@ -35,7 +35,11 @@ Copyright (C) 2021-2025 Free Software Foundation, Inc. +@@ -34,7 +34,11 @@ Copyright (C) 2021-2025 Free Software Foundation, Inc. # include "w32common.h" /* In alphabetical order. */ @@ -33,7 +33,7 @@ index bf982de580b..69751b5ea10 100644 #undef ts_node_child #undef ts_node_child_by_field_name #undef ts_node_child_count -@@ -90,7 +94,11 @@ Copyright (C) 2021-2025 Free Software Foundation, Inc. +@@ -89,7 +93,11 @@ Copyright (C) 2021-2025 Free Software Foundation, Inc. #undef ts_tree_get_changed_ranges #undef ts_tree_root_node @@ -45,7 +45,7 @@ index bf982de580b..69751b5ea10 100644 DEF_DLL_FN (TSNode, ts_node_child, (TSNode, uint32_t)); DEF_DLL_FN (TSNode, ts_node_child_by_field_name, (TSNode, const char *, uint32_t)); -@@ -167,7 +175,11 @@ init_treesit_functions (void) +@@ -166,7 +174,11 @@ init_treesit_functions (void) if (!library) return false; @@ -57,7 +57,7 @@ index bf982de580b..69751b5ea10 100644 LOAD_DLL_FN (library, ts_node_child); LOAD_DLL_FN (library, ts_node_child_by_field_name); LOAD_DLL_FN (library, ts_node_child_count); -@@ -225,7 +237,11 @@ init_treesit_functions (void) +@@ -224,7 +236,11 @@ init_treesit_functions (void) return true; } @@ -69,7 +69,7 @@ index bf982de580b..69751b5ea10 100644 #define ts_node_child fn_ts_node_child #define ts_node_child_by_field_name fn_ts_node_child_by_field_name #define ts_node_child_count fn_ts_node_child_count -@@ -711,6 +727,22 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name, +@@ -632,6 +648,22 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name, } } @@ -92,17 +92,8 @@ index bf982de580b..69751b5ea10 100644 /* Load the dynamic library of LANGUAGE_SYMBOL and return the pointer to the language definition. -@@ -832,7 +864,7 @@ treesit_load_language (Lisp_Object language_symbol, - build_string ("%s's ABI version is %d, but supported versions are %d-%d"); - Lisp_Object formatted_msg = - CALLN (Fformat_message, fmt, loaded_lib, -- make_fixnum (ts_language_version (lang)), -+ make_fixnum (treesit_language_abi_version (lang)), - make_fixnum (TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION), - make_fixnum (TREE_SITTER_LANGUAGE_VERSION)); - *signal_symbol = Qtreesit_load_language_error; -@@ -914,7 +946,7 @@ DEFUN ("treesit-language-abi-version", Ftreesit_language_abi_version, - TSLanguage *ts_language = lang.lang; +@@ -817,7 +849,7 @@ DEFUN ("treesit-language-abi-version", Ftreesit_language_abi_version, + &signal_data); if (ts_language == NULL) return Qnil; - uint32_t version = ts_language_version (ts_language); From 8caa8a9f69e8f0ac55b930f0486c0df496c9b072 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Wed, 10 Dec 2025 15:07:07 +0000 Subject: [PATCH 17/17] =?UTF-8?q?Eliminate=20=E2=80=9CFile=20listed=20twic?= =?UTF-8?q?e=E2=80=9D=20warning.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emacs.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/emacs.spec b/emacs.spec index 70f3d6d..e10f642 100644 --- a/emacs.spec +++ b/emacs.spec @@ -825,8 +825,6 @@ fi %{_userunitdir}/emacs.service %attr(0644,root,root) %config(noreplace) %{site_lisp}/default.el %attr(0644,root,root) %config %{site_lisp}/site-start.el -%{site_start_d}/00-dynamic-module-dir.el -%{site_start_d}/10-source-directory.el %{pkgconfig}/emacs.pc