From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock Date: Thu, 4 May 2023 00:58:22 +0300 Message-ID: References: <80fa402e-058b-4144-ab1e-a7dd6301bb4d@Spark> <83edo6u5kj.fsf@gnu.org> <9dfa3e61-87b9-04cf-21e6-6049ee3fed41@gutov.dev> <9b01dbad-e337-a23c-2341-2a0ca89792dc@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18958"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Cc: Eli Zaretskii , 63086-done@debbugs.gnu.org, casouri@gmail.com, Jimmy Wong To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 03 23:59:23 2023 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 1puKVO-0004iN-Ag for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 May 2023 23:59:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puKV7-0006CP-3k; Wed, 03 May 2023 17:59:05 -0400 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 1puKV5-0006Ar-L1 for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 17:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puKV5-0004Bg-D4 for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 17:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puKV4-0007hh-QZ for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 17:59:02 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2023 21:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 63086 X-GNU-PR-Package: emacs Mail-Followup-To: 63086@debbugs.gnu.org, dmitry@gutov.dev, wyuenho@gmail.com Original-Received: via spool by 63086-done@debbugs.gnu.org id=D63086.168315111729571 (code D ref 63086); Wed, 03 May 2023 21:59:02 +0000 Original-Received: (at 63086-done) by debbugs.gnu.org; 3 May 2023 21:58:37 +0000 Original-Received: from localhost ([127.0.0.1]:47862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puKUf-0007gt-Am for submit@debbugs.gnu.org; Wed, 03 May 2023 17:58:37 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:45711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puKUb-0007gc-TV for 63086-done@debbugs.gnu.org; Wed, 03 May 2023 17:58:35 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7F6F23200ACF; Wed, 3 May 2023 17:58:27 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 03 May 2023 17:58:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1683151107; x=1683237507; bh=+IRrRZH3WRX0kDnM5fLS+/oPgC5rqe/Bey4 9N6Xbs/w=; b=T0mCJOqip6amzHi4vJVs0RlcmE5/aWj9ukopGSog28tZqN5gQWv u60PZ1OjTM/YTpiwZsZhnNEJs8t42F2dwOj94AG7mufLnXLFFc3a0Qn7imkPT7HJ qLbjrFSxEyOLIhqef5b0qnsGWCR3VvCf9iK1e8hJzqgxUUYHikTo/zQ+QYl6qLa7 ypuc6XY6a4kMCw9rKdYqcdVgeIDU9RA/GpGtW38Q5q/Q2JkyxKhdVR0py9/0BX+T 1rBB3wtVY8+Px4OhYcCiPg6Eo4rvsD6ncOs53WGwtI9ht7HzDb7OAVVyeAlOmyWu /HyGQTgAx+n9Fpbt6Ie9XS1AZHLanCh/afg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1683151107; x=1683237507; bh=+IRrRZH3WRX0kDnM5fLS+/oPgC5rqe/Bey4 9N6Xbs/w=; b=GHwTEc8qtxWxpi2BedNzVliH2s2K66rS7kkKUAvwGZhGXPLwmLm Ee9csfbusjQkm/6YlE7nRT49n/q5hG2FP4upG6H7EYs4XAAelPrKg4Jh+Wx8c139 XofDgg97XKY0xK2W/4gereajpb9m1WkaBFY1r4hEydv4lxXuDV/iKKSint0H/2Lg LI8y0+ABVnoLPJj+HCJpYs0b6wQISMKg2dd0d3Yu2OB+Sow9a7Cesa184ypG0sMN PVS5/jB9ORgOIqg5HcDiOtvZzoKoZZPFbfJrc5mYOpwvblOMWAK7Mj1jQx4ol5Rp Nx1+olHk+ZH48DAk8eDFubRG0CohruiMevA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvledgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 May 2023 17:58:25 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:260991 Archived-At: On 02/05/2023 03:29, Randy Taylor wrote: > On Friday, April 28th, 2023 at 06:05, Dmitry Gutov wrote: >> On 28/04/2023 04:35, Randy Taylor wrote: >> >>> Maybe I'm missing something, but doesn't treesit-query-string with an empty string do nothing and always error, since it queries on whatever string you pass in? >> >> >> It would return nil, not error (querying an empty buffer). And we should >> be checking for error. >> >> This is the part that java-ts-mode--string-highlight-helper got right, BTW. > > Sorry, I was operating under false assumptions and somehow convinced myself that treesit-query-string with an empty string returning nil meant the query wasn't supported, hence me thinking it achieved nothing. I am no longer under such delusions :). > >> >> go-ts-mode--iota-query-supported-p in your patch relies on the condition >> that the file, at the time the mode is enabled, already contains at >> least one "iota" node. > > Good point. I've attached a patch using treesit-query-string with an empty string. It now works properly when iota is missing but inserted later. Thanks! I've pushed this to emacs-29, so the bug can be closed. Stylistically, I think I prefer the original way (with condition-case), but we'll have plenty of time to refine this on master later.