From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#73404: 30.0.50; [forward/kill/etc]-sexp commands do not behave as expected in tree-sitter modes Date: Tue, 07 Jan 2025 19:56:11 +0200 Organization: LINKOV.NET Message-ID: <87ldvmik3o.fsf@mail.linkov.net> References: <87plox4mtp.fsf@masteringemacs.org> <8634lmbs8t.fsf@gnu.org> <87bk0a1u0o.fsf@masteringemacs.org> <86tte2a5o3.fsf@gnu.org> <877cay1lqt.fsf@masteringemacs.org> <86frpma06f.fsf@gnu.org> <86ikueiekp.fsf@mail.linkov.net> <86ed4zg1cc.fsf@mail.linkov.net> <87zflac68t.fsf@mail.linkov.net> <87jzcdlxdp.fsf@mail.linkov.net> <87o71jocgs.fsf@mail.linkov.net> <87wmfwqg7e.fsf@mail.linkov.net> <8734i5fyv1.fsf@mail.linkov.net> <875xmumpzv.fsf@mail.linkov.net> <87pll190ui.fsf@mail.linkov.net> <674226FE-597C-44DC-823A-667E5C55397A@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28807"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Theodor Thornhill , Eli Zaretskii , Mickey Petersen , Stefan Monnier , 73404@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 07 18:58:23 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tVDqQ-0007HE-5f for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jan 2025 18:58:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVDq9-0002CJ-Eo; Tue, 07 Jan 2025 12:58:05 -0500 Original-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 1tVDq6-0002B6-LH for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 12:58:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVDq6-0005UY-Cf for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 12:58:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=qN/xohyGShuAoW007AuKEQ1Dv0RfJJOV54yVMZt1jXI=; b=OHz4EtdoSHTCdls0KYwaiGnWbVnijsyaHc7Wek66OK26Sc34NYX4/fGlMs04W3yH/bUWg0zZ2pur7YTPV8IfwLUZ2LIRM19VVJRxVmgE+TiFkl92Hzk9DD0ApzGI2eq9AH0oxMvjuspR8+UdUqlhbQEg2skQ8dcuND9LZNS1KfvkkHbJZok95U7QXt8mGyziEFmnv+43t+NhqmQuy0UeloFlhCxhEjmFDsxtj+ZunTcEtiEF8VdUf3neKi8y6XzXS17R9v9W42G8VZjAq8VpB45ThDNM544PIePY8go9dCfOHNrUdJqozPJ6pYxJSIRTsdC4n2KvptTolpM4qbRyiw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVDq5-0004Vl-Q0 for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 12:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2025 17:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73404 X-GNU-PR-Package: emacs Original-Received: via spool by 73404-submit@debbugs.gnu.org id=B73404.173627268117338 (code B ref 73404); Tue, 07 Jan 2025 17:58:01 +0000 Original-Received: (at 73404) by debbugs.gnu.org; 7 Jan 2025 17:58:01 +0000 Original-Received: from localhost ([127.0.0.1]:44505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVDq4-0004VV-UT for submit@debbugs.gnu.org; Tue, 07 Jan 2025 12:58:01 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:45935) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVDq4-0004VD-2C for 73404@debbugs.gnu.org; Tue, 07 Jan 2025 12:58:00 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C11541C0002; Tue, 7 Jan 2025 17:57:50 +0000 (UTC) In-Reply-To: <674226FE-597C-44DC-823A-667E5C55397A@gmail.com> (Yuan Fu's message of "Mon, 6 Jan 2025 00:56:41 -0800") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298735 Archived-At: >>> I admit that hard-coding one symbol is not the right thing to do. >>> So here is a better patch that checks for the symbol property: >> >> That's better but I still wonder why we don't want to use a keyword. > > My impression is that Elisp has “traditionally” used symbols? Like > symbol properties, text properties, thing-at-point, etc. Keywords are > really only seen in plists, face attributes, and keyword arguments, > all of which involves a key-value relationship. Indeed, symbols are more traditional. However, the problem arose only because 'treesit_traverse_validate_predicate' accepts a symbol for both a function and a thing, that caused ambiguity. So there are two variants to resolve this ambiguity: 1. use keywords like (setq-local treesit-thing-settings `((html (:sexp ,(regexp-opt '("element" "text" "attribute" "value"))) (:list ,(regexp-opt '("element""))) (:sentence "tag") (:text ,(regexp-opt '("comment" "text")))))) 2. use a symbol property like (put 'list 'treesit-thing t) You decide ;-)