emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 70421a88196 09/14: Merge from origin/emacs-29


From: Eli Zaretskii
Subject: master 70421a88196 09/14: Merge from origin/emacs-29
Date: Mon, 31 Jul 2023 11:12:22 -0400 (EDT)

branch: master
commit 70421a881965f77e526b789bbc682925ce0f61f6
Merge: d85805a4e16 a9b28224af0
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Merge from origin/emacs-29
    
    a9b28224af0 ; Last-minute changes befor releasing 29.1
    7da1cee56b3 Update CMake support due to upstream changes (bug#64922)
    c2d95dd00e6 Remove nullptr named node from c++-ts-mode (bug#64818)
    4e977136d31 Make compat check also check typescript
    906ecf442c4 ; * etc/HISTORY: Fix the 28.3 entry.
---
 ChangeLog.4                          | 46 +++++++++++++++++++++++++++++--
 etc/HISTORY                          |  4 +--
 lisp/progmodes/c-ts-mode.el          |  4 +--
 lisp/progmodes/cmake-ts-mode.el      | 52 ++++++++++++++++++++++++++----------
 lisp/progmodes/typescript-ts-mode.el |  9 ++++---
 5 files changed, 90 insertions(+), 25 deletions(-)

diff --git a/ChangeLog.4 b/ChangeLog.4
index d8f7fc4a579..9d64446d68e 100644
--- a/ChangeLog.4
+++ b/ChangeLog.4
@@ -1,7 +1,49 @@
-2023-07-29  Eli Zaretskii  <eliz@maintain0p.gnu.org>
+2023-07-30  Eli Zaretskii  <eliz@maintain0p.gnu.org>
 
        * Version 29.1 released.
 
+2023-07-29  Vincenzo Pupillo  <v.pupillo@gmail.com>
+
+       Update CMake support due to upstream changes (bug#64922)
+
+       A recent change in tree-sitter-cmake grammar support for CMake (commit
+       fe9b5e0), now put arguments are wrapped in a new argument_list node.
+       To support the old and new version of the grammar, a new function was
+       added on which string syntax highlighting now depends.
+
+       * lisp/progmodes/cmake-ts-mode.el
+       (cmake-ts-mode--font-lock-compatibility-fe9b5e0): Indent helper
+       function to handle different tree-sitter-cmake version.
+       * lisp/progmodes/cmake-ts-mode.el
+       (cmake-ts-mode--font-lock-settings): Use the new function to handle
+       the new argument_list node.
+
+2023-07-24  Theodor Thornhill  <theo@thornhill.no>
+
+       Remove nullptr named node from c++-ts-mode (bug#64818)
+
+       The nullptr node was changed from a named node to an unnamed node
+       upstream[0], which caused font locking to break. As this is a small
+       enough regression, no compat code is required.
+
+       * lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Remove
+       node no longer in use.
+
+       [0]:
+       
https://github.com/tree-sitter/tree-sitter-c/commit/c75868f8b508ae32a0c8490da91bb31b2b96430e
+
+2023-07-24  Theodor Thornhill  <theo@thornhill.no>
+
+       Make compat check also check typescript
+
+       * lisp/progmodes/typescript-ts-mode.el
+       (tsx-ts-mode--font-lock-compatibility-bb1f97b):
+       Add argument so that we run the 'treesit-query-capture' when the
+       language is 'typescript', not only 'tsx'.
+
+       * lisp/progmodes/typescript-ts-mode.el
+       (typescript-ts-mode--font-lock-settings): Use supplied argument.
+
 2023-07-23  Eli Zaretskii  <eliz@gnu.org>
 
        Bump Emacs version
@@ -117338,7 +117380,7 @@
 
 This file records repository revisions from
 commit f2ae39829812098d8269eafbc0fcb98959ee5bb7 (exclusive) to
-commit 76a142e265df742b2fdd3d220607a46fcbc30e1a (inclusive).
+commit 7d1737071fba1fd83039aac34f34f6b90c9579b8 (inclusive).
 See ChangeLog.3 for earlier changes.
 
 ;; Local Variables:
diff --git a/etc/HISTORY b/etc/HISTORY
index d60397ab3cb..70f8669cb29 100644
--- a/etc/HISTORY
+++ b/etc/HISTORY
@@ -228,9 +228,9 @@ GNU Emacs 28.1 (2022-04-04) emacs-28.1
 
 GNU Emacs 28.2 (2022-09-12) emacs-28.2
 
-GNU Emacs 28.3 (2023-02-17) emacs-28.3
+GNU Emacs 28.3 (2023-02-17) emacs-28.3 (was not actually released)
 
-GNU Emacs 29.1 (2023-07-29) emacs-29.1
+GNU Emacs 29.1 (2023-07-30) emacs-29.1
 
 
 ----------------------------------------------------------------------
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index f16e06942b9..61898620c8d 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -574,9 +574,7 @@ MODE is either `c' or `cpp'."
    :feature 'constant
    `((true) @font-lock-constant-face
      (false) @font-lock-constant-face
-     (null) @font-lock-constant-face
-     ,@(when (eq mode 'cpp)
-         '((nullptr) @font-lock-constant-face)))
+     (null) @font-lock-constant-face)
 
    :language mode
    :feature 'keyword
diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el
index 9d35d8077bd..53d471c381a 100644
--- a/lisp/progmodes/cmake-ts-mode.el
+++ b/lisp/progmodes/cmake-ts-mode.el
@@ -31,6 +31,7 @@
 (eval-when-compile (require 'rx))
 
 (declare-function treesit-parser-create "treesit.c")
+(declare-function treesit-query-capture "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
 (declare-function treesit-node-child "treesit.c")
 (declare-function treesit-node-start "treesit.c")
@@ -87,6 +88,42 @@
     "VERSION_GREATER_EQUAL" "VERSION_LESS" "VERSION_LESS_EQUAL")
   "CMake if conditions for tree-sitter font-locking.")
 
+(defun cmake-ts-mode--font-lock-compatibility-fe9b5e0 ()
+  "Indent rules helper, to handle different releases of tree-sitter-cmake.
+Check if a node type is available, then return the right indent rules."
+  ;; handle commit fe9b5e0
+  (condition-case nil
+      (progn (treesit-query-capture 'cmake '((argument_list) @capture))
+             `(((foreach_command
+                 ((argument_list) @font-lock-constant-face
+                  (:match ,(rx-to-string
+                            `(seq bol
+                                  (or ,@cmake-ts-mode--foreach-options)
+                                  eol))
+                          @font-lock-constant-face))))
+               ((if_command
+                 ((argument_list) @font-lock-constant-face
+                  (:match ,(rx-to-string
+                            `(seq bol
+                                  (or ,@cmake-ts-mode--if-conditions)
+                                  eol))
+                          @font-lock-constant-face))))))
+    (error
+     `(((foreach_command
+         ((argument) @font-lock-constant-face
+          (:match ,(rx-to-string
+                    `(seq bol
+                          (or ,@cmake-ts-mode--foreach-options)
+                          eol))
+                  @font-lock-constant-face))))
+       ((if_command
+         ((argument) @font-lock-constant-face
+          (:match ,(rx-to-string
+                    `(seq bol
+                          (or ,@cmake-ts-mode--if-conditions)
+                          eol))
+                  @font-lock-constant-face))))))))
+
 (defvar cmake-ts-mode--font-lock-settings
   (treesit-font-lock-rules
    :language 'cmake
@@ -95,20 +132,7 @@
 
    :language 'cmake
    :feature 'builtin
-   `(((foreach_command
-       ((argument) @font-lock-constant-face
-        (:match ,(rx-to-string
-                  `(seq bol
-                        (or ,@cmake-ts-mode--foreach-options)
-                        eol))
-                @font-lock-constant-face))))
-     ((if_command
-       ((argument) @font-lock-constant-face
-        (:match ,(rx-to-string
-                  `(seq bol
-                        (or ,@cmake-ts-mode--if-conditions)
-                        eol))
-                @font-lock-constant-face)))))
+   (cmake-ts-mode--font-lock-compatibility-fe9b5e0)
 
    :language 'cmake
    :feature 'comment
diff --git a/lisp/progmodes/typescript-ts-mode.el 
b/lisp/progmodes/typescript-ts-mode.el
index 5251d431e87..a4752f7a2ee 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -154,15 +154,16 @@ Argument LANGUAGE is either `typescript' or `tsx'."
     "&&" "||" "!" "?.")
   "TypeScript operators for tree-sitter font-locking.")
 
-(defun tsx-ts-mode--font-lock-compatibility-bb1f97b ()
+(defun tsx-ts-mode--font-lock-compatibility-bb1f97b (language)
   "Font lock rules helper, to handle different releases of tree-sitter-tsx.
-Check if a node type is available, then return the right font lock rules."
+Check if a node type is available, then return the right font lock rules.
+Argument LANGUAGE is either `typescript' or `tsx'."
   ;; handle commit bb1f97b
   ;; Warning: treesitter-query-capture says both node types are valid,
   ;; but then raises an error if the wrong node type is used. So it is
   ;; important to check with the new node type (member_expression)
   (condition-case nil
-      (progn (treesit-query-capture 'tsx '((member_expression) @capture))
+      (progn (treesit-query-capture language '((member_expression) @capture))
             '((jsx_opening_element
                [(member_expression (identifier)) (identifier)]
                @typescript-ts-jsx-tag-face)
@@ -337,7 +338,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
 
    :language language
    :feature 'jsx
-   (append (tsx-ts-mode--font-lock-compatibility-bb1f97b)
+   (append (tsx-ts-mode--font-lock-compatibility-bb1f97b language)
           `((jsx_attribute (property_identifier) 
@typescript-ts-jsx-attribute-face)))
 
    :language language



reply via email to

[Prev in Thread] Current Thread [Next in Thread]