From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: treesit-range-settings with ':local' : I missed something or it's a bug? Date: Tue, 30 Jan 2024 22:32:47 -0800 Message-ID: References: <6107698.MhkbZ0Pkbq@3-191.divsi.unimi.it> <10408919.nUPlyArG6x@fedora> <3273091.aeNJFYEL58@fedora> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32855"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Vincenzo Pupillo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 31 07:34:06 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rV4Ae-0008Mb-Ac for ged-emacs-devel@m.gmane-mx.org; Wed, 31 Jan 2024 07:34:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rV4A1-0000rO-Cn; Wed, 31 Jan 2024 01:33:25 -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 1rV49s-0000q7-P9 for emacs-devel@gnu.org; Wed, 31 Jan 2024 01:33:19 -0500 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rV49c-0006Nk-Uv for emacs-devel@gnu.org; Wed, 31 Jan 2024 01:33:08 -0500 Original-Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5d81b08d6f2so4112484a12.0 for ; Tue, 30 Jan 2024 22:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706682779; x=1707287579; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=O4zJBG9xG0B0wGrlyfJH/OBR5XLovsb3n22HHVX8ilg=; b=ahENJ5/eEwuXgPkoub2G93X9PyDDQH4JkaX2vAPvzA/hwwZQAim44y6+UqimQgpfun EakUaYTk+RYA0bcS1in5DhPFr6up6AH9NmW3NJCIIexJ0LdSabsZAr4wsC5dN34G6Okg EZrsAW8xTVHUme0vqBD7NfQwbyVckZ4wFE/CuEKqBBVs/5e7zJOEWs3SO3XNmB3f5d0F tJs4XPZsWxgisqhXfDwewgGMSfPmbI+J2wKVgOtr4yhX0yRZQqyU7RaDFh88Fe4vCNHr +kF3CePsLBl5+qT9yReKPjUe+//Wd6r2v8eLwq1JZRStuOYugec6kaYMXqBw86vgkQ5r 7vWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706682779; x=1707287579; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4zJBG9xG0B0wGrlyfJH/OBR5XLovsb3n22HHVX8ilg=; b=fLUtxrE7/jh1+rlTpFqRQ7w/yfT1gBvGfTnZRasoxZUNR4UG1Fldp4aTvQQG2ZZ5ys rJ2VkZy8JyE8Vi2CS3IkWyoBI1EHGRQ90WTpFf5zLeyj5ds+QUVaI2q1Pa9VjmCa8E35 3JRtjfBRjEVztx2tbOoLlBItBeCfqnL+rH2XXKKHNeJRJGRtOBjVtULsQ4Bwv4oHjhQK WejTRuhYip6X4GB4kcPXgSCzJVSKaEmTvFbyo1oGSwMVkBbPnaXr2Kjdefv7OG9iX6ln K9RBJ0iy1hsAtrKGFq1g1D1qiTryqsaEuEKB/iQvsSa/q3MX4uJxPjNfXHtaJKtT1lHf hUlw== X-Gm-Message-State: AOJu0YyEFfCdvtluWDcU/z0c5JJfL56BBl0mrb2MNva7J96oXh+A8WKb uoh+UfyQiDsnzk77NiMharhfve1tqeMghanSmeuSMXCk2jXclh6D X-Google-Smtp-Source: AGHT+IGhm0X8s1SyCD2HeFh0pAnMKeiQDqYkSxT8u59nzi4J5r/N57pMje+pdtTBbiADQNRQl0rS3w== X-Received: by 2002:a05:6a20:182a:b0:19c:9af5:a472 with SMTP id bk42-20020a056a20182a00b0019c9af5a472mr620572pzb.62.1706682778671; Tue, 30 Jan 2024 22:32:58 -0800 (PST) Original-Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id e17-20020aa79811000000b006da022d1bc8sm8970176pfl.25.2024.01.30.22.32.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2024 22:32:58 -0800 (PST) In-Reply-To: <3273091.aeNJFYEL58@fedora> X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=casouri@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315656 Archived-At: > On Jan 29, 2024, at 6:04 AM, Vincenzo Pupillo = wrote: >=20 > Hi Yuan, > In data domenica 28 gennaio 2024 08:09:02 CET, Yuan Fu ha scritto: >>=20 >> Actually, local parsers are not included in the return value of >> (treesit-parser-list). By default, treesit-parser-list returns all = the >> parsers whose tag is nil, but all the local parsers carry a tag of >> =E2=80=98embedded. To actually return all the parsers in the buffer = you need to use >> (treesit-parser-list nil nil t), ie, pass t to the TAG parameter. >>=20 >> I pulled your php-ts-mode_phpdoc.el and played around with it. I = found the >> root cause to be the call to >>=20 >> (treesit-parser-create =E2=80=98phpdoc) >>=20 >> In the major mode body. This creates a global phpdoc parser that = fontifies >> everything in doc face. >>=20 >> Removing that, plus the fix for #1 that I just pushed to master, = should fix >> the font-lock problem you are observing. > It seems to work, but just try to indent the entire buffer, and the = problem=20 > reappears. Before indenting:=20 > ((# ((1 . 271))) (# = ((161 .=20 > 223))) (# ((73 . 138))) = (# php> nil) (# ((517 . 621))) = (# phpdoc> ((672 . 810))) (# ((939 . 1032)))=20= > (# ((1157 . 1223)))) >=20 > after indenting the whole buffer: >=20 > ((# ((1 . 271))) (# = ((161 .=20 > 223))) (# ((73 . 138))) = (# php> nil) (# ((517 . 621))) = (# phpdoc> ((672 . 810))) (# ((939 . 1032)))=20= > (# ((1157 . 1223))) (#=20 > nil)) >=20 > As you can see the list of parsers has changed, and the latest one is: > (# nil) . >=20 > To reproduce the problem: > 1. open a php file (for e.g. the php file attached) > 2. Indent the entire buffer > 3. add a comment line inside a document block >=20 > The attached screenshot shows the result. That=E2=80=99s due to a bug in treesit--indent-1. I=E2=80=99ve pushed a = fix for it to master. It should solve your problem. BTW, you don=E2=80=99t= need to call flush-syntax-ppss anymore, we fixed that bug a while back. Yuan=