From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 06:54:27 2023 Received: (at submit) by debbugs.gnu.org; 7 Jan 2023 11:54:27 +0000 Received: from localhost ([127.0.0.1]:56596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE7mM-0005Lv-JJ for submit@debbugs.gnu.org; Sat, 07 Jan 2023 06:54:27 -0500 Received: from lists.gnu.org ([209.51.188.17]:56944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE7mK-0005Ll-VW for submit@debbugs.gnu.org; Sat, 07 Jan 2023 06:54:25 -0500 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 1pE7mK-0008EI-CP for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 06:54:24 -0500 Received: from out-10.mta0.migadu.com ([91.218.175.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pE7mH-00085C-Kc for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 06:54:24 -0500 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=thornhill.no; s=key1; t=1673092456; 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=EO1YEgA68QXCXqiexzqKBDf2M/KHINsMIZtKn/AqIUM=; b=Z7OnSOwAzPCMPTaHFSVcrsh55n5Y5rhoSGJ+YC99mKuCm9uXPM8p3OSvk3H5KCVxabO7/k z+G8893oLWmfLgGmc90CdUIAd/dSTe1Kydv9e8UlIjqOxuQGDFlIrr0nU1WLb7IN/I80oN CxbGtkkkYszcFHgIhcxCi+fV+aXAGamVxBrpk92P/8KMPqrMHH1D+fXXEjjtogAQ7+RUlM 1rqaZWe1PjYnrBpqElk6hKggxCybmyjzF620X7CCCU8YI22b1+UBLAcoLAhWK5vlrRGu4J kBuXGoDhHODuxOl61U+jSW+7S0N8ewWPonhHaTYk4TOXHArlX2hFmdS4yoCRwg== From: Theodor Thornhill To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Add forward-sentence with tree sitter support X-Debbugs-Cc: casouri@gmail.com, eliz@gnu.org, monnier@iro.umontreal.ca Date: Sat, 07 Jan 2023 12:54:13 +0100 Message-ID: <87o7ratva2.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.10; envelope-from=theo@thornhill.no; helo=out-10.mta0.migadu.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain Hi all! This patch tweaks the forward-sentence function to be usable with tree-sitter. It follows the same style as the recent change in transpose-sexps, so I hope it isn't too controversial. What exact node types do you consider useful for sentence movement? I added an example value in java-ts-mode and c-ts-mode, but that is merely a suggestion. Let's decide on some heuristic to decide the proper nodes to use. What do you think? Theo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-forward-sentence-with-tree-sitter-support.patch >From 32eb3c3401f2232c349843e21269ff88e982945e Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sat, 7 Jan 2023 12:44:14 +0100 Subject: [PATCH] Add forward-sentence with tree sitter support * etc/NEWS: Mention the new changes. * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Set the variable. * lisp/progmodes/java-ts-mode.el (java-ts-mode): Set the variable. * lisp/textmodes/paragraphs.el (forward-sentence-function): Move old implementation to a new defvar. (forward-sentence): Use the variable in this function unconditionally. * lisp/treesit.el (treesit-sentence-type-regexp): New defvar. (treesit-forward-sentence): New defun. (treesit-major-mode-setup): Conditionally set forward-sentence-function. --- etc/NEWS | 12 ++++++ lisp/progmodes/c-ts-mode.el | 8 ++++ lisp/progmodes/java-ts-mode.el | 6 +++ lisp/textmodes/paragraphs.el | 71 +++++++++++++++++++--------------- lisp/treesit.el | 18 +++++++++ 5 files changed, 83 insertions(+), 32 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a2924201267..5b4533b0522 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -57,6 +57,18 @@ treesit.el now unconditionally sets 'transpose-sexps-function' for all Tree-sitter modes. This functionality utilizes the new 'transpose-sexps-function'. +** New defvar-local forward-sentence-function. +The previous implementation of 'forward-sentence' is moved into this +variable, which can be set to customize the sentece movement behavior. + +** New defvar-local 'treesit-sentence-type-regexp. +Similarly to 'treesit-defun-type-regexp', this variable is used to +navigate sentences in Tree-sitter enabled modes. + +** New function 'treesit-forward-sentence'. +treesit.el now conditionally sets 'forward-sentence-function' for all +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. + * Changes in Specialized Modes and Packages in Emacs 30.1 --- diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index e76966e7660..3794286162e 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -735,6 +735,14 @@ c-ts-base-mode :syntax-table c-ts-mode--syntax-table ;; Navigation. + (setq-local treesit-sentence-type-regexp + (regexp-opt '("statement" + "expression" + "definition" + "specifier" + "declaration" + "comment" + "preproc"))) (setq-local treesit-defun-type-regexp (cons (regexp-opt '("function_definition" "type_definition" diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 87a4e2b90f8..0e3381e219a 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -296,6 +296,12 @@ java-ts-mode (append "{}():;," electric-indent-chars)) ;; Navigation. + (setq-local treesit-sentence-type-regexp + (regexp-opt '("statement" + "expression" + "parameters" + "list" + "comment"))) (setq-local treesit-defun-type-regexp (regexp-opt '("method_declaration" "class_declaration" diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 73abb155aaa..5bbb77c1cb6 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -441,44 +441,51 @@ end-of-paragraph-text (if (< (point) (point-max)) (end-of-paragraph-text)))))) -(defun forward-sentence (&optional arg) +(defvar forward-sentence-function + (lambda (&optional arg) + (let ((opoint (point)) + (sentence-end (sentence-end))) + (while (< arg 0) + (let ((pos (point)) + par-beg par-text-beg) + (save-excursion + (start-of-paragraph-text) + ;; Start of real text in the paragraph. + ;; We move back to here if we don't see a sentence-end. + (setq par-text-beg (point)) + ;; Start of the first line of the paragraph. + ;; We use this as the search limit + ;; to allow sentence-end to match if it is anchored at + ;; BOL and the paragraph starts indented. + (beginning-of-line) + (setq par-beg (point))) + (if (and (re-search-backward sentence-end par-beg t) + (or (< (match-end 0) pos) + (re-search-backward sentence-end par-beg t))) + (goto-char (match-end 0)) + (goto-char par-text-beg))) + (setq arg (1+ arg))) + (while (> arg 0) + (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) + (if (re-search-forward sentence-end par-end t) + (skip-chars-backward " \t\n") + (goto-char par-end))) + (setq arg (1- arg))) + (let ((npoint (constrain-to-field nil opoint t))) + (not (= npoint opoint))))) "Move forward to next end of sentence. With argument, repeat. When ARG is negative, move backward repeatedly to start of sentence. The variable `sentence-end' is a regular expression that matches ends of -sentences. Also, every paragraph boundary terminates sentences as well." +sentences. Also, every paragraph boundary terminates sentences as well.") + +(defun forward-sentence (&optional arg) + "Move forward to next end of sentence. With argument, repeat. +When ARG is negative, move backward repeatedly to start of sentence. +Delegates its work to `forward-sentence-function'." (interactive "^p") (or arg (setq arg 1)) - (let ((opoint (point)) - (sentence-end (sentence-end))) - (while (< arg 0) - (let ((pos (point)) - par-beg par-text-beg) - (save-excursion - (start-of-paragraph-text) - ;; Start of real text in the paragraph. - ;; We move back to here if we don't see a sentence-end. - (setq par-text-beg (point)) - ;; Start of the first line of the paragraph. - ;; We use this as the search limit - ;; to allow sentence-end to match if it is anchored at - ;; BOL and the paragraph starts indented. - (beginning-of-line) - (setq par-beg (point))) - (if (and (re-search-backward sentence-end par-beg t) - (or (< (match-end 0) pos) - (re-search-backward sentence-end par-beg t))) - (goto-char (match-end 0)) - (goto-char par-text-beg))) - (setq arg (1+ arg))) - (while (> arg 0) - (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) - (if (re-search-forward sentence-end par-end t) - (skip-chars-backward " \t\n") - (goto-char par-end))) - (setq arg (1- arg))) - (let ((npoint (constrain-to-field nil opoint t))) - (not (= npoint opoint))))) + (funcall forward-sentence-function arg)) (defun count-sentences (start end) "Count sentences in current buffer from START to END." diff --git a/lisp/treesit.el b/lisp/treesit.el index a7f453a8899..ec4d711bba8 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1783,6 +1783,22 @@ treesit-end-of-defun (when treesit-defun-skipper (funcall treesit-defun-skipper)))) +(defvar-local treesit-sentence-type-regexp "" + "A regexp that matches the node type of sentence nodes. + +A sentence node is a node that is bigger than a sexp, and +delimits larger statements in the source code. It is, however, +smaller in scope than defuns. This is used by +`treesit-forward-sentence' and friends.") + +(defun treesit-forward-sentence (&optional arg) + "Tree-sitter `forward-sentence-function' function. +ARG is the same as in `forward-sentence'. Behavior of this +function depends on `treesit-sentence-type-regexp'." + (funcall + (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) + treesit-sentence-type-regexp (abs arg))) + (defvar-local treesit-text-type-regexp "\\`comment\\'" "A regexp that matches the node type of textual nodes. @@ -2256,6 +2272,8 @@ treesit-major-mode-setup #'treesit-add-log-current-defun)) (setq-local transpose-sexps-function #'treesit-transpose-sexps) + (when treesit-sentence-type-regexp + (setq-local forward-sentence-function #'treesit-forward-sentence)) ;; Imenu. (when treesit-simple-imenu-settings -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 10:42:09 2023 Received: (at submit) by debbugs.gnu.org; 7 Jan 2023 15:42:09 +0000 Received: from localhost ([127.0.0.1]:58747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEBKi-0005uQ-UC for submit@debbugs.gnu.org; Sat, 07 Jan 2023 10:42:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:53488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEBKg-0005uD-Uk for submit@debbugs.gnu.org; Sat, 07 Jan 2023 10:42:07 -0500 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 1pEBKg-0007P8-PM for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 10:42:06 -0500 Received: from sonic307-54.consmr.mail.ir2.yahoo.com ([87.248.110.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEBKe-0001jE-Of for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 10:42:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1673106120; bh=hjmbE2lgd2cKDHYbBB0NSVvR/XeLFHmpFJR66k3HQRk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=TILFen8n4fKvaFhzHbGWEx2vTn3INJ6pgy79yvS8Bde8RxVtyMKHVc9HEp7l0jSQpHGsojqmXYvm+PaKd8gjqRD4z7LRb2SHlyIOD+sVYNq8f8C5YnjjkKGHGAmLoZpkqC09oFYs2ExpbHITYSJEw67bwh0F5DV0D9KNcrhJnVfK3Xp+grbG8mI40kquCJNWb/OWry6Df5FkKx7DR7x/DYXHHpEcT6mFY4ZGMfLmRH0eWZxGkbpOZ8aK+vZwgh+5SqsgNemikAGUwyaeRulA6mDlmDlHMog13f2GucmNyU9K12w5v9epMQsh0dyvSfc+N75Ilvd8ssCaZiUQWN81RQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1673106120; bh=pZcr917oWfU6ViT5npNosKxLDpgWL/o9Mv7qCxhQs8V=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=SX027hEyh9Mp+TVBvgBAbs7bfJ6IwHgMoIHcM/nzgRlG0cAx1iamBUfTAbo/KeHlPjhpgxzciWTgliAA38QXl61FE/MRSHMUh3H1ioxbzjS97zINI3OfC789Qr3ciUavimPO7rdBjObtYt5cvoYtIrbPbBzleOx/bhmfK+/ELGetmK7+a0lEH80EWi4Pgy4LlIXN9N2zIWf+NeUFe0Kd6w3f0fhis0L9puDwtpiiuoshCOmTemktf4yYy2OdvM6JcXLSlRUiyUGKwY3YJvAeO4LxryoIj5TsksuwQZHPsk3zWIsPRg1s4GnHtam/6y5ILdPT2eiUfEByxLLBFl2dgg== X-YMail-OSG: k0mLNWUVM1mDtIEu3Bi3qXqrIKvddManfFLQ5a.596smbCMNx7M642XlP0OH6Pn 1BVFwqM.BEZEU0VvVOCPb.zQznxaKvwdx3xeO0s4nHSIqOdlQ4WgLqdYhepIE6uzJE4LRZnkYiZo qYeIn9KjdsAVGDrnU1H2VqCdGV6vb8q_QjClmw2m2pD9tybNXMTAeO9ncJxzbtn1y.JS0W10y8jW XWCd3haRGCR3eMJaAzgynyrcxj_wHMlIP78qF_LQWje10fnl2Z_DyIShPRZftURTalzObza343yw cK9ZhyaPDz7YDcbwnMsmmrmkZQ5VB23oHkZXI4ocZh2wA6t9ZQD.hrpClBXJnskMrjE5tCIpu0S. vrYLe9grC2qe4oKEBWqWsOLbGeQ8RgbWqEMndr.O3hmts0dM1DSHGOPjnQCo46RgcYKsycwF5IDh _tyvWVg_jyJXySpip9ghX4W08Uwn1XaIopiGwNdPYLm8txYMWmGPPKpBRe8O4Fm0YqFeH3LA3DSU GCV0ihCfiSE21YWQvMQt5vKvSWxX86UmCDGgK40Rm3f8LTLsfmThigqWN4BGZqfnv0iXjAcxdslG TgWkANcaa5EX2bVwgtr0qfYHCt56TeDzt_rjCMcy9.HwbvojbKsnRwFz7RY5A7mEPd4Mh.r3.adh jVshkOzsA2AnqyNhBe1j7LXBs1I56jYLtmxnqO2Wz_FcBfcudO5Dxo5sGTRw9Z82Ccw80g5kOIfy qvRTIIXrmFh43EMQ5CUzho_xHUMMQoQAvnsIDXFdmLFnGGh2kXejF8h8tfn_n6PixvBJEhBePnVd XZnpRxOHPKM0vdldD17CM5vEnzSCCQ7fgYVfENedOPSni020DcGRo2CbOhL0R.PxkIWlO.08wuBt UdWe2XhXUfpoekH8n.WBjkGT9RMMrW69hZchR0R9fdX9TiZOKmgdduUhMZl3FYDkAnNnYSsz79m. DsGOw2Xdi6QcU8d4aapX9nI.Ozy_7V5d5yava.UbxEF8Bolr04JOIAiIVR.GtFu6iTm12fXwircv Y3p2eQPfkKeG1pax8z8Ip5FtTFXKW_4EFnbCC7h6lcAwXRT.iAxkx9yv79y2MCCchNzyQu1jPOQu EYMhFmD52eWMgy2pFteivyLMoJIpiGSkLMx33DBKoYcY8ExYuyhLdQ9qRJ23HFNeW5ntOSMfRT_J M7h7Px_VOBDmqrl383FmfdI3R_OVSPiTmjpJr4v2OkrgtSnQ4yVIjmTlNvF0NcOdSg26tR42c0UL DOkZM9lBUT3d2jkUlKMnr_ArnEVWdaVPxF8GcjJKbM0cLTy4hJz1usqwSNHk4ipac390Ifth0g._ .4CpNVv6dN_s5HW9XiM_d7VbTbzlllARNrBoqZTDmdphsw0fMMYwM1sCpcMOb3pA3aENbPCKBFAz .T4ueZWYS7N6pEp7K_g1kdYRApMTi2jpCrufkSHTB08PmBeo6oJipLsNSuud0S7H8NGUT_FV6ZZR QXYJzTFB6.YmaxOfQM3Y8l80fP2lsI76ZwoQNby87eGJTnQPR0jHploBtp7X2L9bpjja8WeJO5FX rV2ZzgCjkOx6K2RmvssARyryENP3sKnOm5_C8lbTp_wTs35E5xH.YXqa3kDdWJChspSj_DbLo0.o KXheYrmKXYbGKKEAFU3D0XRvsPLCH9fBKOITUeCpH7ivPF0bGqYB2_lEcnlTB5f0LaggSVmxuMPA iqqnsDn6nCWvh_duksaqWLLHTBHEt3CzFALQQDcWxCm2FHLGlAW_u_arzUiNcEVwpoJIMN5XRZFv 0TXI225D_qbzACM3tg.xrP.nC3FlGEyRMj1.beBkMk4I0Jq0fKjNi4nUiStXpVqWs.e1h.oZrvgq 7Jxr3bN4CbQxBYLBXitWggD7D3pS4kuxIOyijvjOvDgiFlY8UFeHUaucoj8OgdcjeihInkbMvoYk VT5tEPKjtUUYX1k6ZorYSPioNfHtaIFiZzFKWQ0yJahQ6W4PSQXZHkYb.xaIuq2V_Q2d27qeziR6 CaTXUldu.0auK7LDijuLtbfE9GwFtks97U1d.BZ7F5nQEscUiGSWPybFTPZORTRdHtIa9o5zjfiW 3R1yySkdBT6otkxLo4AhBrf.nYyaA3KAPUemRLK1sRiTzClbf7wU8oB3sfrtrbSK3QNmF6XvYPVM LTvH36kcZQnYE9gS6D4YtBxMtEK7yXnUtrVR.cH5zHS4rWX5gKsOMi4p9vQ9cgcCi2.3QYLjdZQ4 nIY_dZ64GJmibTTYnKtpRYTerR9Ae2ztXQcu780xMojgG X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Sat, 7 Jan 2023 15:42:00 +0000 Received: by hermes--production-ir2-5795fc58c8-hmjd6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID ec1c991b6cc5c08758bd843eaad2fa3a; Sat, 07 Jan 2023 15:41:58 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support References: <87o7ratva2.fsf@thornhill.no> Date: Sat, 07 Jan 2023 16:41:57 +0100 In-Reply-To: <87o7ratva2.fsf@thornhill.no> (Theodor Thornhill via's message of "Sat, 07 Jan 2023 12:54:13 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.20982 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1129 Received-SPF: pass client-ip=87.248.110.31; envelope-from=mardani29@yahoo.es; helo=sonic307-54.consmr.mail.ir2.yahoo.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: 60623@debbugs.gnu.org, Theodor Thornhill , casouri@gmail.com, monnier@iro.umontreal.ca, eliz@gnu.org 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: -2.4 (--) Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Hi all! > > This patch tweaks the forward-sentence function to be usable with > tree-sitter. > > It follows the same style as the recent change in transpose-sexps, so I > hope it isn't too controversial. Thanks. > > What exact node types do you consider useful for sentence movement? > I haven't thought much about your proposed nodes, I initially thought that sentences in a programming language are just "statements". As a suggestion, treesit-forward-sentence could navigate by textual sentences when point is inside comments or strings. > +** New defvar-local forward-sentence-function. > +The previous implementation of 'forward-sentence' is moved into this > +variable, which can be set to customize the sentece movement behavior. ^^^^^^^ sentence Also, this feature probably needs an update to the Info documentation to mention that Tree-sitter can specialize sentence commands in programming modes. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 03:49:34 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 08:49:34 +0000 Received: from localhost ([127.0.0.1]:59817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pERN0-0000pb-2a for submit@debbugs.gnu.org; Sun, 08 Jan 2023 03:49:34 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pERMy-0000p9-NL for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 03:49:33 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6197D60004; Sun, 8 Jan 2023 08:49:23 +0000 (UTC) From: Juri Linkov To: Theodor Thornhill Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <87o7ratva2.fsf@thornhill.no> (Theodor Thornhill's message of "Sat, 07 Jan 2023 12:54:13 +0100") Organization: LINKOV.NET References: <87o7ratva2.fsf@thornhill.no> Date: Sun, 08 Jan 2023 10:36:42 +0200 Message-ID: <86bkn9whgl.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, eliz@gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca 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.7 (-) > -(defun forward-sentence (&optional arg) > +(defvar forward-sentence-function > + (lambda (&optional arg) A good practice is to name such a function e.g. forward-sentence-default-function. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 04:20:55 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 09:20:55 +0000 Received: from localhost ([127.0.0.1]:59857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pERrK-0001gU-NE for submit@debbugs.gnu.org; Sun, 08 Jan 2023 04:20:54 -0500 Received: from out-221.mta0.migadu.com ([91.218.175.221]:32316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pERrI-0001gL-VR for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 04:20:53 -0500 Date: Sun, 08 Jan 2023 10:20:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1673169651; 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=OeRUxtZTkIB3N4iMFeTV0q2OaRoMvP2C5vcVO1Gdcdg=; b=cA0izfL6VvlRE+9JdXXvUyfEpdx2+Tq3iM3MhHahEksbeHS6fTA4/KAFbzP6TSgYHeCOKt D+jxPtRFkrJXQkESWnLKnrHF4jJx2hQv56ldupgQ9A9Ah/LESc2z9SToUe2KEG/Nf64Z8C 5qH3tNP/+IDL3ATxHTWC7fJ1AnpIudlJnb+jUT6s5hLWDBXTbBhSsVWxGg9J8uZ5cINz/2 NQUbSOdI6U9GuTxjInHiekHtSpCbvh5gg3HleN2QreGmbELrZJWPnY3mKSRyBI0vunkJxu Kza33qYA1oZLv6NjXwX7b+TbhsOsqiIMh89A94w3GUL7CTcN6FNNY+66QkXy/A== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill To: Juri Linkov Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <86bkn9whgl.fsf@mail.linkov.net> References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> Message-ID: 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-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, eliz@gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca 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 8 January 2023 09:36:42 CET, Juri Linkov wrote: >> -(defun forward-sentence (&optional arg) >> +(defvar forward-sentence-function >> + (lambda (&optional arg) > >A good practice is to name such a function e=2Eg=2E forward-sentence-defa= ult-function=2E Is this practice used anywhere else? Iirc forward-sexp-function doesn't fo= llow that practice=2E Thanks, Theo From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 08:29:23 2023 Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 13:29:23 +0000 Received: from localhost ([127.0.0.1]:60167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEVjn-0002hU-3B for submit@debbugs.gnu.org; Sun, 08 Jan 2023 08:29:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:45666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEVjh-0002h6-SN for submit@debbugs.gnu.org; Sun, 08 Jan 2023 08:29:21 -0500 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 1pEVjh-0007r1-86 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 08:29:17 -0500 Received: from out-39.mta0.migadu.com ([91.218.175.39]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEVje-00016K-MU for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 08:29:16 -0500 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=thornhill.no; s=key1; t=1673184551; 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: in-reply-to:in-reply-to:references:references; bh=Lp8ykaFXYWu8wZubiihEG3kFHW4R0zwR2rZQumYrvx4=; b=N/MpNEvbxy+ZgCjJ3BeopeQbUZwWmW4D56sVbuLSRE8DmADt1W20dcPhPgaFWdMbiVuGKJ b19futOCtREEITzXFcZ/iDSZz2AJpvlWa4oKeDvT5hZk7RVElvEWrXlgECa5lhd5fuh3ds r2XsKubCTHl41rivWjO2rarJkPvT0mFZU1iXpq/ExcR3cbPEGms80EpkRVVBLQaI2yIFE7 aJH4ZXw9D7d9ryVG05qOUkZ5+E2MBCOkZvCabfyI+nBXIqlnaExcqkCnlbL+CZmBbl6A/8 cS0W6cTDRlyl8yTph9e1Z/YGW7mlO5de5z3mHTdmscZYXa6eIuLkrSzkmk74Ow== From: Theodor Thornhill To: Daniel =?utf-8?Q?Mart=C3=ADn?= , "Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: References: <87o7ratva2.fsf@thornhill.no> Date: Sun, 08 Jan 2023 14:29:08 +0100 Message-ID: <87bkn9tasb.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.39; envelope-from=theo@thornhill.no; helo=out-39.mta0.migadu.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: 60623@debbugs.gnu.org, Juri Linkov , eliz@gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca 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: -2.4 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Daniel Mart=C3=ADn writes: > Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife > of text editors" writes: > >> Hi all! >> >> This patch tweaks the forward-sentence function to be usable with >> tree-sitter. >> >> It follows the same style as the recent change in transpose-sexps, so I >> hope it isn't too controversial. > > Thanks. > >> >> What exact node types do you consider useful for sentence movement? >> > > I haven't thought much about your proposed nodes, I initially thought > that sentences in a programming language are just "statements". They aren't really proper propsals. Mostly some example values to show that the code works. The problem with just stating "statements" is that the names are different across parsers. So in java one would call ``` void foo() { var foo =3D 5; // <-- This thing } ``` A "local_variable_declaration" or something like that. But it would make sense for M-e to move across that whole line. So this is language dependent, I believe. > > As a suggestion, treesit-forward-sentence could navigate by textual > sentences when point is inside comments or strings. > Yeah, this is a good idea - added in following patch. >> +** New defvar-local forward-sentence-function. >> +The previous implementation of 'forward-sentence' is moved into this >> +variable, which can be set to customize the sentece movement behavior. > ^^^^^^^ > sentence > Thanks - fixed. > Also, this feature probably needs an update to the Info documentation to > mention that Tree-sitter can specialize sentence commands in programming > modes. Yes, likely. I will add this a bit later, when we agree on its behavior fully :) @Eli, what doc changes do you see as needed here? @Juri: I added a change with how I understood what you meant. Is that in your line of reasoning? Theo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-forward-sentence-with-tree-sitter-support-bug-60.patch >From 62d6f162ba7646783675dc87199ca31691164bf4 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sat, 7 Jan 2023 12:44:14 +0100 Subject: [PATCH] Add forward-sentence with tree sitter support (bug#60623) * etc/NEWS: Mention the new changes. * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Set the variable. * lisp/progmodes/java-ts-mode.el (java-ts-mode): Set the variable. * lisp/textmodes/paragraphs.el (forward-sentence-default-function): Move old implementation to its own function. (forward-sentence-function): New defvar defaulting to old behavior. (forward-sentence): Use the variable in this function unconditionally. * lisp/treesit.el (treesit-sentence-type-regexp): New defvar. (treesit-forward-sentence): New defun. (treesit-major-mode-setup): Conditionally set forward-sentence-function. --- etc/NEWS | 13 +++++++++++++ lisp/progmodes/c-ts-mode.el | 8 ++++++++ lisp/progmodes/java-ts-mode.el | 6 ++++++ lisp/textmodes/paragraphs.el | 16 +++++++++++++--- lisp/treesit.el | 28 ++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 690e9c3faa9..98f5d71cc90 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -57,6 +57,19 @@ treesit.el now unconditionally sets 'transpose-sexps-function' for all Tree-sitter modes. This functionality utilizes the new 'transpose-sexps-function'. +** New defvar-local forward-sentence-function. +The previous implementation of 'forward-sentence' is moved into this +variable, which can be set to customize the sentence movement +behavior. + +** New defvar-local 'treesit-sentence-type-regexp. +Similarly to 'treesit-defun-type-regexp', this variable is used to +navigate sentences in Tree-sitter enabled modes. + +** New function 'treesit-forward-sentence'. +treesit.el now conditionally sets 'forward-sentence-function' for all +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. + * Changes in Specialized Modes and Packages in Emacs 30.1 --- diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index a22f1f3c44f..dec866f762f 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -736,6 +736,14 @@ c-ts-base-mode :syntax-table c-ts-mode--syntax-table ;; Navigation. + (setq-local treesit-sentence-type-regexp + (regexp-opt '("statement" + "expression" + "definition" + "specifier" + "declaration" + "comment" + "preproc"))) (setq-local treesit-defun-type-regexp (cons (regexp-opt '("function_definition" "type_definition" diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 87a4e2b90f8..0e3381e219a 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -296,6 +296,12 @@ java-ts-mode (append "{}():;," electric-indent-chars)) ;; Navigation. + (setq-local treesit-sentence-type-regexp + (regexp-opt '("statement" + "expression" + "parameters" + "list" + "comment"))) (setq-local treesit-defun-type-regexp (regexp-opt '("method_declaration" "class_declaration" diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 73abb155aaa..4580be3450d 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -441,14 +441,12 @@ end-of-paragraph-text (if (< (point) (point-max)) (end-of-paragraph-text)))))) -(defun forward-sentence (&optional arg) +(defun forward-sentence-default-function (&optional arg) "Move forward to next end of sentence. With argument, repeat. When ARG is negative, move backward repeatedly to start of sentence. The variable `sentence-end' is a regular expression that matches ends of sentences. Also, every paragraph boundary terminates sentences as well." - (interactive "^p") - (or arg (setq arg 1)) (let ((opoint (point)) (sentence-end (sentence-end))) (while (< arg 0) @@ -480,6 +478,18 @@ forward-sentence (let ((npoint (constrain-to-field nil opoint t))) (not (= npoint opoint))))) +(defvar forward-sentence-function #'forward-sentence-default-function + "Function to be used to calculate sentence movements. +See `forward-sentence-default-function' for behavior description.") + +(defun forward-sentence (&optional arg) + "Move forward to next end of sentence. With argument, repeat. +When ARG is negative, move backward repeatedly to start of sentence. +Delegates its work to `forward-sentence-function'." + (interactive "^p") + (or arg (setq arg 1)) + (funcall forward-sentence-function arg)) + (defun count-sentences (start end) "Count sentences in current buffer from START to END." (let ((sentences 0) diff --git a/lisp/treesit.el b/lisp/treesit.el index a7f453a8899..0681e758b37 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1783,6 +1783,32 @@ treesit-end-of-defun (when treesit-defun-skipper (funcall treesit-defun-skipper)))) +(defvar-local treesit-sentence-type-regexp "" + "A regexp that matches the node type of sentence nodes. + +A sentence node is a node that is bigger than a sexp, and +delimits larger statements in the source code. It is, however, +smaller in scope than defuns. This is used by +`treesit-forward-sentence' and friends.") + +(defun treesit-forward-sentence (&optional arg) + "Tree-sitter `forward-sentence-function' function. + +ARG is the same as in `forward-sentence-function'. + +If inside comment or other nodes described in +`treesit-sentence-type-regexp', use +`forward-sentence-default-function', else move across nodes as +described by `treesit-sentence-type-regexp'." + + (if (string-match-p + treesit-text-type-regexp + (treesit-node-type (treesit-node-at (point)))) + (funcall #'forward-sentence-default-function arg) + (funcall + (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) + treesit-sentence-type-regexp (abs arg)))) + (defvar-local treesit-text-type-regexp "\\`comment\\'" "A regexp that matches the node type of textual nodes. @@ -2256,6 +2282,8 @@ treesit-major-mode-setup #'treesit-add-log-current-defun)) (setq-local transpose-sexps-function #'treesit-transpose-sexps) + (when treesit-sentence-type-regexp + (setq-local forward-sentence-function #'treesit-forward-sentence)) ;; Imenu. (when treesit-simple-imenu-settings -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 09:53:34 2023 Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 14:53:34 +0000 Received: from localhost ([127.0.0.1]:60261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEX3G-00079q-6N for submit@debbugs.gnu.org; Sun, 08 Jan 2023 09:53:34 -0500 Received: from lists.gnu.org ([209.51.188.17]:40080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEX3B-00079e-Ib for submit@debbugs.gnu.org; Sun, 08 Jan 2023 09:53:32 -0500 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 1pEX3B-0000FC-9p for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 09:53:29 -0500 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 1pEX38-0004j9-IY; Sun, 08 Jan 2023 09:53:26 -0500 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=uE+Jbj0/MeZrS0cGsc7+AYBuSe3LsWLIWcVSwKbDOeE=; b=g3xUhX707CPT pvt0oE+nc+hP/L6AzCnJWJTafOX9KuGa2M7E51GgJmb2l0TS73BPBc4slDxMNUkPQbyW3ai0VTiDY J3ECNcyHrFNbuSLwbW+oJnPWzwFW4dKeqFGp4kJAgcLAgUJ0CvmPmAgk02RU4CA9zZKegXlVyr70r mLp+BUOvC5+tpeuCCWCgRJsKsV71NLsf1ZH++l7ZWG62pfKezKEF9HblEWpCO2sCPqkccp1BYn1te jCn1PmpSY/PfF6S0Z3HHdkfdxnjtIG7IJ7oGNVpP0gkYEbF3L7ibCBgnlY6kYrdN8UDApOAd6O9M0 0dcPj/zfGIF4faXnz0A/HA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEX38-0005tg-3N; Sun, 08 Jan 2023 09:53:26 -0500 Date: Sun, 08 Jan 2023 16:53:47 +0200 Message-Id: <83sfgloz5w.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <87bkn9tasb.fsf@thornhill.no> (message from Theodor Thornhill on Sun, 08 Jan 2023 14:29:08 +0100) Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: casouri@gmail.com, bug-gnu-emacs@gnu.org, 60623@debbugs.gnu.org, juri@linkov.net, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (---) > From: Theodor Thornhill > Cc: 60623@debbugs.gnu.org, casouri@gmail.com, eliz@gnu.org, > monnier@iro.umontreal.ca,Juri Linkov > Date: Sun, 08 Jan 2023 14:29:08 +0100 > > @Eli, what doc changes do you see as needed here? More or less. They need some polishing, like a few words about what does "sentence" mean in the tree-sitter context. But we can make these changes after this is in the repository. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 11:41:14 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 16:41:14 +0000 Received: from localhost ([127.0.0.1]:34492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEYjS-0000iN-2l for submit@debbugs.gnu.org; Sun, 08 Jan 2023 11:41:14 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:29140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEYjN-0000iC-Nu for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 11:41:12 -0500 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 308GG9D5003450; Sun, 8 Jan 2023 16:41:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=VsvrNgfJ6CndQzXu6t0/VD8DpI5fiwgl6y9bgmiRdTw=; b=cyv8uNDRmuWaHd7AOK3lIBciRQYQwGeO5Fy0qehmcdOeAYLR1L+mgOzOuC225itq/urG YIPvSQU8Ezx3f2EFpNORRTf7ICBEh4XdPvhnRMDpvseeSi4COV9QZq0mZRXe9Nxr6Npo wO258Iza9jYHKBUvmV7Qj0WyRcB7Rb6VEUfS81uN91/MgrD6UWmLipeva+P9Y7NYXfUU Z3/PTgpFOWgsyowCJLAhmwBdaN+YIztwpM12HRTU9cQRvXHJwjoU0FiY8Y7xdpPXfJ1v 4XqHnicG+HuoaY2O7PyIo3BPv2xWEfqjiCPAhnwvXBksHhReyP7drzElzOYFyfFzkMhH jQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0sc9d2w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 08 Jan 2023 16:41:08 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 308Bnb7h038506; Sun, 8 Jan 2023 16:41:08 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mxy69dctu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 08 Jan 2023 16:41:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E0wPT1E0TeZp2GQBBg5fEJ8XZ9OSNWqlDzg/Yonf3xcSFK8MSTVj2uTSltEZhD9Tcm4jlHghx9E89kPg5gMa4EB2dhzk9sZ/g6hlmT8NQTeKI+W/qARjYXEUPpcxL86gNGSlQXA8EadtQwS5ljfZHbef3zdzpKigSbsDgf2PWEqiYi/K8x3WZ6UnSOmQAEHkk4Gfo7cQMtLJq+JMG6DPxlofkvr2t4s2eC3teZiMP9Z6+Ff6yl98aDOiJiswnXAVcjJuj/FoR82swTzSt1gqfWrWSLK1/fhdSWRa6x6hAucdEM3zbx9Dfe1+v2UveI6X8iGjtbSxdsrBoU16Buievg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VsvrNgfJ6CndQzXu6t0/VD8DpI5fiwgl6y9bgmiRdTw=; b=CGUY9oFh+8OBr/rWBwQN6cMagQUA/0NBbg7lZ5OAwGDDRvNK0J9stEFaOWQEiTGVCqFjlzdAerIv16f56O0TYimHnwRvBGR+H9HtMsWEBRZJFKWCBvGoh4J+BWDD3d1uTCK+qagBk32NOwq6F5uM4GcAMqlVW4/4yt5QCS2X96rXSxRWN4NTqnS2udpDNZNwdNbSqHI7FxNCzaLElTxRbIiARsBSWaxMi7KkQI2eZE/Bj87DxiXcOVVcAUqhDVVEJ8RACYDwnArqHpehiRvUF7izkpe/FJbAOPsEsEAz0DeTPW9WQzt/g3Ly3BiJIJUm/x2n0BEf8zYzQdPiMV3cfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VsvrNgfJ6CndQzXu6t0/VD8DpI5fiwgl6y9bgmiRdTw=; b=VkJJ0nT/AMQA2d7tGM04t463UvmvyI1NMZd/6k+zDCr8gmsWeRIVZZF/JNdbG8kplK+W85JJCe5Gx9821IwBzFmJmHUQrThMpkehsMmxX9xdepgUo/aPUT4+/LLiH/F3f2H6MVdUarZbsm8tEQcGMtFzi+JbQMqrXVfbPmO+7VY= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH0PR10MB7061.namprd10.prod.outlook.com (2603:10b6:510:284::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Sun, 8 Jan 2023 16:41:05 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29%7]) with mapi id 15.20.6002.010; Sun, 8 Jan 2023 16:41:05 +0000 From: Drew Adams To: Theodor Thornhill , Juri Linkov Subject: RE: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Topic: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Index: AQHZI0KXyIkDyq26VUGg03Od9Hlnca6UuIHg Date: Sun, 8 Jan 2023 16:41:05 +0000 Message-ID: References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH0PR10MB7061:EE_ x-ms-office365-filtering-correlation-id: 989f84a4-fde4-4304-0371-08daf1972312 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XELpyqU/qxPnt/a+AX9hqL/rnrsAAy/j6+j876Z+srOgAUzefdhlcUAWLCEwnUEDqMEtFt6qC1gv5hlurJc6mBSdkWyxVJcJV0sCOH0d4eq7PgChIvm8jKxl6rlXWJTc6wVm1XzH3aJlMATU0loX8UQbiFUdj6W30algW4oOfIhOjSChNV//nrT5+fmwachWHeINzUzFUSJm/Kcl8faWiGpilOdQh5r8Unxb36tRqB2TEjj8e6lwYKdOX5v8nUnC3N0yzRxMFgmKL5rPc5FWJjJhP2g4APjBCkbRJuE4xnW/7qw8MtknizEhdTQWrhCtD6kbjaKf9rwt2vM1a8WfD2kFg+ZtKUePMKr3QfPB7AUCZZZRH1xMYV8enOuntrwO0dwF1JsrIGrppsVTk4AW7O+JdTtD3rRwdRH7wUC3M9TgSglvEs9NjGR7l+BPw8wY27abM4d4UBAkVO4s7U/npHKVDsrQZFoO814UndoJl3HvqFyoCt8pn2ne5F6SZI+XDcYITnK+aYvWmmmBJ9P4BsZjM5wZ6LZTu6qGsxP+h7FJvsSPnR7rY7/UNWCYSG2Ubqm+pIbNmt6QsTgKbnSmrHW2d8QJsfTik1YXkthzXeMuFQQS54CihTcpSkM0B7J4f5+lWHe4aCMIvFoaM5FmpRHg2nIci0IMVus2kThSsaNRDQJRXKNp2iJctwd3/StjGDC0buS5awUyjqAmrP/AsQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39860400002)(346002)(136003)(366004)(396003)(376002)(451199015)(6506007)(478600001)(71200400001)(86362001)(55016003)(38070700005)(38100700002)(122000001)(26005)(33656002)(7696005)(110136005)(9686003)(186003)(44832011)(76116006)(5660300002)(52536014)(4326008)(66446008)(66556008)(8676002)(66476007)(4744005)(8936002)(66946007)(316002)(64756008)(2906002)(41300700001)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?NFE4dzJPRDhNVGJqUmdzVDNFSFY1enJiQVQwSFhwZWc5eE5hNmoyaDNLQTdJ?= =?utf-8?B?L2FNa0hDcUpKeUtOMTdEamthRFRIR0txSnVTL25RaUtDczIycEpDV09JMThV?= =?utf-8?B?THpVZjN1MTIvdmwrZmNSQmJUa1V0b283NlN0N1QvbHkwVGVFdFdDdDhCaWNR?= =?utf-8?B?RHlESjlnYk0vdWRSenRMN25aMThzQWRNS0QyaUo2ZVNnU0lFOXZsM2VLYkZS?= =?utf-8?B?U3g1Nk5XT3JUV3RvcmtzTW9xWGF4cDVyOGFwNVNSRUxqL2hLdmRFMXpCSzJL?= =?utf-8?B?b3ArejFpUStVSXV4TWZXbEc1UVMvY1Jpb1JsWFU4RENrbXIybDNyU3ZFU3Ax?= =?utf-8?B?UGNuTlZzdkk5MjNYS0pTdUJKMUhDdjFraWxEeHIwVzZtVnUyTU9laTNrU2p5?= =?utf-8?B?bzE0WEt0dFVITkI0cnplTGN2dXRuSW8yZjBqUXFRdXM1RzBrZi9RMFQwZmk2?= =?utf-8?B?bHNtazd3OGxzRXE3bXJWTER6UVFBcnpqaE44ZFVEeDRjc1YzcUhpc25JZWpR?= =?utf-8?B?Sm1UcmxoS1MvLzZoc0p4RW90cFlxYjR6Z2g5SkZWcGRVS2MwaHh2ZStPMWFR?= =?utf-8?B?bWtodGFiOUJBZXN0VnVVNndUZHpCOGcxeUVZYWZLcXdDa0JKNXJPZHJRVTBQ?= =?utf-8?B?OHgwUlVTVzZDSzlFYTlEMHFMdnBrMitaU05GY0Z2R2QwYS8yTzRVUEZNNWRh?= =?utf-8?B?eVVTRFg3NnhHR1VCa3pTbEFXZXhOa3J3dWptWG1vYzBIRXdVTmVkUW5veGZ3?= =?utf-8?B?M25nTVNQLzgwWU1vWkNLRVpHdEF3SXMwWHRyK3prYkFYSFZqSmZyb1oySWdi?= =?utf-8?B?cVNrN04zbU5KZW1ZQlYzSTUxNXlaRlRURysvNVhhRS9QNXp0ME5PbGFlaVpF?= =?utf-8?B?emhWYmNOR3lNS3hNU1VmYWVkbnRVRTZJZmhhUHd1L1VES3B6Sjg4ZkJZVVE0?= =?utf-8?B?b0dmMEdMaU9LT09rTGlWYTZaUUtuOGNWcEdkYlEzSmRLTmpqaGhkQ1I1ZlFF?= =?utf-8?B?YUp4ZVpGQUVvY3RDN2Vjb2tPWXNBVUVYTmlUdUlCWFhaMEsreFcwOTdHTG1h?= =?utf-8?B?ZnFpRUh0RklKMUltcVdNYTZFSWpTNEF1aVIwd05ZTmdCS3NtMkg5Skw4Sy9J?= =?utf-8?B?M3NadGVSQTBHY3NNRVErMFdGM1M5SFI1d3h5NTVkMDJqeWdURGthT1ZyaUJz?= =?utf-8?B?L1dnWk1ReW10RGhEU1J4VForbjBrTnU4VnBieHErZkdLZ0ZobWpSVDVoZkF2?= =?utf-8?B?K3FFTmhqK2hiNm5SaExHZHNORFFFT2F4TDVPeXNxajk1MzV3S2UyNk96MlVv?= =?utf-8?B?Qys5Y2JQN3djakJYWkZ0WVQxNnBHTTdEMEYyZDhQVXlta08zKzFqVTN6NllH?= =?utf-8?B?UGprSGt3N1dRdjNWQmZlZGN6WkhiMzBjRDR2U3NTMElHc3FPMGZyVm5JYXIr?= =?utf-8?B?Q0ZGdHlpWFhIeit0VmhWMCtwZjRISjlFZGU4YUpmb2wvNFJWRGxnWXZrRnZQ?= =?utf-8?B?YTBKZ1ZCRWpqOSt6d1p1U2F2bHlBQ0tUbDFkTE1DaVFVMXR2NlFHNThaS0d1?= =?utf-8?B?SlMrcnJyTEZqNWFmM1Y1cGJDbE1SczQvMHZuQkNaVzNOOXFiTWRVWjBCMTdn?= =?utf-8?B?WENUQkN2b1VpWlJ6Z21FcEZwQnVzdnMyUEJ3ZWVOeFVXSThyUDNvb2hNaUNy?= =?utf-8?B?T1lUQjFtalBNa29XUzkydE1JMEhreE5WR1dIK0V5Qzl5MmNVUWdvZVdXQlNV?= =?utf-8?B?aTRFZkc0R0RkTC9PRC9wQUY4VmllYVRTTlZUS0NiUTJDcDVENVNHNUN0eTVJ?= =?utf-8?B?U1pPZkwycTRGd1BhUUZDaWNmY0h6U0laRG9udW1adXFyeHpla2MxNUJFY1FM?= =?utf-8?B?dlJhTzhQYjk5WlptN2F3c0t0emE1ODdLTDNWN2tLeEk5eXI5QVY5akZyU1U4?= =?utf-8?B?VlNROUowbmdkUGhIMzIwWkFjU1daVVRoOTZCQ0JuYTJDNlA3ZVJSQU15M0xT?= =?utf-8?B?T2NncWFTUElZaHFXS3V0bHlSYW9kTm16REFuaTJHQThFcWc1bHZrK3VIcG9v?= =?utf-8?B?dnNXYzkrVW9nMXVWcURzM2R0d28zVmhkdFdhRnRndVdha2NodVV2cHREMHBr?= =?utf-8?Q?VP79aQV4OEX7BrKoMbppLkFxr?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WvhnA8k8liftzsvHd2tfpS+xEm32zSiD5sLkDbBF4RpDItQ+KSFdD3uUbiu4/o8yujjTHErEuVvQwfwpO3tb0ICPcnTCaaDTfm2Y/aw8ks6cPDC5VqVCU8jjEWuGLJquxSNyOO06/N0CupXROA1rpEH9I/Vg7s6ehIkzZ4naTQ6K16nbz/suyxkw/YSEYqKED5j/fol8EXHUX9IDQXbjIcLBmB/M+gY5uo/fShCBIN1iR4+ppQvY4KTq0VUFmpuCsUMP50Dv21g0VgJUJJEVKeqM3dhcDs9UNIr10ytTiVQqL0wl5LV6J/COt9QIyre+IzI/uLPab7gSVa8jPmM8C9Wgk5K9g3XLKui7d8+kgierNfFjED1VztI5jVpVW1+8YN7sbgdidfSQ78usJLfDm8t0Hi0xzCP0lX+M7ffWhY1AVpaaujzIT4BnZmEa1PfnSAmMUt5LjKJEnFOjRI8OKIFfeEC1n3aYoy3JHJ+sm16fNgxKpKBTO8P6LwSPIYU7e8tS8c33Mm6OKWw/PUffvdnQSC+CbibHnK7e96fyU3/H5x0DHqumgcppMChR1n99uCN3vJzt457i/mcMc14KINvTdr1y1MA+9rX7Nq/HBt8S7iwyMhh9V38U1VAcFbV30cLFDeIsDf8UppBPFjtGGsLtyh9MbKi31enfBLy+dZQsnxsVD1e/QA0jdRcvcQISQraZ3Mk4yXAtZrH1TTG30eGrZoGq1bMM6QMZIECE2RQggV9jo2PDFx42qYC0c5lvYdBApwnnknkrG3b1L9g0d9ij4fILYMvjkitzKMv/Li5KLeClRX32cfaDx6V96WVHbMPRsnKPLCEPK0s5xB5Ohy1TfELkfBZRPK0cwU9PPyKMzpcbhWhaP5CZtMVMmLYYsXnpetIjyVBikHVO+QGXVVQRtGTPLEEjM/x+qhNuldc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 989f84a4-fde4-4304-0371-08daf1972312 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2023 16:41:05.6929 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2n2nAjYnS0wA7DMupJvWatqnHmQzrNfA6k1ASzUbNR7jxHLXt2hanNl2wWJLxJ2+/0+AqCTqa+Zg/CpJSVqhCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7061 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-08_12,2023-01-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=742 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301080124 X-Proofpoint-GUID: t6Q123V5BIPuh3Q1UMXjFEfjbeLHeoG6 X-Proofpoint-ORIG-GUID: t6Q123V5BIPuh3Q1UMXjFEfjbeLHeoG6 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , "monnier@iro.umontreal.ca" 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.7 (-) PiA+QSBnb29kIHByYWN0aWNlIGlzIHRvIG5hbWUgc3VjaCBhIGZ1bmN0aW9uDQo+ID5lLmcuIGZv cndhcmQtc2VudGVuY2UtZGVmYXVsdC1mdW5jdGlvbi4NCj4gDQo+IElzIHRoaXMgcHJhY3RpY2Ug dXNlZCBhbnl3aGVyZSBlbHNlPyBJaXJjDQo+IGZvcndhcmQtc2V4cC1mdW5jdGlvbiBkb2Vzbid0 IGZvbGxvdyB0aGF0DQo+IHByYWN0aWNlLg0KDQpFeGFjdGx5LiAgSU1PLCBpZiB0aGUgdmFyaWFi bGUgY2FuIGhhdmUgYQ0Kbm9uZnVuY3Rpb24gdmFsdWUsIGVzcGVjaWFsbHkgbmlsLCB0aGVuDQp0 aGVyZSdzIG5vIG5lZWQgKG5vdGhpbmcgZ2FpbmVkLCBhbmQgZXZlbg0KcG9zc2libGUgY29uZnVz aW9uL21pc3VuZGVyc3RhbmRpbmcgYWRkZWQpDQpieSBhZGRpbmcgIi1kZWZhdWx0LSIgdG8gdGhl IG5hbWUuDQoNCk9uIHRoZSBvdGhlciBoYW5kLCBpZiB0aGUgdmFsdWUgbXVzdCBhbHdheXMNCmJl IGEgZnVuY3Rpb24sIHRoZW4gaGF2aW5nICItZGVmYXVsdC0iIGluDQp0aGUgbmFtZSBtYWtlcyBz ZW5zZS4NCg0KRm9sbG93aW5nIHRoaXMgZ3VpZGVsaW5lIGhlbHBzIHVzZXJzIGtub3cNCihndWVz cykgd2hhdCB0aGUgdmFyaWFibGUncyB2YWx1ZSBjYW4gYmUNCmV2ZW4gd2l0aG91dCBjb25zdWx0 aW5nIGl0cyBkb2MuDQo= From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 12:04:23 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 17:04:23 +0000 Received: from localhost ([127.0.0.1]:34522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZ5r-0001OH-4V for submit@debbugs.gnu.org; Sun, 08 Jan 2023 12:04:23 -0500 Received: from out2.migadu.com ([188.165.223.204]:20471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZ5l-0001O5-HR for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 12:04:22 -0500 Date: Sun, 08 Jan 2023 18:04:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1673197456; 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=+n2L1QzA00TjrLrv4SNWs215H5I7euGoJoqatjs1nSQ=; b=HqIby9u9kfaWaPr1+Jkbj3VLzLmp5A45REz8C+3HtDjPI/r3n2rPyBu5YrojnCnOQOObI1 GYYxPF6vSKwm339OqOsBahhtq1RsOGdBROLGExVXk3xlfQs/r/YNw7Hj/DPfXSOKlgLFOh qVDqbdTmJpwvWntgqDz/mN3eta0SKDdSu+9Uwqj97d/EwyTOLAIh4nWYQqgze8sw2xNxcW np1PD1tXs8B512C63Z57ETRv4tq91ooGzSam4Is4It7Rg24fyCuyQwf++mdupX5GpQ7uNY PbfByepvfEvI5fjQH88iRbPGy/xcA4KN+IKGVdGeBNEbOAXam70WKSwZ5goPcA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill To: Drew Adams , Juri Linkov Subject: =?US-ASCII?Q?RE=3A_=5BExternal=5D_=3A_bug=2360623=3A_30=2E0=2E50=3B_Add_?= =?US-ASCII?Q?forward-sentence_with_tree_sitter_support?= In-Reply-To: References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> Message-ID: 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-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , "monnier@iro.umontreal.ca" 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 8 January 2023 17:41:05 CET, Drew Adams wro= te: >> >A good practice is to name such a function >> >e=2Eg=2E forward-sentence-default-function=2E >>=20 >> Is this practice used anywhere else? Iirc >> forward-sexp-function doesn't follow that >> practice=2E > >Exactly=2E IMO, if the variable can have a >nonfunction value, especially nil, then >there's no need (nothing gained, and even >possible confusion/misunderstanding added) >by adding "-default-" to the name=2E > >On the other hand, if the value must always >be a function, then having "-default-" in >the name makes sense=2E > >Following this guideline helps users know >(guess) what the variable's value can be >even without consulting its doc=2E So is this to be considered an improvement to forward-sexp too, then? From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 12:42:22 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 17:42:22 +0000 Received: from localhost ([127.0.0.1]:34543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZgc-0006un-7i for submit@debbugs.gnu.org; Sun, 08 Jan 2023 12:42:22 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:12666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZgX-0006uc-7p for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 12:42:20 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 308HFavX005979; Sun, 8 Jan 2023 17:42:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=W+XWvJWw6wUwOzSKDr7rui0ly9k9WSPuzfDwbcNwY9E=; b=hkvlDOcXpeG7BWuEmCTry64U6q4Mi3tUPEXDRRpsDsQFCaKniBJG6pAN3bt8jT7EmlCR vqLNPIXaJM36pwsZk/NiaM9zvYzKbAt+OF1pq72cpHdku6Uu6DPCGRU/jr1bDfz2mtUL 1oSU7gJWs8fMbKSdPVg5RVELW3L/MCO9uEz83nusEX9KKfGakNGgiS5FLuuvXqWAhTfZ HbfNomKn0zR+S/RYagKdUC5HQuBNAE9+A4kzPO71W5FYwPhmSGaqoAX/Wd3bSe7FPA+C 3a+/9XTccPAmIWGnIOI0jvQKAofdqEPeXeWuoVHs9UQ6vfjrcVGpECIEcYC7VGQo5YrI Mg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mydxm8una-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 08 Jan 2023 17:42:16 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 308HYZQp038495; Sun, 8 Jan 2023 17:42:14 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mxy69e8rh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 08 Jan 2023 17:42:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nWxn2clFLOwAr6BwoRlU6Kh5ix9sqQusoXPkahNc0zw7qif4cXQQ6SG/nL+N5m3hGtK7Llcley2gttUBAo/hbxK4tbDsdG4zX2Mqs+vTzBstbqin6s1qdZ58yQyZ0GroJTzSilY0aPXtExVIPu3zMTmtHmRql1WmIYdi0Ylnhl/EY4YUMCb/cFtrns+7+Op0h3ajm+tA14VO2tpOAjgtsQ4jhNf8XhjhjjTFnbS/e/+g7fnPvvZUFBKId56VKeP+vCIL8byKT/sJZBXITzUKqd2/9NIm8khrYvScbcOTsp69jz5kiJxhZD2QIH6Kb97ZeKpjJBItjiLGJpwTUKIF9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W+XWvJWw6wUwOzSKDr7rui0ly9k9WSPuzfDwbcNwY9E=; b=QhE2udRl5POIO1eOyj/ffHZPWGLai+eoz66zTrNeUt2yCu5m38jlfnRg/7r+oG9yr05vOLbnkY/kHtPZGY/BfMyi1K0n9B5iodNQWmgFhQF8oSyIVLOBrsWoJZqcSaPOjaIOlpwzfvWazJhDcep82NrFYgNb0lr/yOYAWt5G6v5vOsCJI/7wH6AZhwUnSA07gSzdE/c4fMe3nrDLavVblMrIapQkIzBSEeoWEGjWJClH4bvzZnKErdzHY4COqjtMrr21vWmj2WZ178bgM7AjUw5TPK4rj8qhEIgJLBywypuvlY3h9b4U5jtKgzdHN2eMEmt/s6slFuBj24DYFLoBbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W+XWvJWw6wUwOzSKDr7rui0ly9k9WSPuzfDwbcNwY9E=; b=YOuWoEpCD7iwNWEl3KEwL6xdDg3AL5Zm7ffupmehTEWfq8Dh+PpXrTb1MvET/cydRoEDVQcuSpRAzovrgNzlUNsDGKatR3j76ZpsM5v4sC19pLk/jaODYn4tCPE8eB/Y7BCrqCUAFTbb34ecDifMS5bJiQ96xd06jq5JW93Vwh0= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BL3PR10MB6234.namprd10.prod.outlook.com (2603:10b6:208:38d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.9; Sun, 8 Jan 2023 17:42:07 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29%7]) with mapi id 15.20.6002.010; Sun, 8 Jan 2023 17:42:07 +0000 From: Drew Adams To: Theodor Thornhill , Juri Linkov Subject: RE: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Topic: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Index: AQHZI4NJlucEz78ByEOPL3SWbIWAkq6UyasQ Date: Sun, 8 Jan 2023 17:42:07 +0000 Message-ID: References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|BL3PR10MB6234:EE_ x-ms-office365-filtering-correlation-id: dfc8de8e-6c28-4c94-eee5-08daf19fa9ab x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yUg/E4iIWtMGrafbHuY2ZcW4L/GNtLttz22pzLdov8LQ7P/ymbQQP8vbb/Rn/4WPrXZQdLIBWM2+yZowHkVM8BK5/2sZVOOm9dGsT8hSGH/KsDDEHSr35nBNNlaLpNkzJNYHXTKfFb4NC0x3yawdu03hSSx/sysam6dFDx/et05hM832GmE2iNUjuk14df29B6S3F2s+9fLpnrZ9MHwyvfNORr8JLrolxbicadWre8DiVwGBBc24lT2xC8Q+BML3hO2aePnCGY0QGdjaAQ4k7L/L02nC5F94h7SjIcSFsW+lKJ7RRkW58T5e7s9zeEPHoAV80pd9FTOZgOUDFHQ/nEPIp+TZ6hQCmGvfB7gUK8+0NrRBxHBLixK6/8XGgt3JDp47TgCpdz6HrAYLZ5QsDeIK5rHEZ0pOXVHnXLboIC1ad9Yarp3HpOVhu6yMgmnp8x+0twMBH1XS0Oed2Fz21FZVYq9DFAy8+qJ6xUtGxlZY5wXJ3J507Jo1WhJ+Cz60YBuAu95VoT0qVpFG/g/mLLC5VCuEqmevn19KzKO2aJIewcY/qFL/xRHHMYv7tvGm7gDR+/NRa0PXMyhUJY4IKiHpYE/WVUtT5tsdeHRJzuKRed+pe8wlZeq+Ko1bfO/n0FIv8AyBKvfVa/VuR6YHJlWG7H2+Mf+60//S29yyqGg7L/3c7ycAv4jkz4518KxhQvGI/SF5zDjKrgtKkpYzQQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(346002)(366004)(136003)(39860400002)(376002)(451199015)(8936002)(2906002)(5660300002)(52536014)(41300700001)(71200400001)(7696005)(66446008)(4326008)(66556008)(64756008)(66476007)(8676002)(76116006)(316002)(66946007)(38070700005)(44832011)(54906003)(110136005)(9686003)(186003)(26005)(55016003)(122000001)(38100700002)(86362001)(478600001)(6506007)(33656002)(558084003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?N0pzMGQrRWVjdFpwOTVmMEcwRmFaU254UWJZRVZSVUpKMUZKYVRubXI0RDJj?= =?utf-8?B?THhkUHZYd0lkSUlsVFJKdm1TbC9wc1JzbmdTcUV0UG42cGprRVdVN1FVSVdt?= =?utf-8?B?RGpETjVINExnb0VHZXpKeWhoYzZYVW10U0NkMDljc0JlMHpJNmloV2Z3RHdQ?= =?utf-8?B?elpaNVc5NUVIdUpNR2tqWjJtT1hJU3lSSlY4YXg5OEw1Z2RaODhnS1NqYlZx?= =?utf-8?B?ZFI2eEo2MXE3N2dQZWN2WWY1VEJhSE1tVDZVZkpRY05GV212UzB6dG91TzNL?= =?utf-8?B?K1d4U082Y1Q1S3BrM1ZFeHpmcGh5L2dXaENEZTlBcTNpRmxCSGxKT244TUh0?= =?utf-8?B?YVpPR3FoaTBVb0puMXNiRlZCQTRja3BGaVNka2xPNFJ0Slc4dmYrQmpHcEcy?= =?utf-8?B?ZHgrek1JUkhvT3B5M3B5VGxSVTc2TjBrcDRvZnlQbE1IZkNFL2dQZGJuQnZE?= =?utf-8?B?eFE0VWtPaTlCWC9SNE9YbDZERzh5YWpNZ3RLS0FqRmtENFIyellIRGkvenlz?= =?utf-8?B?emw0UklaYnJwU1F3a2lCbnduSURYVUhycFBEWTB3VHZpbGEwUzhJdVdtbzFh?= =?utf-8?B?M1h0dXF3SzIrN3hFRjFHajhBVFA1THVaUWpFTEhHWEwzTHV3emVaZW5vOWhy?= =?utf-8?B?cE44ZWVLejJuMjduekRCSHRLK25nVHp4RVFjMktTaGdJcE9SWnVRcHpWUHd4?= =?utf-8?B?UW9wc21zblpEdGJxYzM0dC81QmNEV2EzSjVQVXBwR2hWWW05ZmlkdHdkaTM4?= =?utf-8?B?M2hqaExLMDJna2lOSldNeGx3NW52bktmbUtranRyZThkZXhZcWNyU3hQam9y?= =?utf-8?B?eFhyQlBYSks5dEVyN2FSVGtvdmlTWDZRZnV6Nm5FV0RFT0tDSUJyRUhUWS9t?= =?utf-8?B?ejY2am41aDcwYkxCUlZoV2I3eGU0MXIwc3lOL3FtNVBIZFJtZ0hxRTFyWS9Q?= =?utf-8?B?VHhOU01wT2xqbVNmdEU0eTR1MUxOZkwzRTFweTA3MHFac1Z1dUhjTDd2M21F?= =?utf-8?B?TDFsZFQ0YmZ1V0ZGa0FLaE5yS3RzNnFTVjMxTlRhUlhBN2pVMkJQSm5SUTIy?= =?utf-8?B?MUduRkU5NFkxaHJEYlRxaklxOERqUElZVFcxTUcwYmhJWGZ1ZDFOU2wxalRB?= =?utf-8?B?U3d5dDA4MTNuTnVpYUpXbjA4ZHVDcGwwL0I1ZVdiOXk4Rk9idGZLeENBWHB2?= =?utf-8?B?WjVRK3lUZDNlc09WVStkS1hSZi9rTFh6MmY1TForUEtXNGkxbzc0bWIwS2NH?= =?utf-8?B?ckNpZlk3c1pueTl2dGtEYm5ZTHVWNzJ6NThBS2tEaFJ1UjErSFdVU1piczVi?= =?utf-8?B?b0dGVGhuU1pKSytZRi9XRDhvK0RwajlsSnUrUCtnSDEybnVlMXBhRVo0M1hq?= =?utf-8?B?b3RwZUc2MURyelBiSFlsSnlLczFIZDlNbDFMNWNUYnFObS9GNXVGRExWQVBZ?= =?utf-8?B?cGdydERkL2h3U2VtSTdPUVlxOSt0K2RISHZsSVZySzZqM2tDOU9BYUw5SXdZ?= =?utf-8?B?b0U5dEt4TVZpekZ5OFJVM29mUldCeUhKOHhzZTRYY3g3WW9oNE9FVkE3aUhH?= =?utf-8?B?WGM1Y0s3WE4vL3hOMU5VUldvbHNKbkh6Ym0yWStvR2NhS1QzdktaWE9Yb2p4?= =?utf-8?B?TWFqR2p3NGZiMFhWZnpQeFJuTEFZeVNEZlJoNWlZVUIzKzFKaC9ONWRLQ1cw?= =?utf-8?B?bjBwSmtaajVZdjB2OFBKc1VoRDZ1eml1Q1FXVmhHK0pKTWo2M1JtMEptODAy?= =?utf-8?B?WlhxZWdlaS9GR0Q4VHN0TUMzZk55U0Q0RGVHYjdldGY1dldwanV5V0srV3FT?= =?utf-8?B?MVhzeHRMT2NmYi8vZkw1UENIenZqc0pIMFNoRnJic2xnMGR2MFQ2UU5EQlF3?= =?utf-8?B?MEl1RHdUT2JhQ1ZXdUFFWEJ0VE5jSkNTQkluTmtVZ1QzNlc2N2R2Z1ZnMlVU?= =?utf-8?B?enB6d3ZTTUVUcjVkSFpZRWxJVjltV3EyUHZ2bDYyaVZzOEVKL3J0RWxJYzZa?= =?utf-8?B?N2F0ODR6V2pRTVdIb2lNLytJL0lUcUNhd1VHVTFLYXpva3dPVmo0SXpwRUFJ?= =?utf-8?B?M1dQVlBFWi9JOXlOMUVib1RxR0JGV1F4WE51RHNCMWtmMFB5d3dsT1BQTlYr?= =?utf-8?Q?1r5rVehywz0/m61K4E9vgfVzu?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 3NbS38lRP6hBzpOryy4nqsUQjxucjBGH50JzF+S1Z48O+36vk3nUciTPCPTzc5fX0+n4mryDAm6om2vxWFAVcJ1EdrEt6zGqLfxFhA1bIu0bqu+63Frc4d1zckZqU+wTtSUxSnaDDni2737Tkhl9vX720n6U/tRWMaZM/WrU8kK0Ttf+KB4Lp3bB49OygkKPGa3jhdllnPa32e8IokRHUd7uhtXuRKz7qiukyBWs4C61EQPOAALaTTzdekw8LVlWh96ifPwW4U70vLbXRXntKiz7rX2brKJwlEcs3AvUdCwWdusFHwe4zVi3teupkPrT8E2JBBgDDG//o1htvi/qFJ9yorR3aYE/KPpZwelim6uxCFO3vQEmeJs1YvHx4/67JPN6gBvK7zvI09/6kbo1niUPwpc0J9Aqn4GUg9XxGlEYvhLRBgKp4nDTqOVjCM7TSCGqTcqlSgxfI5Wm0TYuxmM9XBD4PGmjlPCPbQyPLlaKPgfKSJvHCxTobLDe9RsYgl6ElM9nLv5OIVe0bBUow/CKKv0mW+rSJVrtH1cwOzWVP9LWUhc97r09ZsrtVgBf8vMgwiuU+fJaUh6XhutOqRtvLkd0lMNigvfljUKU7beWafWLB+btg6v8N9xpmbXEpNsrC6IND6XBP38tRaB31Fyl3u0q7oDgZdSPgeQyLXkSJ26cNcLWOMsDu53cPegsYgQNuJtL5CKSYfsSYm0UuzbkYycLrC0CkNbAtnKfbG8Syc41eDwG+J+MTPGoCwexnTMZZ1YXAf9myU32tZ9E0vnZNOfdQG3sQz+dHsG0UrgjerJEdUbFbzbPifurllmdVFvLPr5UUh4E+U32U8nl+j4CWCEVEUefr7/4W9Blmw1tSC9R1DzWrao9mTSdGbIByh4a3TiKm7Kk2EhxrpZMQ/Vmx7em1MoBpFALSv/gMzU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfc8de8e-6c28-4c94-eee5-08daf19fa9ab X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2023 17:42:07.4589 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3CWIImw3G0wCrZFrOa97Wt2aMeAvzt3Q7ydaNTTB4rsuAZpPLrIh/jxAPM0/RdFZQPj5PBKkuloLxwa4/h0WDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR10MB6234 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-08_13,2023-01-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=906 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301080132 X-Proofpoint-ORIG-GUID: M1O7kiwIKY28i2zmP578WVDFNB2TfsMJ X-Proofpoint-GUID: M1O7kiwIKY28i2zmP578WVDFNB2TfsMJ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , "monnier@iro.umontreal.ca" 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.7 (-) PiBTbyBpcyB0aGlzIHRvIGJlIGNvbnNpZGVyZWQgYW4gaW1wcm92ZW1lbnQgdG8gZm9yd2FyZC1z ZXhwIHRvbywgdGhlbj8NCg0KSSBkb24ndCB1bmRlcnN0YW5kIHRoZSBxdWVzdGlvbi4gIFdoYXQg aXMgInRoaXMiPw0KDQpWYXJpYWJsZSBgZm9yd2FyZC1zZXhwLWZ1bmN0aW9uJyBhbHJlYWR5IGhh cyBhbg0KYXBwcm9wcmlhdGUgbmFtZSwgSU1PLCBzaW5jZSBpdHMgdmFsdWUgY2FuIGJlIG5pbA0K KG5vdCBhIGZ1bmN0aW9uKS4NCg== From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 12:48:27 2023 Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 17:48:27 +0000 Received: from localhost ([127.0.0.1]:34558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZmU-00077l-NK for submit@debbugs.gnu.org; Sun, 08 Jan 2023 12:48:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:44544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZmT-00077f-OL for submit@debbugs.gnu.org; Sun, 08 Jan 2023 12:48:26 -0500 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 1pEZmT-0004YU-IE for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 12:48:25 -0500 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEZmR-0006GM-U4; Sun, 08 Jan 2023 12:48:25 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B3DE7C0006; Sun, 8 Jan 2023 17:48:17 +0000 (UTC) From: Juri Linkov To: Theodor Thornhill Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <87bkn9tasb.fsf@thornhill.no> (Theodor Thornhill's message of "Sun, 08 Jan 2023 14:29:08 +0100") Organization: LINKOV.NET References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> Date: Sun, 08 Jan 2023 19:33:28 +0200 Message-ID: <868ridudzv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4b98:dc4:8::226; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit Cc: casouri@gmail.com, "Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors" , 60623@debbugs.gnu.org, Daniel =?iso-8859-1?Q?Mart=EDn?= , monnier@iro.umontreal.ca, eliz@gnu.org 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: -2.6 (--) > @Juri: I added a change with how I understood what you meant. Is that > in your line of reasoning? Thanks, now this is more maintainable. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 12:48:23 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 17:48:23 +0000 Received: from localhost ([127.0.0.1]:34555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZmR-00077U-Eo for submit@debbugs.gnu.org; Sun, 08 Jan 2023 12:48:23 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56315) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEZmN-00076x-TE for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 12:48:21 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A6B4940008; Sun, 8 Jan 2023 17:48:10 +0000 (UTC) From: Juri Linkov To: Theodor Thornhill Subject: Re: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: (Theodor Thornhill's message of "Sun, 08 Jan 2023 18:04:12 +0100") Organization: LINKOV.NET References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> Date: Sun, 08 Jan 2023 19:30:48 +0200 Message-ID: <86k01xue5z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , Drew Adams , "monnier@iro.umontreal.ca" 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.7 (-) >>> >A good practice is to name such a function >>> >e.g. forward-sentence-default-function. >>> >>> Is this practice used anywhere else? Iirc >>> forward-sexp-function doesn't follow that >>> practice. >> >>On the other hand, if the value must always >>be a function, then having "-default-" in >>the name makes sense. > > So is this to be considered an improvement to forward-sexp too, then? Sorry, I can't find where a lambda is set to forward-sexp-function. I only see this: (defvar forward-sexp-function nil But if it will be set to a function later, it would be nice to define a default function as well. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 14:20:07 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 19:20:07 +0000 Received: from localhost ([127.0.0.1]:34730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbDD-00064s-3f for submit@debbugs.gnu.org; Sun, 08 Jan 2023 14:20:07 -0500 Received: from out2.migadu.com ([188.165.223.204]:19950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbD8-00064Q-AT for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 14:20:05 -0500 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=thornhill.no; s=key1; t=1673205600; 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: in-reply-to:in-reply-to:references:references; bh=ccgu7SMa4pt4qFz4b7KRXagxHeiC/d6WngZK55H9olE=; b=nvmvHL+ZCVldo/RZ46YA7+HyrvvxS/SfLfa4l3ARrWy5ZkT+WMLITJcL5UStuJKc9dHhyG 6YyUyQSKO3ZDx3EdiwqQWCh0i0G9gacWkZ5MrwjeHmdXoQflDm//oAKA8lskGpbX4+WxqO bYsaXu5bMEsz80dMomo2VyW3fXkyUnZciN3IXtdkOiH5KwdaAaHPHSAahjbOvqbRekCKmF CxIYYueAXVzz+LrC1PRIFPov2SIxq48b1b8HQMqN/5TDCQtYHIuAPddycsZ6/FO3/k2m+y ihLQxS+r3eNwTemasZaXec6AosIyPyzukNA0Q25MjGXBBw4iG8WXuBXyvPFXXQ== From: Theodor Thornhill To: Juri Linkov Subject: Re: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <86k01xue5z.fsf@mail.linkov.net> References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> <86k01xue5z.fsf@mail.linkov.net> Date: Sun, 08 Jan 2023 20:19:58 +0100 Message-ID: <878ricu941.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , Drew Adams , "monnier@iro.umontreal.ca" 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 (-) Juri Linkov writes: >>>> >A good practice is to name such a function >>>> >e.g. forward-sentence-default-function. >>>> >>>> Is this practice used anywhere else? Iirc >>>> forward-sexp-function doesn't follow that >>>> practice. >>> >>>On the other hand, if the value must always >>>be a function, then having "-default-" in >>>the name makes sense. >> >> So is this to be considered an improvement to forward-sexp too, then? > > Sorry, I can't find where a lambda is set to forward-sexp-function. > I only see this: > > (defvar forward-sexp-function nil > > But if it will be set to a function later, it would be nice > to define a default function as well. I meant the way we did with 'transpose-sexps', where there now is a 'transpose-sexps-function' variable containing the factored-out earlier implementation. And by if "this is an improvement" I meant declaring a specific defun as the default value for the defvar in question. Maybe I should add the same change which is now developing here there too. What do you think? Theo From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 14:36:09 2023 Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 19:36:09 +0000 Received: from localhost ([127.0.0.1]:34752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbSi-0006Ve-Q5 for submit@debbugs.gnu.org; Sun, 08 Jan 2023 14:36:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:60924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbSh-0006VX-7L for submit@debbugs.gnu.org; Sun, 08 Jan 2023 14:36:07 -0500 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 1pEbSg-0005vB-5m for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 14:36:06 -0500 Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEbSd-0002fo-AU; Sun, 08 Jan 2023 14:36:05 -0500 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=thornhill.no; s=key1; t=1673206560; 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: in-reply-to:in-reply-to:references:references; bh=KxDfZ76RzBpJB3tt7f6cQBnq6R/homj+ghB/KqLofKs=; b=HNWzMTWLcqT+skhy9EEZQ6AYtmIxJL4cyOFTUDig0Cgty+XRndqGpHwmbU1pQeHjNRk7rA NYKFhoKqAiKByAHf2LIW3uMqjk7VoVWu2ykqk+P+9zJL8BCFtRq26KoIo3+5tijc/V/jmK Rt3KGFn1JqxtctAQtrBvHTBa/gQTDOWMez356l2azr6wvCqI/7GECS2llFz0fNCUftcy/0 8YSRsItH+O71FjFyZa04Qlg3QL2s9c41/j1xEzVQqFR+X8477G75Bw2R8cNWnBIl1k1YQF ewgwsLdjG9e0GT939B6LEy13Fm4pZaF06RUGYBxeNxKdzv9xygw6T7W6mPsM/g== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <83sfgloz5w.fsf@gnu.org> References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> Date: Sun, 08 Jan 2023 20:35:58 +0100 Message-ID: <875ydgu8dd.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: casouri@gmail.com, bug-gnu-emacs@gnu.org, 60623@debbugs.gnu.org, juri@linkov.net, monnier@iro.umontreal.ca, mardani29@yahoo.es 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: -2.4 (--) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: 60623@debbugs.gnu.org, casouri@gmail.com, eliz@gnu.org, >> monnier@iro.umontreal.ca,Juri Linkov >> Date: Sun, 08 Jan 2023 14:29:08 +0100 >> >> @Eli, what doc changes do you see as needed here? > > More or less. They need some polishing, like a few words about what > does "sentence" mean in the tree-sitter context. But we can make > these changes after this is in the repository. > > Thanks. Ok, so in other words, this patch is good to go? I omitted the additions to java-ts-mode and c-ts-mode. I can make a separate commit to add some values that makes sense for multiple modes after? Will the changes to the manual lie in "26.2 Sentences"? in the Emacs manual? Theo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-forward-sentence-with-tree-sitter-support-bug-60.patch >From 558382b5c712431f0a19262c6e1fb67fdedd908b Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sun, 8 Jan 2023 20:28:02 +0100 Subject: [PATCH] Add forward-sentence with tree sitter support (bug#60623) * etc/NEWS: Mention the new changes. * lisp/textmodes/paragraphs.el (forward-sentence-default-function): Move old implementation to its own function. (forward-sentence-function): New defvar defaulting to old behavior. (forward-sentence): Use the variable in this function unconditionally. * lisp/treesit.el (treesit-sentence-type-regexp): New defvar. (treesit-forward-sentence): New defun. (treesit-major-mode-setup): Conditionally set forward-sentence-function. --- etc/NEWS | 16 ++++++++++++++++ lisp/textmodes/paragraphs.el | 15 +++++++++++++-- lisp/treesit.el | 28 ++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 690e9c3faa9..a0b2de056d8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -57,6 +57,22 @@ treesit.el now unconditionally sets 'transpose-sexps-function' for all Tree-sitter modes. This functionality utilizes the new 'transpose-sexps-function'. +** New defvar forward-sentence-function. +Emacs now can set this variable to customize the behavior of the +'forward-sentence' function. + +** New defun forward-sentence-default-function. +The previous implementation of 'forward-sentence' is moved into its +own function, to be bound by 'forward-sentence-function'. + +** New defvar-local 'treesit-sentence-type-regexp. +Similarly to 'treesit-defun-type-regexp', this variable is used to +navigate sentences in Tree-sitter enabled modes. + +** New function 'treesit-forward-sentence'. +treesit.el now conditionally sets 'forward-sentence-function' for all +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. + * Changes in Specialized Modes and Packages in Emacs 30.1 --- diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 73abb155aaa..fd2d83eeebf 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -441,13 +441,12 @@ end-of-paragraph-text (if (< (point) (point-max)) (end-of-paragraph-text)))))) -(defun forward-sentence (&optional arg) +(defun forward-sentence-default-function (&optional arg) "Move forward to next end of sentence. With argument, repeat. When ARG is negative, move backward repeatedly to start of sentence. The variable `sentence-end' is a regular expression that matches ends of sentences. Also, every paragraph boundary terminates sentences as well." - (interactive "^p") (or arg (setq arg 1)) (let ((opoint (point)) (sentence-end (sentence-end))) @@ -480,6 +479,18 @@ forward-sentence (let ((npoint (constrain-to-field nil opoint t))) (not (= npoint opoint))))) +(defvar forward-sentence-function #'forward-sentence-default-function + "Function to be used to calculate sentence movements. +See `forward-sentence' for a description of its behavior.") + +(defun forward-sentence (&optional arg) + "Move forward to next end of sentence. With argument, repeat. +When ARG is negative, move backward repeatedly to start of sentence. +Delegates its work to `forward-sentence-function'." + (interactive "^p") + (or arg (setq arg 1)) + (funcall forward-sentence-function arg)) + (defun count-sentences (start end) "Count sentences in current buffer from START to END." (let ((sentences 0) diff --git a/lisp/treesit.el b/lisp/treesit.el index a7f453a8899..0681e758b37 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1783,6 +1783,32 @@ treesit-end-of-defun (when treesit-defun-skipper (funcall treesit-defun-skipper)))) +(defvar-local treesit-sentence-type-regexp "" + "A regexp that matches the node type of sentence nodes. + +A sentence node is a node that is bigger than a sexp, and +delimits larger statements in the source code. It is, however, +smaller in scope than defuns. This is used by +`treesit-forward-sentence' and friends.") + +(defun treesit-forward-sentence (&optional arg) + "Tree-sitter `forward-sentence-function' function. + +ARG is the same as in `forward-sentence-function'. + +If inside comment or other nodes described in +`treesit-sentence-type-regexp', use +`forward-sentence-default-function', else move across nodes as +described by `treesit-sentence-type-regexp'." + + (if (string-match-p + treesit-text-type-regexp + (treesit-node-type (treesit-node-at (point)))) + (funcall #'forward-sentence-default-function arg) + (funcall + (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) + treesit-sentence-type-regexp (abs arg)))) + (defvar-local treesit-text-type-regexp "\\`comment\\'" "A regexp that matches the node type of textual nodes. @@ -2256,6 +2282,8 @@ treesit-major-mode-setup #'treesit-add-log-current-defun)) (setq-local transpose-sexps-function #'treesit-transpose-sexps) + (when treesit-sentence-type-regexp + (setq-local forward-sentence-function #'treesit-forward-sentence)) ;; Imenu. (when treesit-simple-imenu-settings -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 14:57:39 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 19:57:39 +0000 Received: from localhost ([127.0.0.1]:34763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbnX-00074D-EV for submit@debbugs.gnu.org; Sun, 08 Jan 2023 14:57:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbnT-00073z-4b for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 14:57:38 -0500 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 1pEbnM-0005bM-Jd; Sun, 08 Jan 2023 14:57:28 -0500 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=LsTvO93BqT7jdpEKaCn+InwdjG5wSSOYla910B1o2aE=; b=HoXGej5s1Fti eI16y8KhXq2QdfJNmRgYbEpHsWYHZmQI1j0sT0OGoLTGgRshUdjwDzMlF1tHEUurU3twSC86KNju+ 3r2qXaJhpftSEhVsALgOPhy1MhQrsipKga1Vr44aMX9bahn/MRaON/er/comvATAE5ud9Q0Uhcj3v 9CKZJZ5sI9zi06v4lIBPWnwvvTrkFoFspenVSGXe+2wcrKUgVtXIJRUftuAmcZBE6lDdr6RSpipqk q5/rkweTLlTyTU42W/LwfzINtG5a17grnTKqn0BhaFczy4AJJYmScTphZyRG0EQhetGOa+X2xmLyC jTxXCrxQ6UN2rirBM4TOug==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEbnM-0002UY-1D; Sun, 08 Jan 2023 14:57:28 -0500 Date: Sun, 08 Jan 2023 21:57:51 +0200 Message-Id: <83fsckpznk.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <875ydgu8dd.fsf@thornhill.no> (message from Theodor Thornhill on Sun, 08 Jan 2023 20:35:58 +0100) Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (---) > From: Theodor Thornhill > Cc: mardani29@yahoo.es, bug-gnu-emacs@gnu.org, 60623@debbugs.gnu.org, > casouri@gmail.com, monnier@iro.umontreal.ca, juri@linkov.net > Date: Sun, 08 Jan 2023 20:35:58 +0100 > > Eli Zaretskii writes: > > >> From: Theodor Thornhill > >> Cc: 60623@debbugs.gnu.org, casouri@gmail.com, eliz@gnu.org, > >> monnier@iro.umontreal.ca,Juri Linkov > >> Date: Sun, 08 Jan 2023 14:29:08 +0100 > >> > >> @Eli, what doc changes do you see as needed here? > > > > More or less. They need some polishing, like a few words about what > > does "sentence" mean in the tree-sitter context. But we can make > > these changes after this is in the repository. > > > > Thanks. > > > Ok, so in other words, this patch is good to go? Yes, I think so. > I omitted the additions to java-ts-mode and c-ts-mode. I can make a > separate commit to add some values that makes sense for multiple modes > after? SGTM. > Will the changes to the manual lie in "26.2 Sentences"? in the Emacs > manual? No, because these are not really sentences in some human-readable language, these are program parts. As such they should be somewhere under "27 Programs", possibly in "Defuns". However, "Sentences" might mention that programming modes have their own interpretation of "sentence" and corresponding movement commands. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 15:07:27 2023 Received: (at 60623) by debbugs.gnu.org; 8 Jan 2023 20:07:27 +0000 Received: from localhost ([127.0.0.1]:34772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbx0-0007Jp-PT for submit@debbugs.gnu.org; Sun, 08 Jan 2023 15:07:27 -0500 Received: from out2.migadu.com ([188.165.223.204]:63131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEbwy-0007Je-QN for 60623@debbugs.gnu.org; Sun, 08 Jan 2023 15:07:25 -0500 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=thornhill.no; s=key1; t=1673208443; 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: in-reply-to:in-reply-to:references:references; bh=hyVUoVeNl2CiFkNTtxSI2gAQvtTGG0bYgdyQnFHeL1U=; b=waJuhcnjpuLKPqgbkQw+Binq608FLK/dwDJkygpfPsMPRA30ajI4cVqNsPQnAdfSQ6ToEi scaigT8CdZuB7Vm41gRpwAMsjBKQIA+BznGwhygDNIAyK4r1jjUE7zis8Svy//rytGknDu P1XbjhCDQ2wBYpUVcHI+F9Td3ogUteGEUwM4grqQZc6Yhgu3w1vlFMIDNzcjFCEZ4j72We dzOVDMyqNb3aig/AsnP+5pwmHWR7Y8JzsCr4PMx/x2GtckbZGO8NBeEw8w9ULx8IAif+3z l9jaEgPfzYmkPjMwGcXjHWof2b5VSy9ALNCyDwLh7r7w25tPop8+Mh2OeRz1Pw== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <83fsckpznk.fsf@gnu.org> References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> Date: Sun, 08 Jan 2023 21:07:21 +0100 Message-ID: <87358ku6x2.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (-) Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: mardani29@yahoo.es, bug-gnu-emacs@gnu.org, 60623@debbugs.gnu.org, >> casouri@gmail.com, monnier@iro.umontreal.ca, juri@linkov.net >> Date: Sun, 08 Jan 2023 20:35:58 +0100 >> >> Eli Zaretskii writes: >> >> >> From: Theodor Thornhill >> >> Cc: 60623@debbugs.gnu.org, casouri@gmail.com, eliz@gnu.org, >> >> monnier@iro.umontreal.ca,Juri Linkov >> >> Date: Sun, 08 Jan 2023 14:29:08 +0100 >> >> >> >> @Eli, what doc changes do you see as needed here? >> > >> > More or less. They need some polishing, like a few words about what >> > does "sentence" mean in the tree-sitter context. But we can make >> > these changes after this is in the repository. >> > >> > Thanks. >> >> >> Ok, so in other words, this patch is good to go? > > Yes, I think so. > Great! >> I omitted the additions to java-ts-mode and c-ts-mode. I can make a >> separate commit to add some values that makes sense for multiple modes >> after? > > SGTM. > Nice. Will you install this for me? >> Will the changes to the manual lie in "26.2 Sentences"? in the Emacs >> manual? > > No, because these are not really sentences in some human-readable > language, these are program parts. As such they should be somewhere > under "27 Programs", possibly in "Defuns". > > However, "Sentences" might mention that programming modes have their > own interpretation of "sentence" and corresponding movement commands. Yeah, that makes sense. Should I make an attempt at such formulations, or will you do it at a later time? Theo From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 01:21:03 2023 Received: (at 60623) by debbugs.gnu.org; 9 Jan 2023 06:21:03 +0000 Received: from localhost ([127.0.0.1]:35606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pElWp-0001vU-59 for submit@debbugs.gnu.org; Mon, 09 Jan 2023 01:21:03 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pElWl-0001uc-ER for 60623@debbugs.gnu.org; Mon, 09 Jan 2023 01:21:02 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1324A440617; Mon, 9 Jan 2023 01:20:54 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5EA3E4404AD; Mon, 9 Jan 2023 01:20:52 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1673245252; bh=LAp6EA/J2fkgqCecfQc4qqk6D5jAXldG6qFd/9BgKK8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=PNoyMr/IXh/r+i+ZaO4MSxTADSuLmFqD+mkP/ySCOn3OeQjJ5d+sZLJpPKMVnbvgE AbIMZ4Jot5p90gMKZ5XX07xUam1Mxu9zwtIPmuVZn6KYuqLpKsbcP4GeacGsFtp8Al koQbpCdr855o/YHhbHmj4/IItmha5TKOjr0TRiBW283ePKFwtCztVp82mQ8AtZx0lt cpq4icVK/joLzi5nYK0TrsTWkv0h9i3vldRw7YrFWwRSjb0RdzDGXnjLnpgQLxxgUJ dNk+w6VHZVNhtg2PwmINzwXZux9NqjbfNPsSC8GW/eTCoPbLjRefJQOaGldGjUcLh0 6QZLyBh+oXrJQ== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E3F20120CC5; Mon, 9 Jan 2023 01:20:51 -0500 (EST) From: Stefan Monnier To: Drew Adams Subject: Re: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: (Drew Adams's message of "Sun, 8 Jan 2023 16:41:05 +0000") Message-ID: References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> Date: Mon, 09 Jan 2023 01:20:50 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.253 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: "casouri@gmail.com" , "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, Theodor Thornhill , "eliz@gnu.org" , Juri Linkov 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 (---) > Exactly. IMO, if the variable can have a > nonfunction value, especially nil, then Bad idea. That precludes changing the value of the variable with `add-function`, whereas `add-function` is often the best way for a major/minor mode to change that variable (actually, the "only" way to do it with some hope that it will interact correctly with other modes that may change it as well). > there's no need (nothing gained, and even possible > confusion/misunderstanding added) by adding "-default-" to the name. Instead we should strive to make the name of the default function simply irrelevant. If all goes well, nobody should ever need to explicitly call "the default value" of that variable. Instead the function they added via `add-function` will receive the "previous" value as argument. > On the other hand, if the value must always be a function, then having > "-default-" in the name makes sense. Agreed. It's also helpful when you look at the var's value, it lets you know that it hasn't been modified. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 02:56:09 2023 Received: (at 60623) by debbugs.gnu.org; 9 Jan 2023 07:56:09 +0000 Received: from localhost ([127.0.0.1]:35681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEn0r-0004Py-DM for submit@debbugs.gnu.org; Mon, 09 Jan 2023 02:56:09 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:43457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEn0n-0004PS-Ps for 60623@debbugs.gnu.org; Mon, 09 Jan 2023 02:56:08 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8657C1BF209; Mon, 9 Jan 2023 07:55:54 +0000 (UTC) From: Juri Linkov To: Theodor Thornhill Subject: Re: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <878ricu941.fsf@thornhill.no> (Theodor Thornhill's message of "Sun, 08 Jan 2023 20:19:58 +0100") Organization: LINKOV.NET References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> <86k01xue5z.fsf@mail.linkov.net> <878ricu941.fsf@thornhill.no> Date: Mon, 09 Jan 2023 09:49:55 +0200 Message-ID: <86o7r86tho.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , Drew Adams , "monnier@iro.umontreal.ca" 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.7 (-) >>> So is this to be considered an improvement to forward-sexp too, then? >> >> Sorry, I can't find where a lambda is set to forward-sexp-function. >> I only see this: >> >> (defvar forward-sexp-function nil >> >> But if it will be set to a function later, it would be nice >> to define a default function as well. > > I meant the way we did with 'transpose-sexps', where there now is a > 'transpose-sexps-function' variable containing the factored-out earlier > implementation. And by if "this is an improvement" I meant declaring a > specific defun as the default value for the defvar in question. Maybe I > should add the same change which is now developing here there too. > > What do you think? I agree that 'transpose-sexps-function' could benefit from the same improvement. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 03:01:30 2023 Received: (at 60623) by debbugs.gnu.org; 9 Jan 2023 08:01:30 +0000 Received: from localhost ([127.0.0.1]:35696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEn62-0004Zb-5y for submit@debbugs.gnu.org; Mon, 09 Jan 2023 03:01:30 -0500 Received: from out-17.mta0.migadu.com ([91.218.175.17]:61953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEn5z-0004ZR-25 for 60623@debbugs.gnu.org; Mon, 09 Jan 2023 03:01:29 -0500 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=thornhill.no; s=key1; t=1673251284; 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: in-reply-to:in-reply-to:references:references; bh=RcVev+tDmXkB4JDZCVaLJr0oj17IJOzLobzmVJlxrqc=; b=cPtbQ1knE6CudaC6qsuzdy77uTbHVCSt9/Pdy9uZRwUTRSyOanNnTJeypHsNLU7A4uk0TE kLEJJ59cyk0BepNP8Ke3br3cKRA7s/sHqG1HLq/KlVQxpAOo1TH59v+ruu3tCFxniUqcxH RLlsZEVOgbbKJqyAEi+0jArntTSE4UKSSgV/MyUrxWy/F1nn87Ag3CPrjhN0n2x179QKKm 3Ry1qNpwkLR4HpdVlkYTqaor+qwwnCxyOX88foGBAYpJjBvu2VFMOKCsyjrRxIxuqSs1h6 suWnnY+Lu8hPlcZHWmc3xQdcC+XfyS2kZNe9oM2ObSShKyXbC+B4b4ACIK66jw== From: Theodor Thornhill To: Juri Linkov Subject: Re: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <86o7r86tho.fsf@mail.linkov.net> References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> <86k01xue5z.fsf@mail.linkov.net> <878ricu941.fsf@thornhill.no> <86o7r86tho.fsf@mail.linkov.net> Date: Mon, 09 Jan 2023 09:01:23 +0100 Message-ID: <87ilhgt9v0.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "casouri@gmail.com" , "eliz@gnu.org" , Drew Adams , "monnier@iro.umontreal.ca" 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 (-) Juri Linkov writes: >>>> So is this to be considered an improvement to forward-sexp too, then? >>> >>> Sorry, I can't find where a lambda is set to forward-sexp-function. >>> I only see this: >>> >>> (defvar forward-sexp-function nil >>> >>> But if it will be set to a function later, it would be nice >>> to define a default function as well. >> >> I meant the way we did with 'transpose-sexps', where there now is a >> 'transpose-sexps-function' variable containing the factored-out earlier >> implementation. And by if "this is an improvement" I meant declaring a >> specific defun as the default value for the defvar in question. Maybe I >> should add the same change which is now developing here there too. >> >> What do you think? > > I agree that 'transpose-sexps-function' could benefit from the same improvement. Yeah, added such a change in bug#60654, as it was already reported :-) I appreciate your feedback! Theo From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 07:37:39 2023 Received: (at 60623) by debbugs.gnu.org; 9 Jan 2023 12:37:39 +0000 Received: from localhost ([127.0.0.1]:35972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pErPG-0008JR-TG for submit@debbugs.gnu.org; Mon, 09 Jan 2023 07:37:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pErPE-0008JD-Vi for 60623@debbugs.gnu.org; Mon, 09 Jan 2023 07:37:37 -0500 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 1pErP8-0002G1-HT; Mon, 09 Jan 2023 07:37:30 -0500 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=l/wLyAIRxpoOCJeZFjaE94qHpi7/wJwwhrqmz1lN5XY=; b=C+/wMTNxMl+e Saqa/KpTk5Aw7FIi/AUfbyExgiuqt3nUiJHJqQ2s7uAezdWfQ3EgdbohTyPhdNKV3TJ/vmcthARtA r7Lc8llsepJmPKOqcBuUSvfndJ3ZL0gm9S7WVqlxhia3rLnt3midENg1ud+OGW3jt2XVUd04aXNel GH+CwbPpWw/humPmyNUwzaOdBELapMpezlsFisym2T816okceEabdH8V8sSrk8oLYW2lBScJCUMD4 5YoZAyX23RPvtLcdlMFaEyeDlfwcSTRFQI31jpXnTuQ+9Q6c/T66m/2UWGlmpRRwb95RxOayG2kWv Jl4//6ZWLVdLzC+goYdwvQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pErP8-0008G3-1A; Mon, 09 Jan 2023 07:37:30 -0500 Date: Mon, 09 Jan 2023 14:37:54 +0200 Message-Id: <837cxvq3x9.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <87358ku6x2.fsf@thornhill.no> (message from Theodor Thornhill on Sun, 08 Jan 2023 21:07:21 +0100) Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (---) > From: Theodor Thornhill > Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, > monnier@iro.umontreal.ca, juri@linkov.net > Date: Sun, 08 Jan 2023 21:07:21 +0100 > > >> Ok, so in other words, this patch is good to go? > > > > Yes, I think so. > > > > Great! > > >> I omitted the additions to java-ts-mode and c-ts-mode. I can make a > >> separate commit to add some values that makes sense for multiple modes > >> after? > > > > SGTM. > > > > Nice. Will you install this for me? I'm under the impression that this is still being discussed? > >> Will the changes to the manual lie in "26.2 Sentences"? in the Emacs > >> manual? > > > > No, because these are not really sentences in some human-readable > > language, these are program parts. As such they should be somewhere > > under "27 Programs", possibly in "Defuns". > > > > However, "Sentences" might mention that programming modes have their > > own interpretation of "sentence" and corresponding movement commands. > > Yeah, that makes sense. Should I make an attempt at such formulations, > or will you do it at a later time? It is better that you try, if only to gain experience ;-) From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 08:28:29 2023 Received: (at 60623) by debbugs.gnu.org; 9 Jan 2023 13:28:29 +0000 Received: from localhost ([127.0.0.1]:36040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEsCT-0001H1-1I for submit@debbugs.gnu.org; Mon, 09 Jan 2023 08:28:29 -0500 Received: from out2.migadu.com ([188.165.223.204]:55979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEsCP-0001Gl-Tv for 60623@debbugs.gnu.org; Mon, 09 Jan 2023 08:28:27 -0500 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=thornhill.no; s=key1; t=1673270904; 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: in-reply-to:in-reply-to:references:references; bh=VjtQrWhtWe9pzrrmBevdZLE8807n6Fx9kjNEBycpgR0=; b=PfgsYg6mQyBKNuS+deC8Vl/NBwq+K45mqPNiNKR8r9qdJBMPmAvCKzDRQHW2TT5c486QtD pLMT7zr+tnzDTme6iNl05ZcE7M/1MTFTg0q0sj9hH++tmdWJJB7RzMMGscYJjUgSRI38Uf nEyo/riBxrkSSloNgdMj5daH0OURpCTXyAM2v+SWLjUygosspSXd5KVypD4dBshHG+phR4 KrwApWc4jeOvgi0eAq+bZxb/4XUdFxU4ykmp06e70rEkyHbrCUjlPFYLk5ye0ox5FQAPRu CvgzHaVKl2eSVklpyLDdZ+5/x4cRjE+gggKBM+MxCM4jrsA/cjugX5L9gZA6IQ== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <837cxvq3x9.fsf@gnu.org> References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> Date: Mon, 09 Jan 2023 14:28:23 +0100 Message-ID: <87a62ru9ag.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (-) Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, >> monnier@iro.umontreal.ca, juri@linkov.net >> Date: Sun, 08 Jan 2023 21:07:21 +0100 >> >> >> Ok, so in other words, this patch is good to go? >> > >> > Yes, I think so. >> > >> >> Great! >> >> >> I omitted the additions to java-ts-mode and c-ts-mode. I can make a >> >> separate commit to add some values that makes sense for multiple modes >> >> after? >> > >> > SGTM. >> > >> >> Nice. Will you install this for me? > > I'm under the impression that this is still being discussed? > Hmm - I thought I'd addressed all comments. I believe we discussed the transpose-sexps-function equivalent change, but sure - no hurry :) >> >> Will the changes to the manual lie in "26.2 Sentences"? in the Emacs >> >> manual? >> > >> > No, because these are not really sentences in some human-readable >> > language, these are program parts. As such they should be somewhere >> > under "27 Programs", possibly in "Defuns". >> > >> > However, "Sentences" might mention that programming modes have their >> > own interpretation of "sentence" and corresponding movement commands. >> >> Yeah, that makes sense. Should I make an attempt at such formulations, >> or will you do it at a later time? > > It is better that you try, if only to gain experience ;-) Will do! Thanks, Theo From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 10:57:23 2023 Received: (at 60623) by debbugs.gnu.org; 9 Jan 2023 15:57:23 +0000 Received: from localhost ([127.0.0.1]:37985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEuWZ-0001jm-2O for submit@debbugs.gnu.org; Mon, 09 Jan 2023 10:57:23 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:24862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEuWW-0001jb-SO for 60623@debbugs.gnu.org; Mon, 09 Jan 2023 10:57:22 -0500 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 309FWXBO007462; Mon, 9 Jan 2023 15:57:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=ix97NnABBETDNYgl3Vr6w+TU1ypzhhCB0HqCkBnbn1s=; b=XH3/LyA0jW9rLPzh5sx74DG7ydxFPgiW4EvWkGtM4OXxB1BRn1sjZ20VuShNy75CdsUI dvubdinXLpLwUwYtISzVNtz2kj/u67SVoqEHmFWDpHMnAg6E4AuaE6EDFubE3exJ7Xae bZDeQyvuY7CJ0+dayl3yLhfWs55slkNWH9TMSdmMcW3/FhQMgIFwsm9DUa4JJSMMUTZL J8hhhl7p4sKhYv/wt3Tjsla04jLHVkpVzBzmo/4PhRECtNWMgsc0iyHr7TpQOJApnphO b3ajR4oyDT/xS/mhHSFsT1Hv4rnEt1GS6AkBx5O7JXowoxvx4C3BTble63480e/8f7OY Bw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n0nn102dn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jan 2023 15:57:19 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 309FCTWq035379; Mon, 9 Jan 2023 15:57:18 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2176.outbound.protection.outlook.com [104.47.57.176]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n0h8uands-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jan 2023 15:57:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ok80CdfXiPfNp02tlNDxGTcpxM3+IhQaYxApTfF6iMoGiyRnJ/49tVdAE5eIwV1k2IxHC/Vrb6F61MhQaf75ScPf+Ew8yHQsiVPwePbWgfw2YUiqZc23Z80uInuTqoHT2B0DLrU0D9ZlDmeNz5Q7Mn5y67aQRuFyEFX+jYZC44wM1jy3vgULNUNgWG4WZ2ijtO1GUlAplAZP05NYEAqB1169S3dUV9/tA80Jvfnb8ujCokp1UOwJIy9wEl+6zQuDSU3GjayE714QTXfe54XdFN+PL2aH6HS/K+m0SZnI68UFEBtnSCEBfMGEhxxsiDzOJ1RRdJ5zSKMkUwfbkpTthQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ix97NnABBETDNYgl3Vr6w+TU1ypzhhCB0HqCkBnbn1s=; b=ULKbrJ3tWSZTbeJ5Ujwdv+1QS6Fu/EbZA98ArzCeCQnaYDYjMDYUrSLP00SeA/GhhtYMWra/mdVGJSKbMXJA1Lwf3E2pmDiw67Fs0ohrwvZiP3XPK12nk0rloiRiYzTUcd4HbGSTP8ozCYCH9boLzQbdq8mXUQaivEtIQx0vPirYUcOkebRflUUzW881GF3iyim6NAGn/Y1/e+CfNKiAiKsfA0gSFgXAgdcbZYah5iSjhIX2G/sCoJgh00mTr24HCvyyS4gGSMaLeeCFkNvK/Qcrs7NJVTgnUl34z+Vb4kybMJRL/0lSWKVaNFQ0ag4gPvdCzapZSE4TX4c32AJ+yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ix97NnABBETDNYgl3Vr6w+TU1ypzhhCB0HqCkBnbn1s=; b=qZrsXJ32KeTI04ZvbivN+lBOvaZ8m1qp5heg7PogzibH0xMuKzWaKhv6kiN3GFKy+vwEhtPgw0LhTq0zPuOuScA2J8Te0BSgR7ZbsBznpBYIhRF+qDpSoWOGoQhEnnGHmv8pQzSq4DewgMjKnWjYNVIMypyY6D9IZgkpo7t0GtQ= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by MW4PR10MB6559.namprd10.prod.outlook.com (2603:10b6:303:228::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.9; Mon, 9 Jan 2023 15:57:16 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29%7]) with mapi id 15.20.6002.010; Mon, 9 Jan 2023 15:57:16 +0000 From: Drew Adams To: Stefan Monnier Subject: RE: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Topic: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Index: AQHZI/KNyfYC8zSUJUi0/j5xFlVD9K6WNwbA Date: Mon, 9 Jan 2023 15:57:16 +0000 Message-ID: References: <87o7ratva2.fsf@thornhill.no> <86bkn9whgl.fsf@mail.linkov.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|MW4PR10MB6559:EE_ x-ms-office365-filtering-correlation-id: dfba8198-5f2d-41ac-4644-08daf25a2e92 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Tb0BVtE/liuBWDwWQxl+ToRShrrex3X5OsmxB8Qsf7NLTy+6ubM7QM5OuP3zZ2JHnMFaU81Dd9qrBSgPgYZJpM5+7w3KyVoDGSTjn3x06Gb167t/S+QkgDI5CYsgzeqpSbux+vl1NEsye/vx15FOSGD8H2dMl/v7IIGgOsAQ74TTx2Ak2NloSeLYTkMQDxa4gikXYzxY+G7jXHQshqSM+7Sw8HmjHFEN2cqPgIreIXaXlchHUtxaQV7kuhTCAiEXAr+w+w040nmrVoVuyl87VlOtC9lNpUbGypLa/wFFebxA+tg0sAODLwsLtQxhAnFVB2qbU8r/GHNFVVp7HWpTISIujQOkVbfh1aLLo2L8ULvrHl5+pgRwEY1Tyzbqmln/wq6XT83IUvhjM6ID/TSXkXK7p4gJeZkfRxKalJt4XFOBXNFuq5gk7po1sf1wmZA5delf+HpMLoRz3C/abXKjxT7DqkKIsHbW/Fz4G2D0xyr+ZZ3ehS1Zck6tG+wtXjzN9/Ls3+O3u7KZZikeCaZsgmEjeyYbL4JjnBNDqFElpw8IA6PX86mOhzR1WngIpnUy6xhMyRngvisego8fA1SZeQGd2Nwk/glkV2tmoJqVIN+UCnpQScHlHDpKGJvg3Jn0EuwFwBd7nTcNsIEbTlxMq4kNkVUlxxZTvyCJN2eGhghiGCrG79hcfh7Jp4OWGRGaJkOyPwERbntft8p2RjWhpA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(366004)(136003)(396003)(346002)(39860400002)(451199015)(38100700002)(6506007)(122000001)(2906002)(38070700005)(478600001)(33656002)(44832011)(186003)(296002)(7696005)(26005)(9686003)(5660300002)(71200400001)(316002)(8936002)(52536014)(55016003)(86362001)(41300700001)(8676002)(54906003)(66946007)(76116006)(66476007)(66556008)(6916009)(66446008)(64756008)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eFbzOMfMzq9eaOKCKvxOPiNN6r9lSkpfAnHh8klLDuE/E5geMWm94Yla6/La?= =?us-ascii?Q?lIR1LEQbeo7H9JTI0BXDlg2SEy/Z9Jv3jUOPZUVZSbcOrffLyYLBzROFapgX?= =?us-ascii?Q?T0AL+Y2ENMiJzoGCRbCTAalu2qhPbuk2WEp8mmh//YBmww8UD9pcfYRMnbTG?= =?us-ascii?Q?5XRcVzPhgkA1AN3EyVlMttjcQhrqebyDFYtoHYMC8wSVez89g6Xz946o0CpE?= =?us-ascii?Q?GVq9++VSJ0Umdir3phFJSoJbcaSKJgcYi1aOGXntV6zLOl7GSNty4jqKcCe1?= =?us-ascii?Q?LOfQsl2xUQ5f38iJEZznO8KyyO3mRaeWzk2483YlPCYzdl2ZU/uubmo1NGtu?= =?us-ascii?Q?E9Wfh4qdJQx+8AzlSYBv4I6lskpZHovin2u9fADrRk5Y9gfdqVjfQcfHy0mH?= =?us-ascii?Q?y3EnyUCp54QKnOmqRBE80hsWKR4QbFRk2Ohww3y1xN394QSeid4/yqojFVuU?= =?us-ascii?Q?mkUyAJ3tTwpJDg3dqotYQjjQt+nAEzGoKec5r8TxRFZjQgIIzcnhrkD2lExm?= =?us-ascii?Q?eYmmDW6vc0xI1lvY70G2m4ECmc5KUhmS1tCPTWcanzQ0FQIuPC4wo7+sjyh4?= =?us-ascii?Q?D9x8bamOpTEwMLJ3xCBxXpTmAXWhlDejpZW9NUkY/eIUruargBnfCQoADaQL?= =?us-ascii?Q?w9c2DPn5a5ssqAagiY1xS9xnLQVux8g108M2PbjjFaA2+fe79MGd7Z7vdIcq?= =?us-ascii?Q?8okOaE0GGGhiZS5lBEZzVGJiUwazSnBg+zdtXH1l18ATazrwYMHdKeroKI6/?= =?us-ascii?Q?P8ggk+VL/zrxGxSVyqkumuYc3XLQDNl9VLq6d6zAhFHkeSaHLiMyxXa0ADXt?= =?us-ascii?Q?AFa89pyLMO4ZEvw1IjdCu9T2vM4DDiJmUxFNc04dZczFAuy/Va6tRzwwTAUL?= =?us-ascii?Q?FC6CIHa+9K5NIoP74bSgFSdxv6hJpeZWKhs7XJniVYVplxpErRnFSbdn/uSR?= =?us-ascii?Q?PdgGfeeS4ffXry2zf+pLWvvi/PTAK4PX6E4I88IyjZjvC4othPSZBL6lD+6n?= =?us-ascii?Q?cyjtinBD1Nn46ltjebXnwUb/cblh+eLsM1cKga8L5O3d6rjlbIBw/Zi6IMyG?= =?us-ascii?Q?TGWASPpES6dWWwNdvnClHCsIFQjL7VGh5AKUTaerKVCpb8pj/0s1vluQcAjD?= =?us-ascii?Q?9frdVgwIOCg7NdMaTfGnkFdQOOGMRA6H5OzG7+Ymt4FL59fq2mQuCDy3bgRg?= =?us-ascii?Q?Mv5+EPvOyLgx8xc8vtydgrPkHIbj2KNowL7+IlBwZEwUk6VFNeilKl0InUjW?= =?us-ascii?Q?CtQ+49Q7TEXNXwMJy2m25tvcPQDbJWvxH3FwiGWuSV0UgK/rC4U/lWO+w57o?= =?us-ascii?Q?OLVhVCNAUwF/t7ycvNkNz8+udjLuc4LsD6h4LQLZD8XjvmeIOWjyEeU9Tkmi?= =?us-ascii?Q?so0RsJx/IBhs+6xl0sxVox8XG5JUKYDv0co0qEcux+txYrGdXVSvS809Yy3x?= =?us-ascii?Q?CsLMit9I9ehD6FAOJk0UMe13piUx7v84k7uVeN5jV/A/LNM8zmNcN3O6DHxK?= =?us-ascii?Q?dGHgMZHLIHFUT9aXRR/gd3n8Vg7dLrxItJhM9fIHRiDJiy2MdMdMRk4unZZ8?= =?us-ascii?Q?ox0IupxuARTQ1amGi75pJE5DzE0ZP42XRwKN7eWt?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Xeey4p1KcJyiP9E7gR+/1G4kmDn2E8pXjHXfbdQJUT94a7b5cgmrRlCvHaxanUOoPTn5f6jB6SzQMrY8zy4WFgT/Vc53QKgCK06Qm2frCBQlqBOGYhyOVO7BsYX2YQhB9j+BthsOKKd3S7OdOb537PiBjFt/UOdPRqlhnQn/MFr9LTr1cRtWhqSpObjfQimAkGmqz/dUsq+l2l1SjE1J3+pvdjhXeBEXqhMzSLtJtXf3/MLKzit2NC2aab6CAcsCrQiE/DMxVKwoyo4mQL3IhjQ7l8UjdQDsxUY30TXcwfZZ1CstsuiEc948Q6WBCdeqjXDOih39NRaTHcYVQ2F+T7YHMcFspZcutJoDCXeOUedy7xFEn+1RwkYBazna893SMbD15kvku3i03ZHYDvZXr3J8cLlpzeilb3i6hQcf9k5kDAF965ucqjoTpFNNKkmKVQTuHHI3lUuLpLHUXL4ajTCZd392Uy22vHVPdUT0Dz6RMNn/x37lL6rWhO8wF9eZZYFAt1AS9OrMIuMKOSJnvacPuwW/Ui6Per/SRkTfMu/z8CX0mJZqjA8+WNnvo0ZBDn0+GDYGAqM20qWGbHiKm9lULbss+ZkF0lGLtoGRKhGxD1nSOffYc1Bw5+Y0oujN0+JfzBJ5t9Jrs91Pvvg99rIiTM8yhQkL0SOuXW0v2EoMAkRZr+KUkhNFJQyvxgArB9qkWsPTa475+rNYImQE70HMc0X3WQq34s5dM94Kv9WROTQSELMyzTqLE+U86qmUpqtnoLibVQgFX7oY92jGg74BFDs0XYjrM37+ASbhTLC35KjfD+9izHR7Su9hGA39Sqq3iOXXRtDS8Tpw61xtcDNNsmemnnTdq4++q4GExNwodqn5WMEEs35ZrtY+AsmgxOQY5nEtkKlPGNRT/jYK3onTDocae/RtHwSPUP5HRco= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfba8198-5f2d-41ac-4644-08daf25a2e92 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2023 15:57:16.8194 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lrDPOYaThcINDFN9da06FmEeW4KLp2csCIZV/Jodgf0KSwVqCJFQtyQ1VxTHDfhWsiKPbkdUswb7sM/XHij87w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6559 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-09_10,2023-01-09_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=877 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301090115 X-Proofpoint-GUID: YoeA1aBnzG3qfUxO3DGg45wt0EzlCvIV X-Proofpoint-ORIG-GUID: YoeA1aBnzG3qfUxO3DGg45wt0EzlCvIV X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: "casouri@gmail.com" , "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, Theodor Thornhill , "eliz@gnu.org" , Juri Linkov 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.7 (-) > > Exactly. IMO, if the variable can have ^^ > > a nonfunction value, especially nil, then >=20 > Bad idea. I know you think so. ;-) > That precludes changing the value of the > variable with `add-function`, Yes, it does, at least blindly and ignoring its current value. And that's _appropriate_ IF the var can have a non-function value. But even in that case the var value can be tested to see if it's a function, and if/when so, advising it can make sense. > whereas `add-function` is often the best way for > a major/minor mode to change that variable (actually, the "only" way to > do it with some hope that it will interact correctly with other modes > that may change it as well). A legitimate argument. But it doesn't apply to a variable already defined so that it "can have a nonfunction value." Did you perhaps miss that "if"? I also don't agree that that (_good_) reason you give is all-deciding. I'd say that _other things being equal_, yes, you can take advantage of that good reason, IF the variable's value can be ensured to always be a function, or sometimes even if it just is currently a function. IOW, you give one (good) reason for one (good) practice, which, yes, can sometimes make sense. > > there's no need (nothing gained, and even > > possible confusion/misunderstanding added) by > > adding "-default-" to the name. > > > > On the other hand, if the value must always > > be a function, then having "-default-" in the > > name makes sense. >=20 > Agreed. It's also helpful when you look at the var's > value, it lets you know that it hasn't been modified. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 03:37:34 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 08:37:34 +0000 Received: from localhost ([127.0.0.1]:38744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFA8T-0007Hh-IM for submit@debbugs.gnu.org; Tue, 10 Jan 2023 03:37:34 -0500 Received: from out2.migadu.com ([188.165.223.204]:34461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFA8Q-0007HY-5K for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 03:37:31 -0500 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=thornhill.no; s=key1; t=1673339848; 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: in-reply-to:in-reply-to:references:references; bh=EtQKFXSdKUbHgJowjd1QAy1RQDga0KXoFgJGJY7Co3c=; b=MH2HYSTIpbBWufr1JgDlPHUi1IN4xwPhYSiQLKkC5m8E9mHbylq1zqaB5/PGsnX7/Lq1ZD EEVWI+HE2xyKQyebAKXhHOqot/2wU+weu+Hls5naV34yAYKNOy6hM/BF5hxLnfX2QjQW22 I4j8FxoM0FIsX9nZfk29aFjG8uIIGV64hMk8HDH1c4XJFHmDOhHLoGrmb1yyeRtZX07+/m 08ZEUXcLY6RRQ0JgEA1y1D0n8y1mrczTGQMlq8mlVWt0qbJEsMJxabVBh94xb+u1WRnsZB 1LY3fwR8jZTuIqx+wVJwUg2xLuzrhq+exq0J7BMaUSdelb9ew/Iq63q9CSqIAg== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <837cxvq3x9.fsf@gnu.org> References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> Date: Tue, 10 Jan 2023 09:37:26 +0100 Message-ID: <87h6wyss3d.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, >> monnier@iro.umontreal.ca, juri@linkov.net >> Date: Sun, 08 Jan 2023 21:07:21 +0100 >> >> >> Ok, so in other words, this patch is good to go? >> > >> > Yes, I think so. >> > >> >> Great! >> >> >> I omitted the additions to java-ts-mode and c-ts-mode. I can make a >> >> separate commit to add some values that makes sense for multiple modes >> >> after? >> > >> > SGTM. >> > >> >> Nice. Will you install this for me? > > I'm under the impression that this is still being discussed? > >> >> Will the changes to the manual lie in "26.2 Sentences"? in the Emacs >> >> manual? >> > >> > No, because these are not really sentences in some human-readable >> > language, these are program parts. As such they should be somewhere >> > under "27 Programs", possibly in "Defuns". >> > >> > However, "Sentences" might mention that programming modes have their >> > own interpretation of "sentence" and corresponding movement commands. >> >> Yeah, that makes sense. Should I make an attempt at such formulations, >> or will you do it at a later time? > > It is better that you try, if only to gain experience ;-) How about this for starter? Theo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-forward-sentence-with-tree-sitter-support-bug-60.patch >From 7b954b4f16d1dc832733932ca58f6e906ef0705d Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sun, 8 Jan 2023 20:28:02 +0100 Subject: [PATCH] Add forward-sentence with tree sitter support (bug#60623) * etc/NEWS: Mention the new changes. * lisp/textmodes/paragraphs.el (forward-sentence-default-function): Move old implementation to its own function. (forward-sentence-function): New defvar defaulting to old behavior. (forward-sentence): Use the variable in this function unconditionally. * lisp/treesit.el (treesit-sentence-type-regexp): New defvar. (treesit-forward-sentence): New defun. (treesit-major-mode-setup): Conditionally set forward-sentence-function. * doc/emacs/programs.texi (Defuns): Add new subsection. (Moving by Sentences): Add some documentation with xrefs to the elisp manual and related nodes. * doc/lispref/positions.texi (List Motion): Mention treesit-sentence-type-regexp and describe how to enable this functionality. --- doc/emacs/programs.texi | 37 ++++++++++++++++++++++++++++++++++++ doc/emacs/text.texi | 8 ++++++++ doc/lispref/positions.texi | 14 ++++++++++++++ etc/NEWS | 16 ++++++++++++++++ lisp/textmodes/paragraphs.el | 15 +++++++++++++-- lisp/treesit.el | 27 ++++++++++++++++++++++++++ 6 files changed, 115 insertions(+), 2 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 44cad5a148e..f7cdd99fa2b 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -163,6 +163,7 @@ Defuns * Left Margin Paren:: An open-paren or similar opening delimiter starts a defun if it is at the left margin. * Moving by Defuns:: Commands to move over or mark a major definition. +* Moving by Sentences:: Commands to move over certain definitions in code. * Imenu:: Making buffer indexes as menus. * Which Function:: Which Function mode shows which function you are in. @end menu @@ -254,6 +255,42 @@ Moving by Defuns language. Other major modes may replace any or all of these key bindings for that purpose. +@node Moving by Sentences +@subsection Moving by Sentences + + These commands move point or set up the region based on definitions, +also called @dfn{sentences}. Even though sentences is usually +considered when writing human languages, Emacs can use the same +commands to move over certain constructs in programming languages +(@pxref{Sentences}, @pxref{Moving by Defuns}). In a programming +language a sentence is usually a complete language construct smaller +than defuns, but larger than sexps (@pxref{List Motion,,, elisp, The +Emacs Lisp Reference Manual}). + +@table @kbd +@item M-a +Move to beginning of current or preceding sentence +(@code{backward-sentence}). +@item M-e +Move to end of current or following sentence (@code{forward-sentence}). +@end table + +@cindex move to beginning or end of sentence +@cindex sentence, move to beginning or end +@kindex M-a +@kindex M-e +@findex backward-sentence +@findex forward-sentence + The commands to move to the beginning and end of the current +sentence are @kbd{M-a} (@code{backward-sentence}) and @kbd{M-e} +(@code{forward-sentence}). If you repeat one of these commands, or +use a positive numeric argument, each repetition moves to the next +sentence in the direction of motion. + + @kbd{M-a} with a negative argument @minus{}@var{n} moves forward +@var{n} times to the next end of a sentence. Likewise, @kbd{M-e} with +a negative argument moves back to a start of a sentence. + @node Imenu @subsection Imenu @cindex index of buffer definitions diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 8fbf731a4f7..373582a93a4 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -253,6 +253,14 @@ Sentences of a sentence. Set the variable @code{sentence-end-without-period} to @code{t} in such cases. + Even though the above mentioned sentence movement commands are based +on human languages, other Emacs modes can set these command to get +similar functionality. What exactly a sentence is in a non-human +language is dependent on the target language, but usually it is +complete statements, such as a variable definition and initialization, +or a conditional statement (@pxref{Moving by Sentences,,, emacs, The +extensible self-documenting text editor}). + @node Paragraphs @section Paragraphs @cindex paragraphs diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index f3824436246..639d0d8025e 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -858,6 +858,20 @@ List Motion recognize nested defuns. @end defvar +@defvar treesit-sentence-type-regexp +The value of this variable is a regexp matching the node type of sentence +nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) + +@findex treesit-forward-sentence +@findex forward-sentence +@findex backward-sentence +If Emacs is compiled with tree-sitter, it can use the tree-sitter +parser information to move across syntax constructs. Since what +exactly is considered a sentence varies between languages, a major mode +should set @code{treesit-sentence-type-regexp} to determine that. Then +the mode can get navigation-by-sentence functionality for free, by using +@code{forward-sentence} and @code{backward-sentence}. + @node Skipping Characters @subsection Skipping Characters @cindex skipping characters diff --git a/etc/NEWS b/etc/NEWS index 3aa8f2abb77..af15a9b4545 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -66,6 +66,22 @@ treesit.el now unconditionally sets 'transpose-sexps-function' for all Tree-sitter modes. This functionality utilizes the new 'transpose-sexps-function'. +** New defvar forward-sentence-function. +Emacs now can set this variable to customize the behavior of the +'forward-sentence' function. + +** New defun forward-sentence-default-function. +The previous implementation of 'forward-sentence' is moved into its +own function, to be bound by 'forward-sentence-function'. + +** New defvar-local 'treesit-sentence-type-regexp. +Similarly to 'treesit-defun-type-regexp', this variable is used to +navigate sentences in Tree-sitter enabled modes. + +** New function 'treesit-forward-sentence'. +treesit.el now conditionally sets 'forward-sentence-function' for all +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. + * Changes in Specialized Modes and Packages in Emacs 30.1 --- diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 73abb155aaa..fd2d83eeebf 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -441,13 +441,12 @@ end-of-paragraph-text (if (< (point) (point-max)) (end-of-paragraph-text)))))) -(defun forward-sentence (&optional arg) +(defun forward-sentence-default-function (&optional arg) "Move forward to next end of sentence. With argument, repeat. When ARG is negative, move backward repeatedly to start of sentence. The variable `sentence-end' is a regular expression that matches ends of sentences. Also, every paragraph boundary terminates sentences as well." - (interactive "^p") (or arg (setq arg 1)) (let ((opoint (point)) (sentence-end (sentence-end))) @@ -480,6 +479,18 @@ forward-sentence (let ((npoint (constrain-to-field nil opoint t))) (not (= npoint opoint))))) +(defvar forward-sentence-function #'forward-sentence-default-function + "Function to be used to calculate sentence movements. +See `forward-sentence' for a description of its behavior.") + +(defun forward-sentence (&optional arg) + "Move forward to next end of sentence. With argument, repeat. +When ARG is negative, move backward repeatedly to start of sentence. +Delegates its work to `forward-sentence-function'." + (interactive "^p") + (or arg (setq arg 1)) + (funcall forward-sentence-function arg)) + (defun count-sentences (start end) "Count sentences in current buffer from START to END." (let ((sentences 0) diff --git a/lisp/treesit.el b/lisp/treesit.el index a7f453a8899..95f0fec739f 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1792,6 +1792,31 @@ treesit-text-type-regexp \"text_block\" in the case of a string. This is used by `prog-fill-reindent-defun' and friends.") +(defvar-local treesit-sentence-type-regexp "" + "A regexp that matches the node type of sentence nodes. + +A sentence node is a node that is bigger than a sexp, and +delimits larger statements in the source code. It is, however, +smaller in scope than defuns. This is used by +`treesit-forward-sentence' and friends.") + +(defun treesit-forward-sentence (&optional arg) + "Tree-sitter `forward-sentence-function' function. + +ARG is the same as in `forward-sentence-function'. + +If inside comment or other nodes described in +`treesit-sentence-type-regexp', use +`forward-sentence-default-function', else move across nodes as +described by `treesit-sentence-type-regexp'." + (if (string-match-p + treesit-text-type-regexp + (treesit-node-type (treesit-node-at (point)))) + (funcall #'forward-sentence-default-function arg) + (funcall + (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) + treesit-sentence-type-regexp (abs arg)))) + (defun treesit-default-defun-skipper () "Skips spaces after navigating a defun. This function tries to move to the beginning of a line, either by @@ -2256,6 +2281,8 @@ treesit-major-mode-setup #'treesit-add-log-current-defun)) (setq-local transpose-sexps-function #'treesit-transpose-sexps) + (when treesit-sentence-type-regexp + (setq-local forward-sentence-function #'treesit-forward-sentence)) ;; Imenu. (when treesit-simple-imenu-settings -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 10:06:57 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 15:06:57 +0000 Received: from localhost ([127.0.0.1]:40884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFGDI-0008WV-NP for submit@debbugs.gnu.org; Tue, 10 Jan 2023 10:06:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFGDG-0008WG-GQ for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 10:06:55 -0500 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 1pFGDA-0001H9-1b; Tue, 10 Jan 2023 10:06:48 -0500 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=JAZzDtCqE0JOXp1uO0yGHI+om28CNvvr9oKWAPy/M6E=; b=D4h/D5e+ldjX xal6AZ6MxbfdfMUh01i9MJIEwlAuV3K6Q29WDC7BiGe82b6xfvR0eMGS9Y2SoZgc95MKikFdC5P/T k3PuVnYnjDCsf0+1kSKIhxMFWoK1EhfYRMOfHXK9Z1GppkbW5Q93BxSICE7g4B7ccrKRnF/g/M86j rCQs1dsp5TT2iqXZEnlS6a/Eq/teZGyzspIjVyTt9dFc7mn3Al8toxZHgdhFxWsgruCAH3ezL6vnQ RlNxggvUW2DXPhQ9nJs7T6nO6QyCiWMLoDZk5BmV7A3wcDdSdR2Pjr+/Nzt9FZSTnFKxec+2XkZ0h CzjuJ5I3i5FAYB/BchWmFQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFGD9-00072z-Hg; Tue, 10 Jan 2023 10:06:47 -0500 Date: Tue, 10 Jan 2023 17:07:14 +0200 Message-Id: <83358io2cd.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <87h6wyss3d.fsf@thornhill.no> (message from Theodor Thornhill on Tue, 10 Jan 2023 09:37:26 +0100) Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (---) > From: Theodor Thornhill > Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, > monnier@iro.umontreal.ca, juri@linkov.net > Date: Tue, 10 Jan 2023 09:37:26 +0100 > > >> > No, because these are not really sentences in some human-readable > >> > language, these are program parts. As such they should be somewhere > >> > under "27 Programs", possibly in "Defuns". > >> > > >> > However, "Sentences" might mention that programming modes have their > >> > own interpretation of "sentence" and corresponding movement commands. > >> > >> Yeah, that makes sense. Should I make an attempt at such formulations, > >> or will you do it at a later time? > > > > It is better that you try, if only to gain experience ;-) > > How about this for starter? Very good, thank you very much. A few comments below. > --- a/doc/emacs/programs.texi > +++ b/doc/emacs/programs.texi > @@ -163,6 +163,7 @@ Defuns > * Left Margin Paren:: An open-paren or similar opening delimiter > starts a defun if it is at the left margin. > * Moving by Defuns:: Commands to move over or mark a major definition. > +* Moving by Sentences:: Commands to move over certain definitions in code. ^^^^^^^^^^^ I'd use "code units" or "units of code" here. Also, should we perhaps name the section "Moving by Statements"? or would it be too inaccurate? > + These commands move point or set up the region based on definitions, > +also called @dfn{sentences}. Even though sentences is usually Each @dfn in a manual should have an index entry, so that readers could easily find it. in this case, the index entry should qualify the "sentences" term by the fact that we are talking about units of code. So: @cindex sentences, in programming languages > +considered when writing human languages, Emacs can use the same > +commands to move over certain constructs in programming languages > +(@pxref{Sentences}, @pxref{Moving by Defuns}). In a programming > +language a sentence is usually a complete language construct smaller > +than defuns, but larger than sexps (@pxref{List Motion,,, elisp, The > +Emacs Lisp Reference Manual}). A couple of examples from two different languages could be a great help here. Otherwise this text sounds a bit too abstract. > +@kindex M-a > +@kindex M-e Since we already have M-e elsewhere in the manual, I suggest to qualify the key bindings here: @kindex M-a @r{(programming modes)} and similarly for M-e. The @r{..} thingy is necessary to reset to the default typeface, since key index is implicitly typeset in @code. > +@findex backward-sentence > +@findex forward-sentence Likewise with these two @findex entries: qualify them, since we have the same commands documented elsewhere under "Sentences". > --- a/doc/emacs/text.texi > +++ b/doc/emacs/text.texi > @@ -253,6 +253,14 @@ Sentences > of a sentence. Set the variable @code{sentence-end-without-period} to > @code{t} in such cases. > > + Even though the above mentioned sentence movement commands are based > +on human languages, other Emacs modes can set these command to get > +similar functionality. What exactly a sentence is in a non-human > +language is dependent on the target language, but usually it is > +complete statements, such as a variable definition and initialization, > +or a conditional statement (@pxref{Moving by Sentences,,, emacs, The > +extensible self-documenting text editor}). The last sentence should be in "Moving by Sentences", since it describes the commands documented there. Also, please add a cross-reference here to "Moving by Sentences", since you mention that in the text (and rightfully so). > +@defvar treesit-sentence-type-regexp > +The value of this variable is a regexp matching the node type of sentence > +nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) > + > +@findex treesit-forward-sentence > +@findex forward-sentence > +@findex backward-sentence > +If Emacs is compiled with tree-sitter, it can use the tree-sitter > +parser information to move across syntax constructs. Since what > +exactly is considered a sentence varies between languages, a major mode > +should set @code{treesit-sentence-type-regexp} to determine that. Then > +the mode can get navigation-by-sentence functionality for free, by using > +@code{forward-sentence} and @code{backward-sentence}. Here please also add a cross-reference to the "Moving by Sentences" node in the Emacs manual, so that people could understand what kind of "sentences" this is talking about. > +** New defvar forward-sentence-function. ^^^^^^^^^^ "New variable" > +Emacs now can set this variable to customize the behavior of the > +'forward-sentence' function. Not "Emacs", but "major modes". > +** New defun forward-sentence-default-function. ^^^^^^^^^ "New function" > +The previous implementation of 'forward-sentence' is moved into its > +own function, to be bound by 'forward-sentence-function'. > + > +** New defvar-local 'treesit-sentence-type-regexp. > +Similarly to 'treesit-defun-type-regexp', this variable is used to > +navigate sentences in Tree-sitter enabled modes. > + > +** New function 'treesit-forward-sentence'. > +treesit.el now conditionally sets 'forward-sentence-function' for all > +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. Please make these related items sub-headings of a common heading, something like "Commands and variables to move by program statements". > + > > * Changes in Specialized Modes and Packages in Emacs 30.1 > --- > diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el > index 73abb155aaa..fd2d83eeebf 100644 > --- a/lisp/textmodes/paragraphs.el > +++ b/lisp/textmodes/paragraphs.el > @@ -441,13 +441,12 @@ end-of-paragraph-text > (if (< (point) (point-max)) > (end-of-paragraph-text)))))) > > -(defun forward-sentence (&optional arg) > +(defun forward-sentence-default-function (&optional arg) > "Move forward to next end of sentence. With argument, repeat. > When ARG is negative, move backward repeatedly to start of sentence. > > The variable `sentence-end' is a regular expression that matches ends of > sentences. Also, every paragraph boundary terminates sentences as well." > - (interactive "^p") > (or arg (setq arg 1)) > (let ((opoint (point)) > (sentence-end (sentence-end))) > @@ -480,6 +479,18 @@ forward-sentence > (let ((npoint (constrain-to-field nil opoint t))) > (not (= npoint opoint))))) > > +(defvar forward-sentence-function #'forward-sentence-default-function > + "Function to be used to calculate sentence movements. > +See `forward-sentence' for a description of its behavior.") > + > +(defun forward-sentence (&optional arg) > + "Move forward to next end of sentence. With argument, repeat. ^^^^^^^^^^^^^^^^^^^^^ "With argument ARG, repeat." The doc string should reference the arguments where possible. > +When ARG is negative, move backward repeatedly to start of sentence. ^^^^ "If", not "When". > +(defvar-local treesit-sentence-type-regexp "" > + "A regexp that matches the node type of sentence nodes. Why is the default an empty regexp? wouldn't nil be better? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 14:34:02 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 19:34:02 +0000 Received: from localhost ([127.0.0.1]:41176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFKNk-00015o-KJ for submit@debbugs.gnu.org; Tue, 10 Jan 2023 14:34:02 -0500 Received: from out-167.mta0.migadu.com ([91.218.175.167]:34161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFKNh-00015b-LV for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 14:33:59 -0500 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=thornhill.no; s=key1; t=1673379235; 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: in-reply-to:in-reply-to:references:references; bh=XpSOM+1H45SUxhYfXkBXdKS2b/Oce4P9FblHtFPnXVg=; b=W0p51eEgBy+EAm+kPZNOGsDX3IpJK1VUlRT74GxYqysR8QX9dUdulLn5MOLJjjlkdUMbeh BvaE50xpdSvqKFOew89Itd3asFtxRa4TimJPap21ske697b780RBUnG4r9LlIVWiKVCNpi kwaG69b3hXVDdGS+JC1LoxfeeMXGGO6c4kDrGEhd1zMDStRzJmDMmWeF0ymwilYC8z4bqc UR7mEDXcyAOmCIrBuvW9wy4UHrwRyTjEBXUfksycgGuq0b630ZVfXxSm7f4uMCRQ7x26Se dw8YFkBYLEZQ4jrF0r3efdTtLVXLEW3AsM81CPwBTV96OMd7QcmAFUnJabVk3g== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <83358io2cd.fsf@gnu.org> References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> Date: Tue, 10 Jan 2023 20:33:52 +0100 Message-ID: <87zgaqmbfj.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, >> monnier@iro.umontreal.ca, juri@linkov.net >> Date: Tue, 10 Jan 2023 09:37:26 +0100 >> >> >> > No, because these are not really sentences in some human-readable >> >> > language, these are program parts. As such they should be somewhere >> >> > under "27 Programs", possibly in "Defuns". >> >> > >> >> > However, "Sentences" might mention that programming modes have their >> >> > own interpretation of "sentence" and corresponding movement commands. >> >> >> >> Yeah, that makes sense. Should I make an attempt at such formulations, >> >> or will you do it at a later time? >> > >> > It is better that you try, if only to gain experience ;-) >> >> How about this for starter? > > Very good, thank you very much. A few comments below. > >> --- a/doc/emacs/programs.texi >> +++ b/doc/emacs/programs.texi >> @@ -163,6 +163,7 @@ Defuns >> * Left Margin Paren:: An open-paren or similar opening delimiter >> starts a defun if it is at the left margin. >> * Moving by Defuns:: Commands to move over or mark a major definition. >> +* Moving by Sentences:: Commands to move over certain definitions in code. > ^^^^^^^^^^^ > I'd use "code units" or "units of code" here. Done. > > Also, should we perhaps name the section "Moving by Statements"? or > would it be too inaccurate? > I'm not sure. I think that maybe because the commands involved, and the ones that implicitly will be impacted, such as kill-sentence and friends it is best to stay with Sentences? But a statement is the better term wrt programming languages of course. I hold no strong opinions here. >> + These commands move point or set up the region based on definitions, >> +also called @dfn{sentences}. Even though sentences is usually > > Each @dfn in a manual should have an index entry, so that readers > could easily find it. in this case, the index entry should qualify > the "sentences" term by the fact that we are talking about units of > code. So: > > @cindex sentences, in programming languages > Done. >> +considered when writing human languages, Emacs can use the same >> +commands to move over certain constructs in programming languages >> +(@pxref{Sentences}, @pxref{Moving by Defuns}). In a programming >> +language a sentence is usually a complete language construct smaller >> +than defuns, but larger than sexps (@pxref{List Motion,,, elisp, The >> +Emacs Lisp Reference Manual}). > > A couple of examples from two different languages could be a great > help here. Otherwise this text sounds a bit too abstract. > Something like this? >> +@kindex M-a >> +@kindex M-e > > Since we already have M-e elsewhere in the manual, I suggest to > qualify the key bindings here: > > @kindex M-a @r{(programming modes)} > > and similarly for M-e. The @r{..} thingy is necessary to reset to the > default typeface, since key index is implicitly typeset in @code. > >> +@findex backward-sentence >> +@findex forward-sentence > > Likewise with these two @findex entries: qualify them, since we have > the same commands documented elsewhere under "Sentences". > Done. >> --- a/doc/emacs/text.texi >> +++ b/doc/emacs/text.texi >> @@ -253,6 +253,14 @@ Sentences >> of a sentence. Set the variable @code{sentence-end-without-period} to >> @code{t} in such cases. >> >> + Even though the above mentioned sentence movement commands are based >> +on human languages, other Emacs modes can set these command to get >> +similar functionality. What exactly a sentence is in a non-human >> +language is dependent on the target language, but usually it is >> +complete statements, such as a variable definition and initialization, >> +or a conditional statement (@pxref{Moving by Sentences,,, emacs, The >> +extensible self-documenting text editor}). > > The last sentence should be in "Moving by Sentences", since it > describes the commands documented there. Also, please add a > cross-reference here to "Moving by Sentences", since you mention that > in the text (and rightfully so). > Is something like this what you meant? >> +@defvar treesit-sentence-type-regexp >> +The value of this variable is a regexp matching the node type of sentence >> +nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) >> + >> +@findex treesit-forward-sentence >> +@findex forward-sentence >> +@findex backward-sentence >> +If Emacs is compiled with tree-sitter, it can use the tree-sitter >> +parser information to move across syntax constructs. Since what >> +exactly is considered a sentence varies between languages, a major mode >> +should set @code{treesit-sentence-type-regexp} to determine that. Then >> +the mode can get navigation-by-sentence functionality for free, by using >> +@code{forward-sentence} and @code{backward-sentence}. > > Here please also add a cross-reference to the "Moving by Sentences" > node in the Emacs manual, so that people could understand what kind of > "sentences" this is talking about. > >> +** New defvar forward-sentence-function. > ^^^^^^^^^^ > "New variable" > >> +Emacs now can set this variable to customize the behavior of the >> +'forward-sentence' function. > > Not "Emacs", but "major modes". > >> +** New defun forward-sentence-default-function. > ^^^^^^^^^ > "New function" > >> +The previous implementation of 'forward-sentence' is moved into its >> +own function, to be bound by 'forward-sentence-function'. >> + >> +** New defvar-local 'treesit-sentence-type-regexp. >> +Similarly to 'treesit-defun-type-regexp', this variable is used to >> +navigate sentences in Tree-sitter enabled modes. >> + >> +** New function 'treesit-forward-sentence'. >> +treesit.el now conditionally sets 'forward-sentence-function' for all >> +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. > > Please make these related items sub-headings of a common heading, > something like "Commands and variables to move by program statements". > Done. >> + >> >> * Changes in Specialized Modes and Packages in Emacs 30.1 >> --- >> diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el >> index 73abb155aaa..fd2d83eeebf 100644 >> --- a/lisp/textmodes/paragraphs.el >> +++ b/lisp/textmodes/paragraphs.el >> @@ -441,13 +441,12 @@ end-of-paragraph-text >> (if (< (point) (point-max)) >> (end-of-paragraph-text)))))) >> >> -(defun forward-sentence (&optional arg) >> +(defun forward-sentence-default-function (&optional arg) >> "Move forward to next end of sentence. With argument, repeat. >> When ARG is negative, move backward repeatedly to start of sentence. >> >> The variable `sentence-end' is a regular expression that matches ends of >> sentences. Also, every paragraph boundary terminates sentences as well." >> - (interactive "^p") >> (or arg (setq arg 1)) >> (let ((opoint (point)) >> (sentence-end (sentence-end))) >> @@ -480,6 +479,18 @@ forward-sentence >> (let ((npoint (constrain-to-field nil opoint t))) >> (not (= npoint opoint))))) >> >> +(defvar forward-sentence-function #'forward-sentence-default-function >> + "Function to be used to calculate sentence movements. >> +See `forward-sentence' for a description of its behavior.") >> + >> +(defun forward-sentence (&optional arg) >> + "Move forward to next end of sentence. With argument, repeat. > ^^^^^^^^^^^^^^^^^^^^^ > "With argument ARG, repeat." The doc string should reference the > arguments where possible. > Thanks, done. >> +When ARG is negative, move backward repeatedly to start of sentence. > ^^^^ > "If", not "When". > Done >> +(defvar-local treesit-sentence-type-regexp "" >> + "A regexp that matches the node type of sentence nodes. > > Why is the default an empty regexp? wouldn't nil be better? Indeed it will, done. How about this? Theo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-forward-sentence-with-tree-sitter-support-bug-60.patch >From 05b880680f70825d56b624b55f39b9114ba22c8d Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sun, 8 Jan 2023 20:28:02 +0100 Subject: [PATCH] Add forward-sentence with tree sitter support (bug#60623) * etc/NEWS: Mention the new changes. * lisp/textmodes/paragraphs.el (forward-sentence-default-function): Move old implementation to its own function. (forward-sentence-function): New defvar defaulting to old behavior. (forward-sentence): Use the variable in this function unconditionally. * lisp/treesit.el (treesit-sentence-type-regexp): New defvar. (treesit-forward-sentence): New defun. (treesit-major-mode-setup): Conditionally set forward-sentence-function. * doc/emacs/programs.texi (Defuns): Add new subsection. (Moving by Sentences): Add some documentation with xrefs to the elisp manual and related nodes. * doc/lispref/positions.texi (List Motion): Mention treesit-sentence-type-regexp and describe how to enable this functionality. --- doc/emacs/programs.texi | 56 ++++++++++++++++++++++++++++++++++++ doc/emacs/text.texi | 5 ++++ doc/lispref/positions.texi | 17 +++++++++++ etc/NEWS | 18 ++++++++++++ lisp/textmodes/paragraphs.el | 15 ++++++++-- lisp/treesit.el | 27 +++++++++++++++++ 6 files changed, 136 insertions(+), 2 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 44cad5a148e..a2cdf6c6eb9 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -163,6 +163,7 @@ Defuns * Left Margin Paren:: An open-paren or similar opening delimiter starts a defun if it is at the left margin. * Moving by Defuns:: Commands to move over or mark a major definition. +* Moving by Sentences:: Commands to move over certain code units. * Imenu:: Making buffer indexes as menus. * Which Function:: Which Function mode shows which function you are in. @end menu @@ -254,6 +255,61 @@ Moving by Defuns language. Other major modes may replace any or all of these key bindings for that purpose. +@node Moving by Sentences +@subsection Moving by Sentences +@cindex sentences, in programming languages + + These commands move point or set up the region based on units of +code, also called @dfn{sentences}. Even though sentences are usually +considered when writing human languages, Emacs can use the same +commands to move over certain constructs in programming languages +(@pxref{Sentences}, @pxref{Moving by Defuns}). In a programming +language a sentence is usually a complete language construct smaller +than defuns, but larger than sexps (@pxref{List Motion,,, elisp, The +Emacs Lisp Reference Manual}). What exactly a sentence is in a +non-human language is dependent on the target language, but usually it +is complete statements, such as a variable definition and +initialization, or a conditional statement. An example of a sentence +in the C language could be + +@example +int x = 5; +@end example + +or in the JavaScript language it could look like + +@example +const thing = () => console.log("Hi"); + +const foo = [1] == '1' + ? "No way" + : "..."; +@end example + +@table @kbd +@item M-a +Move to beginning of current or preceding sentence +(@code{backward-sentence}). +@item M-e +Move to end of current or following sentence (@code{forward-sentence}). +@end table + +@cindex move to beginning or end of sentence +@cindex sentence, move to beginning or end +@kindex M-a @r{(programming modes)} +@kindex M-e @r{(programming modes)} +@findex backward-sentence @r{(programming modes)} +@findex forward-sentence @r{(programming modes)} + The commands to move to the beginning and end of the current +sentence are @kbd{M-a} (@code{backward-sentence}) and @kbd{M-e} +(@code{forward-sentence}). If you repeat one of these commands, or +use a positive numeric argument, each repetition moves to the next +sentence in the direction of motion. + + @kbd{M-a} with a negative argument @minus{}@var{n} moves forward +@var{n} times to the next end of a sentence. Likewise, @kbd{M-e} with +a negative argument moves back to a start of a sentence. + @node Imenu @subsection Imenu @cindex index of buffer definitions diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 8fbf731a4f7..acd3bb21c29 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -253,6 +253,11 @@ Sentences of a sentence. Set the variable @code{sentence-end-without-period} to @code{t} in such cases. + Even though the above mentioned sentence movement commands are based +on human languages, other Emacs modes can set these command to get +similar functionality (@pxref{Moving by Sentences,,, emacs, The +extensible self-documenting text editor}). + @node Paragraphs @section Paragraphs @cindex paragraphs diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index f3824436246..8d95ecee7ab 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -858,6 +858,23 @@ List Motion recognize nested defuns. @end defvar +@defvar treesit-sentence-type-regexp +The value of this variable is a regexp matching the node type of sentence +nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) +@end defvar + +@findex treesit-forward-sentence +@findex forward-sentence +@findex backward-sentence +If Emacs is compiled with tree-sitter, it can use the tree-sitter +parser information to move across syntax constructs. Since what +exactly is considered a sentence varies between languages, a major +mode should set @code{treesit-sentence-type-regexp} to determine that. +Then the mode can get navigation-by-sentence functionality for free, +by using @code{forward-sentence} and +@code{backward-sentence}(@pxref{Moving by Sentences,,, emacs, The +extensible self-documenting text editor}). + @node Skipping Characters @subsection Skipping Characters @cindex skipping characters diff --git a/etc/NEWS b/etc/NEWS index 3aa8f2abb77..0c782eeaee8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -66,6 +66,24 @@ treesit.el now unconditionally sets 'transpose-sexps-function' for all Tree-sitter modes. This functionality utilizes the new 'transpose-sexps-function'. +** Commands and variables to move by program statements + +*** New variable 'forward-sentence-function'. +Major modes now can set this variable to customize the behavior of the +'forward-sentence' function. + +*** New function 'forward-sentence-default-function'. +The previous implementation of 'forward-sentence' is moved into its +own function, to be bound by 'forward-sentence-function'. + +*** New defvar-local 'treesit-sentence-type-regexp. +Similarly to 'treesit-defun-type-regexp', this variable is used to +navigate sentences in Tree-sitter enabled modes. + +*** New function 'treesit-forward-sentence'. +treesit.el now conditionally sets 'forward-sentence-function' for all +Tree-sitter modes that sets 'treesit-sentence-type-regexp'. + * Changes in Specialized Modes and Packages in Emacs 30.1 --- diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 73abb155aaa..bf249fdcdfb 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -441,13 +441,12 @@ end-of-paragraph-text (if (< (point) (point-max)) (end-of-paragraph-text)))))) -(defun forward-sentence (&optional arg) +(defun forward-sentence-default-function (&optional arg) "Move forward to next end of sentence. With argument, repeat. When ARG is negative, move backward repeatedly to start of sentence. The variable `sentence-end' is a regular expression that matches ends of sentences. Also, every paragraph boundary terminates sentences as well." - (interactive "^p") (or arg (setq arg 1)) (let ((opoint (point)) (sentence-end (sentence-end))) @@ -480,6 +479,18 @@ forward-sentence (let ((npoint (constrain-to-field nil opoint t))) (not (= npoint opoint))))) +(defvar forward-sentence-function #'forward-sentence-default-function + "Function to be used to calculate sentence movements. +See `forward-sentence' for a description of its behavior.") + +(defun forward-sentence (&optional arg) + "Move forward to next end of sentence. With argument ARG, repeat. +If ARG is negative, move backward repeatedly to start of +sentence. Delegates its work to `forward-sentence-function'." + (interactive "^p") + (or arg (setq arg 1)) + (funcall forward-sentence-function arg)) + (defun count-sentences (start end) "Count sentences in current buffer from START to END." (let ((sentences 0) diff --git a/lisp/treesit.el b/lisp/treesit.el index a7f453a8899..4c01a8db281 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1792,6 +1792,31 @@ treesit-text-type-regexp \"text_block\" in the case of a string. This is used by `prog-fill-reindent-defun' and friends.") +(defvar-local treesit-sentence-type-regexp nil + "A regexp that matches the node type of sentence nodes. + +A sentence node is a node that is bigger than a sexp, and +delimits larger statements in the source code. It is, however, +smaller in scope than defuns. This is used by +`treesit-forward-sentence' and friends.") + +(defun treesit-forward-sentence (&optional arg) + "Tree-sitter `forward-sentence-function' function. + +ARG is the same as in `forward-sentence'. + +If inside comment or other nodes described in +`treesit-sentence-type-regexp', use +`forward-sentence-default-function', else move across nodes as +described by `treesit-sentence-type-regexp'." + (if (string-match-p + treesit-text-type-regexp + (treesit-node-type (treesit-node-at (point)))) + (funcall #'forward-sentence-default-function arg) + (funcall + (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) + treesit-sentence-type-regexp (abs arg)))) + (defun treesit-default-defun-skipper () "Skips spaces after navigating a defun. This function tries to move to the beginning of a line, either by @@ -2256,6 +2281,8 @@ treesit-major-mode-setup #'treesit-add-log-current-defun)) (setq-local transpose-sexps-function #'treesit-transpose-sexps) + (when treesit-sentence-type-regexp + (setq-local forward-sentence-function #'treesit-forward-sentence)) ;; Imenu. (when treesit-simple-imenu-settings -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 15:03:25 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 20:03:25 +0000 Received: from localhost ([127.0.0.1]:41197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFKqD-0001ul-0s for submit@debbugs.gnu.org; Tue, 10 Jan 2023 15:03:25 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFKqB-0001uY-Qf for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 15:03:24 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3F5B880D0F; Tue, 10 Jan 2023 15:03:18 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A837880323; Tue, 10 Jan 2023 15:03:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1673380996; bh=nyqEHcQa1UDrUC60vyY+3kE7vbFHrw6TeXVeGXQGk4Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=K4nTrfunuzij+1dDGyUTPiQSd4PradwK+A1ujBSefPzxLHSb9GU0wPfNql4a8wZuP hTIu/otGS0Wy7YxM21KCEt126nDwDMRi+dswYhqF5klYNKPxfR59DuAI4aFeVMz3Kr vUNRNMcfsmnBx9v/uR82j2B40/ImXuyMBIIkBcm80QwFoHhnIMAm+ZTz9uy9bMwpKG be3P/OmbPLP5RPkkJ9wEWCaYk79iDZOg1Ki80wk9a5H/SXqPEtAqT+V4nIajUOh6P4 i+DQDgE/pfCyCXA2dwDUmHi+hc6R/gp5xzYSXBUhXNzD/qafTEx/EHsT+u0yGiEN24 Mn+oDUvFDhg5w== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4D013120AD0; Tue, 10 Jan 2023 15:03:16 -0500 (EST) From: Stefan Monnier To: Theodor Thornhill Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <87zgaqmbfj.fsf@thornhill.no> (Theodor Thornhill's message of "Tue, 10 Jan 2023 20:33:52 +0100") Message-ID: References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> <87zgaqmbfj.fsf@thornhill.no> Date: Tue, 10 Jan 2023 15:03:07 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.263 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: Eli Zaretskii , juri@linkov.net, casouri@gmail.com, 60623@debbugs.gnu.org, mardani29@yahoo.es 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 (---) >>> +* Moving by Sentences:: Commands to move over certain definitions in code. >> ^^^^^^^^^^^ >> I'd use "code units" or "units of code" here. > > Done. > >> >> Also, should we perhaps name the section "Moving by Statements"? or >> would it be too inaccurate? >> > > I'm not sure. I think that maybe because the commands involved, and the > ones that implicitly will be impacted, such as kill-sentence and friends > it is best to stay with Sentences? But a statement is the better term > wrt programming languages of course. I hold no strong opinions here. FWIW, while it may correspond to "statements" for some languages, it will correspond to other things in other languages (e.g. those that don't have a notion of "statement"), so it's probably best to stick to "sentence" here and then in the doc explain how that notion is expected to be mapped to notions that make sense for a given language. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 15:23:01 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 20:23:01 +0000 Received: from localhost ([127.0.0.1]:41208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFL9B-0002OT-Az for submit@debbugs.gnu.org; Tue, 10 Jan 2023 15:23:01 -0500 Received: from out-7.mta0.migadu.com ([91.218.175.7]:32394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFL99-0002OF-67 for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 15:23:00 -0500 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=thornhill.no; s=key1; t=1673382177; 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: in-reply-to:in-reply-to:references:references; bh=6UxEedGr/cVrvMawyC1sk/y4vFM3dz0zZVrJ93Km0+U=; b=HDn9KUt8Jh2EESkNqy8VCPcyMQvFOTzJB0gE8DNdQRlFAXY4B5dFxPRBJlqVRY3v5xgBu1 u1A9nvlgFVj47fJdup0Rqv4GUXe9/8mOfRwkFD2QL2mW1sq8zrB8fcqZPnolWZvEwqOmPJ EpTSgBPOvVc732bvRe+2qQPRcLP0nYrudhzX+c3jt4MdU8/L8wG/XvnweOXUPuXSzpSHER tnPHj/Ww+dy/cGO0ts5gVIei8km4z/4tvWWRq1MUfKIClL1WzXbpJTJ0ojUYmcKQ+nrFn/ o44TSzmSg/S43w7Gc+k2eWgcQ0cLH8PHtntdDMHruCmp1lw1C/YR3A6USIm8Rg== From: Theodor Thornhill To: Stefan Monnier Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> <87zgaqmbfj.fsf@thornhill.no> Date: Tue, 10 Jan 2023 21:22:56 +0100 Message-ID: <87wn5um95r.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: Eli Zaretskii , juri@linkov.net, casouri@gmail.com, 60623@debbugs.gnu.org, mardani29@yahoo.es 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 (-) Stefan Monnier writes: >>>> +* Moving by Sentences:: Commands to move over certain definitions in code. >>> ^^^^^^^^^^^ >>> I'd use "code units" or "units of code" here. >> >> Done. >> >>> >>> Also, should we perhaps name the section "Moving by Statements"? or >>> would it be too inaccurate? >>> >> >> I'm not sure. I think that maybe because the commands involved, and the >> ones that implicitly will be impacted, such as kill-sentence and friends >> it is best to stay with Sentences? But a statement is the better term >> wrt programming languages of course. I hold no strong opinions here. > > FWIW, while it may correspond to "statements" for some languages, it > will correspond to other things in other languages (e.g. those that > don't have a notion of "statement"), so it's probably best to stick to > "sentence" here and then in the doc explain how that notion is expected > to be mapped to notions that make sense for a given language. > > > Stefan Yeah, that makes sense. Theo From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 15:28:48 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 20:28:48 +0000 Received: from localhost ([127.0.0.1]:41223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFLEl-0002XM-Np for submit@debbugs.gnu.org; Tue, 10 Jan 2023 15:28:47 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:29315) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFLEk-0002XA-6N for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 15:28:46 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BC50A4425BF; Tue, 10 Jan 2023 15:28:40 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 386F94425BA; Tue, 10 Jan 2023 15:28:39 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1673382519; bh=pz9E6KbkFIqd4aJtLas9Ri1nsyNYqJvNf9i3MiO8mFk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=XfPaiP/X5c0B46teviklyN9u1C6GykUXikrYvVA5t/dx6zc2mpa9VxPHPIlk8oHmE 4SUhHp+I0v2MghGhTwTqE0miD/EFTF22xG5ZbnlQ3hvdJvEY/I50Q/milCXqsO8W2G O4i5GQyW3lpT+21TNgjyNihkMTSDnpN5B4jcJyF2P8TjqsrfTA9tefuH9KGyqCgY78 FfhrInwM37zSBkALzq5Oq894+d6pc8JUm1bPk0nNwRi3rlTzNeyrsk3Qm0ykRTuHIA MQXgfi7BUs2oaV9OvpFEYMXiS83JlbTN5ASsXK2bFvGb9qmtL6rH08jke/HVuDByH0 l971u+y68t6UQ== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EB9CB12046D; Tue, 10 Jan 2023 15:28:38 -0500 (EST) From: Stefan Monnier To: Theodor Thornhill Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <87wn5um95r.fsf@thornhill.no> (Theodor Thornhill's message of "Tue, 10 Jan 2023 21:22:56 +0100") Message-ID: References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> <87zgaqmbfj.fsf@thornhill.no> <87wn5um95r.fsf@thornhill.no> Date: Tue, 10 Jan 2023 15:28:38 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.245 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: Eli Zaretskii , juri@linkov.net, casouri@gmail.com, 60623@debbugs.gnu.org, mardani29@yahoo.es 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 (---) >>>>> +* Moving by Sentences:: Commands to move over certain definitions in code. [...] >> FWIW, while it may correspond to "statements" for some languages, it >> will correspond to other things in other languages (e.g. those that >> don't have a notion of "statement"), so it's probably best to stick to >> "sentence" here and then in the doc explain how that notion is expected >> to be mapped to notions that make sense for a given language. > Yeah, that makes sense. Another option is to use a mix, as in: Moving by Sentences:: Commands to move over statement-like code chunks. -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 16:05:21 2023 Received: (at 60623) by debbugs.gnu.org; 10 Jan 2023 21:05:21 +0000 Received: from localhost ([127.0.0.1]:41268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFLo8-0003Uo-SR for submit@debbugs.gnu.org; Tue, 10 Jan 2023 16:05:21 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:24624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFLo6-0003Ud-AM for 60623@debbugs.gnu.org; Tue, 10 Jan 2023 16:05:19 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AL3ufB002758; Tue, 10 Jan 2023 21:05:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=F3r/6COJLZa3B+qAU9/gvFYNnW2A3fN3egSpBa8rJ14=; b=04zCAOHi2gxLokAYmRWgqghZVCllQPI/8IjWOZZ+BlAjjVVHoGVfyuj/g5H6ZRJMDLdf HEBiISWNKSeEjeCVlcE0HHLU7bBVoP5p14q37ECLqof9Np4cg6Od6A3JCszgoS7kh1q7 yNLrSRJpdyZwMYzSAAwde3f31YufdNeMznrKVUCHrJvwgXj/Hc3Iy9EURvLEIeARrfR5 NbRMXm2lmLhOXYaJJwSYjwXApbCClh+5fsomO1l2TGDwTGZxCdYlvcMLtEPZlqdvG6Rm KJnE3VSte6WoIYr8cDP8nT4c2S0azAX0XYqT16TNSKaKmeg2tlDkDnwmVkvUJo1Mk8Ku RQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n14nf9rfc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:05:16 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30AKrmIg013757; Tue, 10 Jan 2023 21:05:15 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n1ff28fab-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:05:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZ/HIdBaYKrJ5RiItN8FpQrLhgi3P7VKrCC9E/9O6C8yglnPOIHIdB1GdaXm/JY9+8bN7W+GviOisgJWGgmxwDIKWWUbf3BR4RO4kYSakwzOfwi3lXxtu+ZiumoAxnbNqeH5UGaOiKjmC5ehpfk/cqDSI40cihp+tGs5idSPMvIfHXerJaAQsMMG717+/3/BImXqctR+0JIaheG/Jac66fV6uhuk4A++uruNZiRQzTnuiwvjreI5fsH+xvzom6SZf8KlfSGJxpmYeY20QG9ee1sC25kOYyQwRy3q75sdN8X2MiBfx7t1VIItcOGlePUUqvVATi15CnUmJWz+nC7wuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F3r/6COJLZa3B+qAU9/gvFYNnW2A3fN3egSpBa8rJ14=; b=hmI23VxOjDhBpJyA+HxYvAASe65y+CVuLR3D2QmEErWWeNYf/ukQyOO3c+P+O6bR3VjoBwNxvHlSrNPI1ueQfmx1ERXB21ut7rMFo0TQNlU6z1/5lZ1amGOnHwwweNCqBO285exrcgiShFkzNRxVtN2jLIjeu8HCtdRR9qJVZdmvOfp1Gytoi3fQJGH0nimGhzJ+x26Xu9twO5cxUL6Y3v0ZqlPMtp7DB2T2ETKET+/mJWTbvsAPWXfnvdeOY+RsIePf17DJwgO7HDbirWSBbx1CfWlzPL9VsaDSf58F+/rVRCyDlsRJ/lhVU13n5/gazfB9hxGPAk9nNWUM6kZ7jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F3r/6COJLZa3B+qAU9/gvFYNnW2A3fN3egSpBa8rJ14=; b=WdjOK+P7F/UJFdB/Iw8vKa///NrTdkyqsKnH0ZzjGIqkYbbEsjW5DvZAMKge/msZT+BXFLEO3KdjSsEGSFWm/8yG5/q6npp+x3wZAXUqHTLaZt4VZrA5zyc0I2PLN4q2D2o9movUh2D+geHBE2HYfXAIPJrcKLSc0hH6ezMUlSc= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SN4PR10MB5589.namprd10.prod.outlook.com (2603:10b6:806:204::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Tue, 10 Jan 2023 21:00:09 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29%7]) with mapi id 15.20.6002.010; Tue, 10 Jan 2023 21:00:09 +0000 From: Drew Adams To: Stefan Monnier , Theodor Thornhill Subject: RE: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Topic: [External] : bug#60623: 30.0.50; Add forward-sentence with tree sitter support Thread-Index: AQHZJS6/OzoLQD9Yk0GkgQmWX0LO2q6YIekA Date: Tue, 10 Jan 2023 21:00:09 +0000 Message-ID: References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> <87zgaqmbfj.fsf@thornhill.no> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|SN4PR10MB5589:EE_ x-ms-office365-filtering-correlation-id: 1e040e48-8b6b-4e80-77ed-08daf34da887 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: r3C71IECtlZ/nmaKBBcJNWSIWC0EW7OkJbAi3JdNgTnBBFs3iZu0zTC3rAhTcy45DgfkFDYSAw/j++EqoO+su37bZfNwbi0Im0svX7PfpXgtoEq3bcuPhLWCxOn2EwIfZUeW9EhxR0YvhGVoaBM0SDi7elMGFMFRitJkJhf4fQlp6sfWQnOtU1mRtI7ObiVe/BYbLKGNmAbwXVzAMBWr/cHsN1N5j1j4dRWy3jvuKVkvaHrcIIHpuAu79VTXIkpl+7MWYfNTreoUcq0ha8TQq/6aKQa8K3+K72VppkVDRbiQVRr7BDayR1Isl0yKhrdA+mCSKw5PXZiMsNydg1/dg+DEW5w8SFPSUSG7YcX++Bp9YeMEKu+zATZVJ+zJBPTvY7EU9Zxs027RS6HZv/BAoT2WZgGhdHLL678rc6pV3WWxI6U54OZDwJseYWDQ4TrPjLCHOXn/c4BWflsuaD9oPH2g6r2EP8rK5YHETpV1do/1/gqJj4p0ALOzO0sN4CA0kPwFKUhOtwq0yZZvJShWIlJIQ2zNiOF1An9UWSzeXwoRdVAGlFCVGXrI54DVr9/ryeWh4TJE5n1EFHZhppRm/NjcQD8d6j30IQp3Yy6hOb8b9lKGQLVjWvbPY8GvJfoxJA1+oEW2uOeKaQFGYdSi1O4MF8qxEI9WTXlVEr2jFryZAVx6EAdmiR7e5s8LYO7/7lRdnNtoDSnfWUFSOYb7zw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39860400002)(396003)(376002)(346002)(136003)(366004)(451199015)(44832011)(86362001)(8936002)(52536014)(33656002)(5660300002)(4744005)(7696005)(71200400001)(6506007)(478600001)(186003)(26005)(9686003)(38100700002)(122000001)(4326008)(41300700001)(55016003)(38070700005)(64756008)(66446008)(66476007)(76116006)(66556008)(8676002)(66946007)(316002)(296002)(110136005)(54906003)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1uzITj06ru+Mg7X7AsiuJmvIZlurDGsG6wPeoxnaRBwkg33D6///x8QYb1Zd?= =?us-ascii?Q?P5RnieZRmWirixY+k/MbFK935yHQm1Lv5roWkaLghczOJ5emtMmxYCN1YZlJ?= =?us-ascii?Q?JXr9qYcQFadkJ3JBhlgioUcg34VUVTieULqjnn3AYlQqUFWJRgRF3nX56c7k?= =?us-ascii?Q?X+9+tYNTrFDS8P75us75mgNdV6hg7svwg1N5VpDC5EoxeARErvjFbQPZlq1J?= =?us-ascii?Q?REkMj8DlUCzfddzMwZPmFE0Hi8NIXgRBz5SdauZqBtBQbPiWpivL2z6nE32G?= =?us-ascii?Q?70tMK4SLwweRmOlmpENuzKJcGwkjTM88vs2a4g6xR82Ea+yEGu0kJJqhWPzh?= =?us-ascii?Q?29av1vAuCdWuTWdFov41qF+42ma+x426Xco/78oEwkoL/M9U47Ca9FHW1tnl?= =?us-ascii?Q?vdynjeSfSilTbKgjSNKP3k6r2bpPq4Teb72zkLkziaqx8JUjv8z9Yytwaeip?= =?us-ascii?Q?oppFpeeQ6kbrmV00EzktET3eQmVVYl1PJtrOPMlzWtbTmbxL/krr+z257N5r?= =?us-ascii?Q?yz6KZUeqYYpI7mWvhgz4TwNsEuLZPp0f6XSJkrKtEpfjpGWXsN2gUFk2O6gY?= =?us-ascii?Q?o7tKYjHwfK5srYTsfW7MCs26p/nmZgRKag5ZBdQKLi8KeqnzAi+5UovcyuBy?= =?us-ascii?Q?i3BfguGpkm7IKxqi5HQ7UxXQkZEvHBrJLdJsZCawbdPnRlcn+IYdSAPizmFl?= =?us-ascii?Q?7NVY99QnufSFZnOc5EyHYIhU2ambvSPVjI+8/d7akKCKKtHIEY9unVI6t4B4?= =?us-ascii?Q?Oc+owOs7DYxRkY59xzapmLJIaszL7GnWaMOjLT8TbbWAvENlkZEokgieoy9Q?= =?us-ascii?Q?ztxeIITOPAQtGhW+nl3nT6D6IfSdFnJPJwDhoS+cwuGyDGlVMJogVuytTDyp?= =?us-ascii?Q?a/p2mDC1e3ZujzI7TzER3gApnNrHE0hWP6GxdzdL/yisfMwFDdVdSLaCiXiz?= =?us-ascii?Q?89eMDZZG00jTKJZVIcXT+H+TGffe82GJ7inGNqJhQCAMVJrSjGlCYWKZxqsV?= =?us-ascii?Q?MN54hUHloXRpcpdp4XEit52+z3lUlyjjaHbcmD+mEHga6jI0aP7FtdadqJwy?= =?us-ascii?Q?pMjzxEQeRygLGacM5dybLVDg0E6sniCYat5tvvQH/PKBZhDdDA+qx8eFstlD?= =?us-ascii?Q?xIPaFaYcpmm3DLFxSdqZAX6ySI4uKr45+OO+VxVI0a1e9jHpRsgg03jdDJfI?= =?us-ascii?Q?OPZ1WIvayeYE87EtKPIXModvm5I5vYP3by6Ghgf1jJ39t9fCKfcjcJn+esE+?= =?us-ascii?Q?AjbpLB9dlNaziHkNP81mXv7iyx8+g8E8RnEn+fZTKxj3qzzV1df9rTr+PQvV?= =?us-ascii?Q?ABC8OPjm9TdE4dR1yx3g6RCYdpwsh8k2Dwe1NkYDKc2TtHYd9DkdtrIkB2a0?= =?us-ascii?Q?3B9BInbsd79hE1awS+fQWnUJcv4xVe4G7i8TPL6MGxsafLwzm6fgC7km9ybR?= =?us-ascii?Q?VA3mG+Hdyet8MqlO7cY1zCl4xvYaRwLuHCjJzlpke6KsQ4uP/q4wPgihImCL?= =?us-ascii?Q?1zJqMMy8KQv2bGEEebMtKNtuOUwtctDaOwKP5CDZ5Ty15IqiQfEMqR+Lgdqh?= =?us-ascii?Q?eym9ZdyBTfJ3IpI3Pz++SUDYYB61z54WRSNo4FQ9?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?us-ascii?Q?0BqlAqSCtDtbEB2XhPw81n4mnC6fGG9p1+t4//7ra+//Sq0q2jvIWJYWMvWd?= =?us-ascii?Q?KReOsVLYSUNJwcEG52CXZYEa049Hx4Ez1MZY7b70qIQXqGqBXXMcSgIYHHdH?= =?us-ascii?Q?EICe6pUO/MT0r+Zilbw+ycbB5Ex9ggolfi7wVM8oJRELvQL8jZgVUvpA5/Xg?= =?us-ascii?Q?9DSd+Iz2mcxa9nRGfuoJBFekm8v6qBvBZzvT96iscIPU9lbaixSFT0+BnVTo?= =?us-ascii?Q?F/OioKYUGNWIg+3AfKAm1iclj0F4QHjIC7od7gw5DQ7F7JqlPtYIQDtN+e21?= =?us-ascii?Q?milr6App4RIJgDlPElhTR9QIcIOjxHjA3x2WSKcXxQOYRZf8UndfIOJTp4TL?= =?us-ascii?Q?AeZ4nZHyqSuavSAE3YNby6cp43MdCQP/Qx98qj7K2sQ4GS39kyOK1RqydrU4?= =?us-ascii?Q?7mHmF5fLrrHfzdCqx9rX5GQFbGE6ZeRFFwUAknNuvF1PZVX30ii1DSUsxxtS?= =?us-ascii?Q?5AvXCCOdTbChvWEncgbhj44JNwWPK9UZwO0XF+yq4ndaWnJmXElkPUzLbByR?= =?us-ascii?Q?xyrZU8oqZyxLuu4LtwQfFrImUMUcEeAs66GLpsd8fgxveoU5YN5WVzzBvB5v?= =?us-ascii?Q?dUVATCCgipLAGjpatsjeXy5uYq0kx5QcGT4wtVmKvM82jbDVZL+rfd8Ywrsr?= =?us-ascii?Q?kMYS2J9j7T+lBCiu6a9BWKxC7tLNwdEWOq7DCU1yD268FrFrctyFAAeO8dsA?= =?us-ascii?Q?A5S0r6f3CEPVeR4rJfXO50v6/RGz8jmW4XwP5hSlsBouoGFpfAw5tngEtNix?= =?us-ascii?Q?O0WMsI35QidVhdEwJ8o/O/c9FGszEk7DxZinY9nlMAsKJTYWD94NFz4wOJkm?= =?us-ascii?Q?ZWQb40Quh+P9iBL3SJ7wkaNVuXCIpsYY05jFkBYiUZsk5aWKxhgSFMgWv49T?= =?us-ascii?Q?cntB2KSsgKxy2P4dD+v36bGcw/aoVKd2OmCtHLCGVoLGjBoKskbWGAFB6Ra1?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e040e48-8b6b-4e80-77ed-08daf34da887 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2023 21:00:09.1203 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qySTeD0btJj1hESXhri3uOeE3swgUGHtnWemO7cPyTCBG4+cD+/Vc+sMFJBn6WwZNi0CZpuTYWHQMRyWoUwe8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5589 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-10_09,2023-01-10_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=572 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100140 X-Proofpoint-ORIG-GUID: VvJKYIUZHMz0fJ_zQ5bOWtY4K2eIRNhE X-Proofpoint-GUID: VvJKYIUZHMz0fJ_zQ5bOWtY4K2eIRNhE X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60623 Cc: Eli Zaretskii , "mardani29@yahoo.es" , "casouri@gmail.com" , "60623@debbugs.gnu.org" <60623@debbugs.gnu.org>, "juri@linkov.net" 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.7 (-) > > I'm not sure. I think that maybe because the commands involved, and th= e > > ones that implicitly will be impacted, such as kill-sentence and friend= s > > it is best to stay with Sentences? But a statement is the better term > > wrt programming languages of course. I hold no strong opinions here. >=20 > FWIW, while it may correspond to "statements" for some languages, it > will correspond to other things in other languages (e.g. those that > don't have a notion of "statement"), so it's probably best to stick to > "sentence" here and then in the doc explain how that notion is expected > to be mapped to notions that make sense for a given language. I'm not following this thread. But neither "statement" nor "sentence" sounds appropriate for what you're apparently talking about. Both would seem to be misleading. Maybe you should add a new THING type for just what you mean? From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 11 09:07:49 2023 Received: (at 60623) by debbugs.gnu.org; 11 Jan 2023 14:07:49 +0000 Received: from localhost ([127.0.0.1]:41989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFbld-000234-74 for submit@debbugs.gnu.org; Wed, 11 Jan 2023 09:07:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFbla-00022p-Ke for 60623@debbugs.gnu.org; Wed, 11 Jan 2023 09:07:48 -0500 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 1pFblR-0001uh-Sd; Wed, 11 Jan 2023 09:07:39 -0500 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=SCTPdM9zI0REhmBo+a6ZaLSn9wr/UxwZLb6iSHsRcRM=; b=Autn2oaPBj8b /uU27R66rINRkzARlo2QXt3qZfwShBAS841OTnpX5x3edStjN9Bt+FEJPIgpV7QFW9fmuz3AH7g2+ 9s9CaV4iwk480Ez2ItMK7W92ivRd0bd7EUSyhrlMdDM5s5E79A3YVhlARW8OSDyRSWdMCpdlVcd3S 9ANxUPGHwwcc1dGdcMx3R1NluEVtylLTfUPydeQhZrItvoqFDs50KU5LlfU7fsMLXuH/m+IZVb0WR LJkXhnmLngl3pHseE2/iUxBltrlA5REzS9KI7vjnfVDGPSc6sl1DtOOGKDdMBH6N5r88g9jkGPu+7 lYY8xfTFz/wgy2c5JnSTFw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFblR-00025R-46; Wed, 11 Jan 2023 09:07:37 -0500 Date: Wed, 11 Jan 2023 16:08:08 +0200 Message-Id: <83bkn5maev.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <87zgaqmbfj.fsf@thornhill.no> (message from Theodor Thornhill on Tue, 10 Jan 2023 20:33:52 +0100) Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> <87zgaqmbfj.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (---) > From: Theodor Thornhill > Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, > monnier@iro.umontreal.ca, juri@linkov.net > Date: Tue, 10 Jan 2023 20:33:52 +0100 > > How about this? LGTM, thanks. Just one gotcha: > --- a/doc/emacs/text.texi > +++ b/doc/emacs/text.texi > @@ -253,6 +253,11 @@ Sentences > of a sentence. Set the variable @code{sentence-end-without-period} to > @code{t} in such cases. > > + Even though the above mentioned sentence movement commands are based > +on human languages, other Emacs modes can set these command to get > +similar functionality (@pxref{Moving by Sentences,,, emacs, The > +extensible self-documenting text editor}). This is a cross-reference to the same manual, so you don't need the full 5-argument form of @pxref; just the node name will suffice. I think I can give you write access to the tree now, so please request access on the Savannah page (and create a user if you haven't already), and then you can install this yourself. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 11 09:41:57 2023 Received: (at 60623) by debbugs.gnu.org; 11 Jan 2023 14:41:57 +0000 Received: from localhost ([127.0.0.1]:42009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFcIf-0002ov-8u for submit@debbugs.gnu.org; Wed, 11 Jan 2023 09:41:57 -0500 Received: from out-55.mta0.migadu.com ([91.218.175.55]:25328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFcIa-0002oi-8R for 60623@debbugs.gnu.org; Wed, 11 Jan 2023 09:41:56 -0500 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=thornhill.no; s=key1; t=1673448110; 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: in-reply-to:in-reply-to:references:references; bh=qEhq4INSckLW3Ttd+X4TWtfps6q3F6c3kSTUy7XTEV4=; b=EoaUTinDSb1stGS0cMWGefqJ+T4VoEbyv8oBsxCBllDwr0aqOnj5E7jnvz9uSq4oqUPO47 rYdzvzLJX56xJ+VqmAqQSE68Y3MWk4CIWlwLM5gMTxpAeZ3pf/2gyzHSbuSyAhN4hXYx0A lAQojaMQBRCTfxKoJi/asmjU4b67yAR44bsz52zCSgjpVEx6unGCbuSVZsUsQkNzYBCh5x cBKdg7NQzMZ9M7L3iqi4oGliWG2YpUYr918xlQYBiQ/OcGo8qBNbBQCCqIotNt/zn6bI5o 7r8ZtN2neexkRz/vXfhCaJ35/L/RdkUEiAVgxnpwq+UISX84ZE9ef1psLnFsRQ== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: bug#60623: 30.0.50; Add forward-sentence with tree sitter support In-Reply-To: <83bkn5maev.fsf@gnu.org> References: <87o7ratva2.fsf@thornhill.no> <87bkn9tasb.fsf@thornhill.no> <83sfgloz5w.fsf@gnu.org> <875ydgu8dd.fsf@thornhill.no> <83fsckpznk.fsf@gnu.org> <87358ku6x2.fsf@thornhill.no> <837cxvq3x9.fsf@gnu.org> <87h6wyss3d.fsf@thornhill.no> <83358io2cd.fsf@gnu.org> <87zgaqmbfj.fsf@thornhill.no> <83bkn5maev.fsf@gnu.org> Date: Wed, 11 Jan 2023 15:41:48 +0100 Message-ID: <87o7r5nnf7.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60623 Cc: 60623@debbugs.gnu.org, juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es 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 (-) Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: mardani29@yahoo.es, 60623@debbugs.gnu.org, casouri@gmail.com, >> monnier@iro.umontreal.ca, juri@linkov.net >> Date: Tue, 10 Jan 2023 20:33:52 +0100 >> >> How about this? > > LGTM, thanks. Just one gotcha: > >> --- a/doc/emacs/text.texi >> +++ b/doc/emacs/text.texi >> @@ -253,6 +253,11 @@ Sentences >> of a sentence. Set the variable @code{sentence-end-without-period} to >> @code{t} in such cases. >> >> + Even though the above mentioned sentence movement commands are based >> +on human languages, other Emacs modes can set these command to get >> +similar functionality (@pxref{Moving by Sentences,,, emacs, The >> +extensible self-documenting text editor}). > > This is a cross-reference to the same manual, so you don't need the > full 5-argument form of @pxref; just the node name will suffice. Right, thanks! > > I think I can give you write access to the tree now, so please request > access on the Savannah page (and create a user if you haven't > already), and then you can install this yourself. Wow thanks! Request sent :-) Theo From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 11 16:09:58 2023 Received: (at control) by debbugs.gnu.org; 11 Jan 2023 21:09:58 +0000 Received: from localhost ([127.0.0.1]:44053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFiMA-00081p-0b for submit@debbugs.gnu.org; Wed, 11 Jan 2023 16:09:58 -0500 Received: from out-125.mta0.migadu.com ([91.218.175.125]:53116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFiM6-00081f-G5 for control@debbugs.gnu.org; Wed, 11 Jan 2023 16:09:56 -0500 Date: Wed, 11 Jan 2023 22:09:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1673471392; h=from:from:reply-to:subject:subject:date:date:to:to:cc; bh=3MVCsJMfkbk39wCKtRwoFijm1JYeXCZgaigz/QhHJAg=; b=dXPaZdf58K6Om0Cq33+/AZ3xOZbUKUnfEnU/wrnuTwJQGBB2B3Kq70LRyEJMRVAckkqtWv icoRnhzTAMLuALrpPRY4FFQbcOkPx3sxMqb0YrYOUX4WIDy7zbPSH4jfZhB/pij2rRfVi5 ztsIAIPiI7Wm9xbEq7qDLL3s8yewkGzmt2SnP1O5otBvyfPjvyDgmd+NIP29ef+q18PDXe WOH7+SnFv+Fb8U2FS4iafl9udlcxhp1OtXT1P+JZXBJ52ybQoRWmHYAA/6BOEivqWA1z+a wJyZqjlvLIdXdvg5d9U+j+RlroUms8YrHftN1OZdqjv14qRGgLlze+kUDM6siA== To: control@debbugs.gnu.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill Subject: control message for bug #60623 X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control 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" Message-Id: X-Spam-Score: -1.0 (-) close 60623 30.1 quit From unknown Sat Jun 21 10:40:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 Feb 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator