[packages/emacs] Rel 3

arekm arekm at pld-linux.org
Sun Aug 23 10:50:48 CEST 2026


commit 8963f6a62ef5c35fa4779b0cdc33a52e73e9a26d
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Aug 23 10:50:34 2026 +0200

    Rel 3

 emacs-tree-sitter-0.26.patch | 91 ++++++++++++++++++++++++++++++++++++++++++++
 emacs.spec                   | 10 ++++-
 2 files changed, 100 insertions(+), 1 deletion(-)
---
diff --git a/emacs.spec b/emacs.spec
index 8057b04..fc3413f 100644
--- a/emacs.spec
+++ b/emacs.spec
@@ -18,7 +18,7 @@ Summary(tr.UTF-8):	GNU Emacs
 Name:		emacs
 %define	ver	30.2
 Version:	%{ver}
-Release:	2
+Release:	3
 License:	GPL v3+
 Group:		Applications/Editors/Emacs
 Source0:	https://ftp.gnu.org/gnu/emacs/%{name}-%{version}.tar.xz
@@ -35,6 +35,8 @@ Source9:	%{name}-nox.desktop
 Patch0:		%{name}-file-expand-wildcards-permission.patch
 # https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-31&id=8466eb44991707d128110bdc549fad14c8e1d61e
 Patch1:		%{name}-shorthands-code-execution.patch
+# https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166
+Patch2:		%{name}-tree-sitter-0.26.patch
 URL:		http://www.gnu.org/software/emacs/
 BuildRequires:	freetype-devel
 BuildRequires:	giflib-devel
@@ -54,6 +56,7 @@ BuildRequires:	rpm-pythonprov
 BuildRequires:	sed >= 4.0
 BuildRequires:	sqlite3-devel
 BuildRequires:	texinfo
+BuildRequires:	tree-sitter-devel
 BuildRequires:	xorg-lib-libX11-devel
 %{?with_athena:BuildRequires:	xorg-lib-libXaw-devel}
 BuildRequires:	xorg-lib-libXext-devel
@@ -373,6 +376,7 @@ exit 1
 %setup -q -n %{name}-%{ver}
 %patch -P0 -p1
 %patch -P1 -p1
+%patch -P2 -p1
 
 %build
 
@@ -389,6 +393,7 @@ mkdir build-athena && cd build-athena
 	--with-tiff \
 	--with-gif \
 	--with-png \
+	--with-tree-sitter \
 	--with-x-toolkit=athena \
 	%{?with_bootstrap:--without-gpm}
 
@@ -407,6 +412,7 @@ mkdir build-gtk && cd build-gtk
 	--with-tiff \
 	--with-gif \
 	--with-png \
+	--with-tree-sitter \
 	--with-x-toolkit=gtk3 \
 	%{?with_bootstrap:--without-gpm}
 
@@ -429,6 +435,7 @@ mkdir build-motif && cd build-motif
 	--with-tiff \
 	--with-gif \
 	--with-png \
+	--with-tree-sitter \
 	--with-x-toolkit=motif \
 	%{?with_bootstrap:--without-gpm}
 
@@ -451,6 +458,7 @@ mkdir build-nox && cd build-nox
 	--without-tiff \
 	--without-gif \
 	--without-png \
+	--with-tree-sitter \
 	--with-x=no \
 	%{?with_bootstrap:--without-gpm}
 
diff --git a/emacs-tree-sitter-0.26.patch b/emacs-tree-sitter-0.26.patch
new file mode 100644
index 0000000..9be45dc
--- /dev/null
+++ b/emacs-tree-sitter-0.26.patch
@@ -0,0 +1,91 @@
+--- emacs-30.2/src/treesit.c.orig	2025-08-24 00:00:00.000000000 +0000
++++ emacs-30.2/src/treesit.c	2026-08-23 00:00:00.000000000 +0000
+@@ -34,7 +34,11 @@
+ # 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
+@@ -89,7 +93,11 @@
+ #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));
+@@ -166,7 +174,11 @@
+   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);
+@@ -224,7 +236,11 @@
+   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
+@@ -632,6 +648,22 @@
+     }
+ }
+ 
++/* 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.
+ 
+@@ -746,7 +778,7 @@
+     {
+       *signal_symbol = Qtreesit_load_language_error;
+       *signal_data = list2 (Qversion_mismatch,
+-			    make_fixnum (ts_language_version (lang)));
++			    make_fixnum (treesit_language_abi_version (lang)));
+       return NULL;
+     }
+   return lang;
+@@ -817,7 +849,7 @@
+ 						       &signal_data);
+       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);
+     }
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/emacs.git/commitdiff/8963f6a62ef5c35fa4779b0cdc33a52e73e9a26d



More information about the pld-cvs-commit mailing list