From unknown Mon Jun 23 13:15:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers Resent-From: Danny Freeman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Sep 2023 15:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 66004@debbugs.gnu.org, casouri@gmail.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Yuan Fu Received: via spool by submit@debbugs.gnu.org id=B.169479339027208 (code B ref -1); Fri, 15 Sep 2023 15:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Sep 2023 15:56:30 +0000 Received: from localhost ([127.0.0.1]:44525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhBBF-00074m-WE for submit@debbugs.gnu.org; Fri, 15 Sep 2023 11:56:30 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhBBD-00074V-58 for submit@debbugs.gnu.org; Fri, 15 Sep 2023 11:56:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhBB0-0002ur-Sd for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 11:56:14 -0400 Received: from out-217.mta1.migadu.com ([2001:41d0:203:375::d9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhBAx-0003cg-Je for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 11:56:14 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1694793367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=ta4ocfaATcWMkwyozPEoXJNFwfWx61zjDBfdEMyjy4M=; b=Du96DDFh6nrbaAO6etGklLatbV6l/vx1jGZB12SNkB5EkoNL1/XBkZ1uhXF+AP77xcy1k4 9nnWunWi+ehwLgVgaJFxxDAUOpKy/56/OcYqeG5QG12IXSxU0cMYlqDxE7koHCrykuzDmP 0MCfBquL4AzgaH6M6A7Nj+Ep2WFFF5U= From: Danny Freeman Date: Fri, 15 Sep 2023 11:45:00 -0400 Message-ID: <87o7i32zxz.fsf@dfreeman.email> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::d9; envelope-from=danny@dfreeman.email; helo=out-217.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Background: In clojure-ts-mode I've been capturing docstrings and applying some limited syntax highlighting using an embedded markdown parser. I'm only able to capture the full string, "quotes included". I would like to be able to easily adjust the ranges captured to only include the contents of the string, delimiters excluded. I have a similar desire to capture the contents of a regular expression literal and apply a nested regex grammar. I've seen an offset mechanism used by the neovim tree-sitter integration for similar purposes. I believe the javascript/typescript modes could take advantage of this with template strings. I've included a small test in the patch that demonstrates this. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Offset-ranges-before-applying-embedded-tree-sitter-p.patch >From 61b89cf08ff8eb6e984d862519b9a0750f7f0cd0 Mon Sep 17 00:00:00 2001 From: Danny Freeman Date: Fri, 15 Sep 2023 11:29:05 -0400 Subject: [PATCH] Offset ranges before applying embedded tree-sitter parser * lisp/treesit.el (treesit-query-range): Accept an optional offest arg, apply the offset to all returned ranges (treesit-range-rules): Accept an optional :offset keyword arg to adjust ranges an embded parser is applied to (treesit-update-ranges): Forward optional :offset setting from `treesit-range-rules' to `treesit-query-rang' * test/lisp/treesit-tests.el (treesit-range-offset): Tests the new offset functioanlity This is feature would allow treesitter major modes to easily specify offsets when using embeded parsers. A potential use case for this is javascript template strings, when we want to apply a different parser to the string's contents, but do not want to include the template string's delmiters. --- lisp/treesit.el | 49 +++++++++++++++++++++++++++------------ test/src/treesit-tests.el | 14 +++++++++++ 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 78bd149b7e2..0b257c93c44 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -449,21 +449,25 @@ treesit-query-string (treesit-parser-root-node parser) query)))) -(defun treesit-query-range (node query &optional beg end) +(defun treesit-query-range (node query &optional beg end offset) "Query the current buffer and return ranges of captured nodes. QUERY, NODE, BEG, END are the same as in `treesit-query-capture'. This function returns a list of (START . END), where START and -END specifics the range of each captured node. Capture names -generally don't matter, but names that starts with an underscore -are ignored." - (cl-loop for capture - in (treesit-query-capture node query beg end) - for name = (car capture) - for node = (cdr capture) - if (not (string-prefix-p "_" (symbol-name name))) - collect (cons (treesit-node-start node) - (treesit-node-end node)))) +END specifics the range of each captured node. OFFSET is an +optional pair of numbers (START-OFFSET . END-OFFSET). The +respective offset values are added to each (START . END) range +being returned. Capture names generally don't matter, but names +that starts with an underscore are ignored." + (let ((offset-left (or (car offset) 0)) + (offset-right (or (cdr offset) 0))) + (cl-loop for capture + in (treesit-query-capture node query beg end) + for name = (car capture) + for node = (cdr capture) + if (not (string-prefix-p "_" (symbol-name name))) + collect (cons (+ (treesit-node-start node) offset-left) + (+ (treesit-node-end node) offset-right))))) ;;; Range API supplement @@ -509,6 +513,7 @@ treesit-range-rules (treesit-range-rules :embed \\='javascript :host \\='html + :offset \\='(1 . -1) \\='((script_element (raw_text) @cap))) The `:embed' keyword specifies the embedded language, and the @@ -521,13 +526,20 @@ treesit-range-rules this QUERY is given a dedicated local parser. Otherwise, the range shares the same parser with other ranges. +If there's an `:offset' keyword with a pair of numbers, each +captured range is offset by those numbers. For example, an +offset of (1 . -1) will update a captured range of (2 . 8) to +be (3 . 7). This can be used to exclude things like surrounding +delimiters from being included in the range covered by an +embedded parser. + QUERY can also be a function that takes two arguments, START and END. If QUERY is a function, it doesn't need the :KEYWORD VALUE pair preceding it. This function should set the ranges for parsers in the current buffer in the region between START and END. It is OK for this function to set ranges in a larger region that encompasses the region between START and END." - (let (host embed result local) + (let (host embed offset result local) (while query-specs (pcase (pop query-specs) (:local (when (eq t (pop query-specs)) @@ -540,6 +552,12 @@ treesit-range-rules (unless (symbolp embed-lang) (signal 'treesit-error (list "Value of :embed option should be a symbol" embed-lang))) (setq embed embed-lang))) + (:offset (let ((range-offset (pop query-specs))) + (unless (and (consp range-offset) + (numberp (car range-offset)) + (numberp (cdr range-offset))) + (signal 'treesit-error (list "Value of :offset option should be a pair of numbers" range-offset))) + (setq offset range-offset))) (query (if (functionp query) (push (list query nil nil) result) (when (null embed) @@ -547,9 +565,9 @@ treesit-range-rules (when (null host) (signal 'treesit-error (list "Value of :host option cannot be omitted"))) (push (list (treesit-query-compile host query) - embed local) + embed local offset) result)) - (setq host nil embed nil)))) + (setq host nil embed nil offset nil)))) (nreverse result))) (defun treesit--merge-ranges (old-ranges new-ranges start end) @@ -676,6 +694,7 @@ treesit-update-ranges (let ((query (nth 0 setting)) (language (nth 1 setting)) (local (nth 2 setting)) + (offset (nth 3 setting)) (beg (or beg (point-min))) (end (or end (point-max)))) (cond @@ -687,7 +706,7 @@ treesit-update-ranges (parser (treesit-parser-create language)) (old-ranges (treesit-parser-included-ranges parser)) (new-ranges (treesit-query-range - host-lang query beg end)) + host-lang query beg end offset)) (set-ranges (treesit--clip-ranges (treesit--merge-ranges old-ranges new-ranges beg end) diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 65994ce608f..4308e4048f6 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -662,6 +662,20 @@ treesit-range ;; TODO: More tests. ))) +(ert-deftest treesit-range-offset () + "Tests if range offsets work." + (skip-unless (treesit-language-available-p 'javascript)) + (with-temp-buffer + (let ((query '(((call_expression (identifier) @_html_template_fn + (template_string) @capture) + (:equal "html" @_html_template_fn))))) + (progn + (insert "const x = html`

Hello

`;") + (treesit-parser-create 'javascript)) + (should (equal '((15 . 29)) (treesit-query-range 'javascript query))) + (should (equal '((16 . 28)) (treesit-query-range + 'javascript query nil nil '(1 . -1))))))) + ;;; Multiple language (ert-deftest treesit-multi-lang () -- 2.40.1 --=-=-= Content-Type: text/plain Let me know what you think. Thank you, -- Danny Freeman --=-=-=-- From unknown Mon Jun 23 13:15:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2023 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Danny Freeman Cc: casouri@gmail.com, 66004@debbugs.gnu.org Received: via spool by 66004-submit@debbugs.gnu.org id=B66004.169494529213225 (code B ref 66004); Sun, 17 Sep 2023 10:09:01 +0000 Received: (at 66004) by debbugs.gnu.org; 17 Sep 2023 10:08:12 +0000 Received: from localhost ([127.0.0.1]:49103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhohI-0003RF-5g for submit@debbugs.gnu.org; Sun, 17 Sep 2023 06:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhohG-0003R3-A1 for 66004@debbugs.gnu.org; Sun, 17 Sep 2023 06:08:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhoh3-0003ju-ER; Sun, 17 Sep 2023 06:07:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=W/nxRyak+vmNcoxKWmgtY6gqiHvOxMxXG6tGeLYnLnQ=; b=EtpKC/ppfoxO rHk6fRQ7otyIzSEYcvnSi2wQjJMtdUFaH34YBvIBNTbPHfYRLanX0jXTV1/WCAubyj/izMaqEdXyL gJFJ2Yr++q2oILLPym+uZCGbmAVRule+LfPNGmA2D+ogSL4dlzwZ0oblv3E3RE9V1q0vGsUWmhW/0 6yBV5+BTu9gU3DktBKhR0WzLxjTx4snplqWFz7hF1S4EKkuzs/1j1wy7QTbby3HFIdafPwuc8OEY/ i13UNQ2BY92MWAvnIf8zCVytgzozoExGjjlkvu939KY7st92TpiWJIAgtkCx6QLzhlPuSmgqffx+t syNNL4kOmVPu837jTOzZKg==; Date: Sun, 17 Sep 2023 13:07:54 +0300 Message-Id: <831qexglj9.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87o7i32zxz.fsf@dfreeman.email> (bug-gnu-emacs@gnu.org) References: <87o7i32zxz.fsf@dfreeman.email> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 15 Sep 2023 11:45:00 -0400 > From: Danny Freeman via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Background: In clojure-ts-mode I've been capturing docstrings and > applying some limited syntax highlighting using an embedded markdown > parser. I'm only able to capture the full string, "quotes included". I > would like to be able to easily adjust the ranges captured to only > include the contents of the string, delimiters excluded. I have a > similar desire to capture the contents of a regular expression literal > and apply a nested regex grammar. > > I've seen an offset mechanism used by the neovim tree-sitter integration > for similar purposes. > > I believe the javascript/typescript modes could take advantage of this > with template strings. I've included a small test in the patch that > demonstrates this. Yuan, any comments? From unknown Mon Jun 23 13:15:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers Resent-From: Danny Freeman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2023 12:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Yuan Fu Cc: 66004@debbugs.gnu.org Received: via spool by 66004-submit@debbugs.gnu.org id=B66004.169495267725363 (code B ref 66004); Sun, 17 Sep 2023 12:12:02 +0000 Received: (at 66004) by debbugs.gnu.org; 17 Sep 2023 12:11:17 +0000 Received: from localhost ([127.0.0.1]:49289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhqcM-0006ax-6E for submit@debbugs.gnu.org; Sun, 17 Sep 2023 08:11:17 -0400 Received: from out-212.mta0.migadu.com ([91.218.175.212]:60500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhqcG-0006am-LZ for 66004@debbugs.gnu.org; Sun, 17 Sep 2023 08:11:12 -0400 References: <87o7i32zxz.fsf@dfreeman.email> <0D81E83C-E5DB-45C1-AEE6-FE1FD6274A63@gmail.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1694952659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7iJNK8evCR3oZUaIXu86RACrrIrXyUTWwYeEj0XYU3Y=; b=McYpa3okXwg8vRMwXifyRdp3D18bszGquUpmJCtk7FuQ4q6sSUuOaodzO376RmfyDhgEbP 8Begv5gf86neTba+3EooR4fjguH49WyGIsM+AU0KCP9+Qi+BmUPPlQZHuekutaAtAJq/OI ZTdZ11W6DL+iAV1uTzjzrwzdh2btorM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Danny Freeman Date: Sun, 17 Sep 2023 08:05:30 -0400 In-reply-to: <0D81E83C-E5DB-45C1-AEE6-FE1FD6274A63@gmail.com> Message-ID: <87sf7dov8z.fsf@dfreeman.email> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: > This is a good idea, thanks! I believe you=E2=80=99ve sighed copyright as= signment, right? If so, I=E2=80=99ll marge this and push to master. Thank you, and yes I've done the copyright assignment. > BTW, I don=E2=80=99t see this on debbugs. Did you get a confirmation that= the bug report is created? It could be my email client problem though. I did get the email, here is debbugs link https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D66004 I will CC the debbug email. This email just went straight to me. --=20 Danny Freeman From unknown Mon Jun 23 13:15:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Sep 2023 04:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Danny Freeman Cc: 66004@debbugs.gnu.org Received: via spool by 66004-submit@debbugs.gnu.org id=B66004.169501036932293 (code B ref 66004); Mon, 18 Sep 2023 04:13:02 +0000 Received: (at 66004) by debbugs.gnu.org; 18 Sep 2023 04:12:49 +0000 Received: from localhost ([127.0.0.1]:51798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi5cu-0008Om-Oz for submit@debbugs.gnu.org; Mon, 18 Sep 2023 00:12:49 -0400 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]:47558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi5cp-0008OW-MQ for 66004@debbugs.gnu.org; Mon, 18 Sep 2023 00:12:47 -0400 Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6bf01bcb1aeso2447174a34.3 for <66004@debbugs.gnu.org>; Sun, 17 Sep 2023 21:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695010349; x=1695615149; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZXSMBct3DUBjbsyKrni3/c572d5RM8zcgRsZVvHVEiw=; b=LTPowa0vmThJY6jb4DkHMkMdt2h6HKeFyXG+iWTfFP17hUh4Viv73nyr1wLH3hClU3 MUb+crZyHpDiqLAqiBY8E204QjYbfHD6IaySlVjNxDF3fVfr6jyNSroG64v/TN3oBnjC iBYdEUIvG03Lr4I5zjoc1Gu3ohOEIy1Qnpf7D14dL9fIgub9rN//27bZGcQ7SEmpL1TU 8eXTAsPL8pYFaEWEtS5g9dyg6QD/nXncUqV51vHra7XvxVQlll7oBIAiBfHzmHQz3+cf Ci6YTgS2qxBFOLlgrRSQtrdTtF2sM8fBB6DzKB+Zk2/XrgUKlCh4g2O9laM9ihW54kMp daWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695010349; x=1695615149; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZXSMBct3DUBjbsyKrni3/c572d5RM8zcgRsZVvHVEiw=; b=nErJ4WQww8t30/L+8dy5CUbKwkIWhXJ64MBD4i7tkDpJi/izwCK9DJdHcDQ+wKHfyM XqFqox48hY/o4ECfh21r7+6v/HZwILPDGD+BdTd/1nMOtRAYTyfKEg0/ci0fWn9/VSXG qoyaQo8Rzjo+Z5scHqKCemuEi8kzWvX6cfhodJltyp6Nuf30pOWBST+kKKZBPAn6xRVD JtmltXgzar+a2Z28JZmYyIUrDxh3w9VwJ4xIlxS26JI67cAVpu1nL4Nfmy67od03WzME eFQH4lYjM9x/+SpDUyl4iZJ7RFfSB36h73+S3AJU7HI08r+EAngIBKM2JmXHxnzNjvqy J43g== X-Gm-Message-State: AOJu0YyE52lQ32ASvdDabelzJWR90y/M0vRij++Z30XIvGk3jJh3ucgT Th1EtC5HPx8QQY/JSHimMuR87x3I3Z0= X-Google-Smtp-Source: AGHT+IG1+4LsOZej07VCMbBwVNAx2pyj+rUpUm9JTWhiVEkeqs+1pHgLQm6dhHVb+eRN3CTKpav85w== X-Received: by 2002:a05:6358:98a8:b0:134:e301:2c21 with SMTP id q40-20020a05635898a800b00134e3012c21mr7587191rwa.15.1695010349478; Sun, 17 Sep 2023 21:12:29 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id c10-20020a62e80a000000b0064fd4a6b306sm6307283pfi.76.2023.09.17.21.12.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Sep 2023 21:12:29 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) From: Yuan Fu In-Reply-To: <87sf7dov8z.fsf@dfreeman.email> Date: Sun, 17 Sep 2023 21:12:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <39805BC0-BC0E-42E8-95EF-3E50B66BD550@gmail.com> References: <87o7i32zxz.fsf@dfreeman.email> <0D81E83C-E5DB-45C1-AEE6-FE1FD6274A63@gmail.com> <87sf7dov8z.fsf@dfreeman.email> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Sep 17, 2023, at 5:05 AM, Danny Freeman = wrote: >=20 >=20 > Yuan Fu writes: >=20 >> This is a good idea, thanks! I believe you=E2=80=99ve sighed = copyright assignment, right? If so, I=E2=80=99ll marge this and push to = master. >=20 > Thank you, and yes I've done the copyright assignment. >=20 >> BTW, I don=E2=80=99t see this on debbugs. Did you get a confirmation = that the bug report is created? It could be my email client problem = though. >=20 > I did get the email, here is debbugs link > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D66004 >=20 > I will CC the debbug email. This email just went straight to me. I didn=E2=80=99t CC debbugs since I didn=E2=80=99t know the bug number. = Anyway, it seems to be my email provider=E2=80=99s problem. I made some minor changes and pushed to master, thanks again! Yuan= From unknown Mon Jun 23 13:15:07 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Danny Freeman Subject: bug#66004: closed (Re: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers) Message-ID: References: <87o7i32zxz.fsf@dfreeman.email> X-Gnu-PR-Message: they-closed 66004 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 66004@debbugs.gnu.org Date: Mon, 18 Sep 2023 22:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1695077582-18397-1" This is a multi-part message in MIME format... ------------=_1695077582-18397-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #66004: [PATCH] Offset ranges before applying embeded treesit parsers which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 66004@debbugs.gnu.org. --=20 66004: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D66004 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1695077582-18397-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 66004-done) by debbugs.gnu.org; 18 Sep 2023 22:53:00 +0000 Received: from localhost ([127.0.0.1]:54907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiN6x-0004mW-Q8 for submit@debbugs.gnu.org; Mon, 18 Sep 2023 18:53:00 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:55402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiN6w-0004mH-Qe for 66004-done@debbugs.gnu.org; Mon, 18 Sep 2023 18:52:59 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b9338e4695so80743611fa.2 for <66004-done@debbugs.gnu.org>; Mon, 18 Sep 2023 15:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695077564; x=1695682364; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=o+0FQD0GLDMhKDd5yz3X4Jy8wtxdO75Unl2YKkoGNNc=; b=e5/qq3G5HKWokpqij71Gk9gcDHQ+lPdus9+l0J35wfgBz77uK96ZtvIeB6pSrOKlj9 ibTsd+pmrI2w+4W6Lt0ncj7i7tFJRDHg0SvxEf00xULSrRKx205jlJh05xWHyWBBptYf gBFY5wTYcahSqSxACmgjvf6GzspB74sRYOxxapIJtFhz3C7oR/fSFHRdz1FXnTgyKCAq y2vQTqJRzNuenW00C31g0W9L/E6jHDF1Ff0OXC7Zz3r66SBuYxCNfnJ3evHPIymr+6i7 acE23jhvWToh1vD9vDMSwjnaDjXbEzzTdaTxzxCNpgfmfQhv2ShuS8qroeql3T6BcF+U SCng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695077564; x=1695682364; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o+0FQD0GLDMhKDd5yz3X4Jy8wtxdO75Unl2YKkoGNNc=; b=mazfvIRy8cth79Nc0cEO8RG6ydJIBmlUaj6gjRWwyTuSVKYfu6aqwvlxMNslTF9k8h CUAH9dUU7fWPejE3XoFrwttriV+JlOZ/QZqsrfzEOQ3x2xBoAU+x9h38q8ecauQMxrPh zw7YOyxx2E/fhjZjNf7JSNYRM5WYxYisXSVhpDprCs+YRmCTVDZ8b0UGYBdwNCiNc3kX W3lrjkvg68NUdO8KiZ3Ps4rtGuHT0zdpGegNuXXTzdNOIhclKfxUH84jRHX1a5/g/VAU pAaa28PU0hXyQNG/hYwQN9W+W0arlL+4Mr6GkmkGv8ZHSo5G/MCjBPr4qODR/sm7/G4i Ck4g== X-Gm-Message-State: AOJu0YzV68HQexADHTNdEfkHOKIxprkTcpzlJdRd5yceJR48tDlBtGa8 HoS7GHHtqWJQlZWFEglfORCt5jR08jeyI+7OtM8= X-Google-Smtp-Source: AGHT+IEcG7QocVJUoiuFwqQiGr5INUqeSJHZHBbL+q1/XSbQwyh6bgCLhMNKm4hc73byUnrvalmxLD3Cc7+td++kh2I= X-Received: by 2002:a2e:870e:0:b0:2ba:18e5:106d with SMTP id m14-20020a2e870e000000b002ba18e5106dmr8929007lji.1.1695077564210; Mon, 18 Sep 2023 15:52:44 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 18 Sep 2023 15:52:43 -0700 From: Stefan Kangas In-Reply-To: <39805BC0-BC0E-42E8-95EF-3E50B66BD550@gmail.com> (Yuan Fu's message of "Sun, 17 Sep 2023 21:12:16 -0700") References: <87o7i32zxz.fsf@dfreeman.email> <0D81E83C-E5DB-45C1-AEE6-FE1FD6274A63@gmail.com> <87sf7dov8z.fsf@dfreeman.email> <39805BC0-BC0E-42E8-95EF-3E50B66BD550@gmail.com> MIME-Version: 1.0 Date: Mon, 18 Sep 2023 15:52:43 -0700 Message-ID: Subject: Re: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers To: Yuan Fu Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66004-done Cc: 66004-done@debbugs.gnu.org, Danny Freeman X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: > I made some minor changes and pushed to master, thanks again! It seems like the patch was installed, but was left open in the bug tracker. I'm therefore closing it now. ------------=_1695077582-18397-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Sep 2023 15:56:30 +0000 Received: from localhost ([127.0.0.1]:44525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhBBF-00074m-WE for submit@debbugs.gnu.org; Fri, 15 Sep 2023 11:56:30 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhBBD-00074V-58 for submit@debbugs.gnu.org; Fri, 15 Sep 2023 11:56:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhBB0-0002ur-Sd for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 11:56:14 -0400 Received: from out-217.mta1.migadu.com ([2001:41d0:203:375::d9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhBAx-0003cg-Je for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 11:56:14 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1694793367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=ta4ocfaATcWMkwyozPEoXJNFwfWx61zjDBfdEMyjy4M=; b=Du96DDFh6nrbaAO6etGklLatbV6l/vx1jGZB12SNkB5EkoNL1/XBkZ1uhXF+AP77xcy1k4 9nnWunWi+ehwLgVgaJFxxDAUOpKy/56/OcYqeG5QG12IXSxU0cMYlqDxE7koHCrykuzDmP 0MCfBquL4AzgaH6M6A7Nj+Ep2WFFF5U= From: Danny Freeman To: bug-gnu-emacs@gnu.org, Yuan Fu Subject: [PATCH] Offset ranges before applying embeded treesit parsers Date: Fri, 15 Sep 2023 11:45:00 -0400 Message-ID: <87o7i32zxz.fsf@dfreeman.email> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::d9; envelope-from=danny@dfreeman.email; helo=out-217.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Background: In clojure-ts-mode I've been capturing docstrings and applying some limited syntax highlighting using an embedded markdown parser. I'm only able to capture the full string, "quotes included". I would like to be able to easily adjust the ranges captured to only include the contents of the string, delimiters excluded. I have a similar desire to capture the contents of a regular expression literal and apply a nested regex grammar. I've seen an offset mechanism used by the neovim tree-sitter integration for similar purposes. I believe the javascript/typescript modes could take advantage of this with template strings. I've included a small test in the patch that demonstrates this. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Offset-ranges-before-applying-embedded-tree-sitter-p.patch >From 61b89cf08ff8eb6e984d862519b9a0750f7f0cd0 Mon Sep 17 00:00:00 2001 From: Danny Freeman Date: Fri, 15 Sep 2023 11:29:05 -0400 Subject: [PATCH] Offset ranges before applying embedded tree-sitter parser * lisp/treesit.el (treesit-query-range): Accept an optional offest arg, apply the offset to all returned ranges (treesit-range-rules): Accept an optional :offset keyword arg to adjust ranges an embded parser is applied to (treesit-update-ranges): Forward optional :offset setting from `treesit-range-rules' to `treesit-query-rang' * test/lisp/treesit-tests.el (treesit-range-offset): Tests the new offset functioanlity This is feature would allow treesitter major modes to easily specify offsets when using embeded parsers. A potential use case for this is javascript template strings, when we want to apply a different parser to the string's contents, but do not want to include the template string's delmiters. --- lisp/treesit.el | 49 +++++++++++++++++++++++++++------------ test/src/treesit-tests.el | 14 +++++++++++ 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 78bd149b7e2..0b257c93c44 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -449,21 +449,25 @@ treesit-query-string (treesit-parser-root-node parser) query)))) -(defun treesit-query-range (node query &optional beg end) +(defun treesit-query-range (node query &optional beg end offset) "Query the current buffer and return ranges of captured nodes. QUERY, NODE, BEG, END are the same as in `treesit-query-capture'. This function returns a list of (START . END), where START and -END specifics the range of each captured node. Capture names -generally don't matter, but names that starts with an underscore -are ignored." - (cl-loop for capture - in (treesit-query-capture node query beg end) - for name = (car capture) - for node = (cdr capture) - if (not (string-prefix-p "_" (symbol-name name))) - collect (cons (treesit-node-start node) - (treesit-node-end node)))) +END specifics the range of each captured node. OFFSET is an +optional pair of numbers (START-OFFSET . END-OFFSET). The +respective offset values are added to each (START . END) range +being returned. Capture names generally don't matter, but names +that starts with an underscore are ignored." + (let ((offset-left (or (car offset) 0)) + (offset-right (or (cdr offset) 0))) + (cl-loop for capture + in (treesit-query-capture node query beg end) + for name = (car capture) + for node = (cdr capture) + if (not (string-prefix-p "_" (symbol-name name))) + collect (cons (+ (treesit-node-start node) offset-left) + (+ (treesit-node-end node) offset-right))))) ;;; Range API supplement @@ -509,6 +513,7 @@ treesit-range-rules (treesit-range-rules :embed \\='javascript :host \\='html + :offset \\='(1 . -1) \\='((script_element (raw_text) @cap))) The `:embed' keyword specifies the embedded language, and the @@ -521,13 +526,20 @@ treesit-range-rules this QUERY is given a dedicated local parser. Otherwise, the range shares the same parser with other ranges. +If there's an `:offset' keyword with a pair of numbers, each +captured range is offset by those numbers. For example, an +offset of (1 . -1) will update a captured range of (2 . 8) to +be (3 . 7). This can be used to exclude things like surrounding +delimiters from being included in the range covered by an +embedded parser. + QUERY can also be a function that takes two arguments, START and END. If QUERY is a function, it doesn't need the :KEYWORD VALUE pair preceding it. This function should set the ranges for parsers in the current buffer in the region between START and END. It is OK for this function to set ranges in a larger region that encompasses the region between START and END." - (let (host embed result local) + (let (host embed offset result local) (while query-specs (pcase (pop query-specs) (:local (when (eq t (pop query-specs)) @@ -540,6 +552,12 @@ treesit-range-rules (unless (symbolp embed-lang) (signal 'treesit-error (list "Value of :embed option should be a symbol" embed-lang))) (setq embed embed-lang))) + (:offset (let ((range-offset (pop query-specs))) + (unless (and (consp range-offset) + (numberp (car range-offset)) + (numberp (cdr range-offset))) + (signal 'treesit-error (list "Value of :offset option should be a pair of numbers" range-offset))) + (setq offset range-offset))) (query (if (functionp query) (push (list query nil nil) result) (when (null embed) @@ -547,9 +565,9 @@ treesit-range-rules (when (null host) (signal 'treesit-error (list "Value of :host option cannot be omitted"))) (push (list (treesit-query-compile host query) - embed local) + embed local offset) result)) - (setq host nil embed nil)))) + (setq host nil embed nil offset nil)))) (nreverse result))) (defun treesit--merge-ranges (old-ranges new-ranges start end) @@ -676,6 +694,7 @@ treesit-update-ranges (let ((query (nth 0 setting)) (language (nth 1 setting)) (local (nth 2 setting)) + (offset (nth 3 setting)) (beg (or beg (point-min))) (end (or end (point-max)))) (cond @@ -687,7 +706,7 @@ treesit-update-ranges (parser (treesit-parser-create language)) (old-ranges (treesit-parser-included-ranges parser)) (new-ranges (treesit-query-range - host-lang query beg end)) + host-lang query beg end offset)) (set-ranges (treesit--clip-ranges (treesit--merge-ranges old-ranges new-ranges beg end) diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 65994ce608f..4308e4048f6 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -662,6 +662,20 @@ treesit-range ;; TODO: More tests. ))) +(ert-deftest treesit-range-offset () + "Tests if range offsets work." + (skip-unless (treesit-language-available-p 'javascript)) + (with-temp-buffer + (let ((query '(((call_expression (identifier) @_html_template_fn + (template_string) @capture) + (:equal "html" @_html_template_fn))))) + (progn + (insert "const x = html`

Hello

`;") + (treesit-parser-create 'javascript)) + (should (equal '((15 . 29)) (treesit-query-range 'javascript query))) + (should (equal '((16 . 28)) (treesit-query-range + 'javascript query nil nil '(1 . -1))))))) + ;;; Multiple language (ert-deftest treesit-multi-lang () -- 2.40.1 --=-=-= Content-Type: text/plain Let me know what you think. Thank you, -- Danny Freeman --=-=-=-- ------------=_1695077582-18397-1-- From unknown Mon Jun 23 13:15:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Sep 2023 03:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Kangas Cc: 66004-done@debbugs.gnu.org, Danny Freeman Received: via spool by 66004-done@debbugs.gnu.org id=D66004.169509450225457 (code D ref 66004); Tue, 19 Sep 2023 03:36:02 +0000 Received: (at 66004-done) by debbugs.gnu.org; 19 Sep 2023 03:35:02 +0000 Received: from localhost ([127.0.0.1]:55058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiRVt-0006cT-IS for submit@debbugs.gnu.org; Mon, 18 Sep 2023 23:35:01 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:56333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiRVo-0006c3-44 for 66004-done@debbugs.gnu.org; Mon, 18 Sep 2023 23:34:59 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1c3d6d88231so41684345ad.0 for <66004-done@debbugs.gnu.org>; Mon, 18 Sep 2023 20:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695094481; x=1695699281; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ViENRzBdkWQfEqG7lRTXtaGqyjN3pxXFQJ7xhl3xxz8=; b=TXXy2ltjQlU6diYw44zDC6KqGIfQ/u86TLxDDjGMO+EcR379HPTOBN8lfvBunF8UIL zXAe3mToJAvnNEcLJvaDFnB7FvKFT98Smvc7uMazvge+WgB+RR6aY5zTJ0/g/CdK11NY tB/umqlMJRWkLsKJtQczSuCgLRAZ0QsZIVeuuDj3cvT+koSoS6MHmSpkAlxWz9QBzgxJ eWc/qLgz8Mj9l4W2iJSVdIzQ3Brp9oeYRk3XJ4Iui3UCfZaid+m+MBrmPStbsFX+Awee zCW9poB6vlowGebyH1dtlA80JyyNOilD9bEVIHn2XsitZqS45KAjDd+/o/8tK9L1lPfc Wh6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695094481; x=1695699281; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ViENRzBdkWQfEqG7lRTXtaGqyjN3pxXFQJ7xhl3xxz8=; b=haM784k0QhvssF84r44eCYEwymSkH4mAev35jvuZymuffDR/ewBEr2F83/DTQ8oZys Un4TY3J7nC1RmM7ReLPIWisg6Vlb7fNG7J7CXgd3T29uvrfLz83ABf7mMM4EPHaI/7yF qE45dr+gA4IsH2/aDOt37amoPPXx7bDxl023nboArzZKotOAtIXKjdMYl8UsanOM9U0p V01GSHXh5jEzjIAztBERLgQvE3+iVJiXoyi2G54e9sJDH7AMtgeIhHvGaUdLVSEkGHDM f3rSez16z5qxbCQ9+SP/0Y+Tu8Jy8g1ASENoKzuLnuxwv9OSmV7kc9UXkVR+gsrAvraY xJ2w== X-Gm-Message-State: AOJu0YwJSjYxIhsPbfX3fdG+Yc366Qyh2tnmwDs5jDtm+IS/f7o/9o0M UWCwISnRzZ+zbgAN+cVDQVg= X-Google-Smtp-Source: AGHT+IGdYpkwoZ/4B/uUf55KspylxPmtnVbTWd2qeBR4vaJFuWQIV6S46imOYpG8gV55Iidsq/TwvQ== X-Received: by 2002:a17:902:ea0e:b0:1c4:72c9:64ef with SMTP id s14-20020a170902ea0e00b001c472c964efmr5421314plg.40.1695094481495; Mon, 18 Sep 2023 20:34:41 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id jw10-20020a170903278a00b001b8062c1db3sm4258630plb.82.2023.09.18.20.34.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2023 20:34:41 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) From: Yuan Fu In-Reply-To: Date: Mon, 18 Sep 2023 20:34:29 -0700 Content-Transfer-Encoding: 7bit Message-Id: <867A12A2-DF35-4CBA-A38A-5330903C407E@gmail.com> References: <87o7i32zxz.fsf@dfreeman.email> <0D81E83C-E5DB-45C1-AEE6-FE1FD6274A63@gmail.com> <87sf7dov8z.fsf@dfreeman.email> <39805BC0-BC0E-42E8-95EF-3E50B66BD550@gmail.com> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Sep 18, 2023, at 3:52 PM, Stefan Kangas wrote: > > Yuan Fu writes: > >> I made some minor changes and pushed to master, thanks again! > > It seems like the patch was installed, but was left open in the bug > tracker. I'm therefore closing it now. Thank you, Stefan. Yuan