From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Huan Nguyen Newsgroups: gmane.emacs.devel Subject: Re: outline-mode treesitter support? Date: Tue, 19 Dec 2023 14:25:01 +0100 Message-ID: <5BF1102A-91FF-46DE-9602-5127BAFF124E@gmail.com> References: <1D18C79B-A9D5-4ECD-A95C-33159A28E2CD@gmail.com> <83edfiibzb.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) 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="15292"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 19 14:42:46 2023 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 1rFaMv-0003o1-PA for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Dec 2023 14:42:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFaM8-0006AI-1L; Tue, 19 Dec 2023 08:41:56 -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 1rFa67-0000aT-T9 for emacs-devel@gnu.org; Tue, 19 Dec 2023 08:25:24 -0500 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFa62-0004r4-7O; Tue, 19 Dec 2023 08:25:20 -0500 Original-Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-33668cdb982so2456935f8f.0; Tue, 19 Dec 2023 05:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702992313; x=1703597113; 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=MwlhqZbHVKO3QPCbOKZ9nO5gk+tEigZ4S2tlSc2Hmqk=; b=iemDKcyp4hlZXUmVGiBJmNsULmhVPdCtjqariy05tuEsspaSv8/ai4m8QQMsy9tZKA Kn57rZq3LVgXqZ3WHXccuZkiCsiSYLcQX4tH8ami2HsZeqq+ybjIWo4MM5xmIz9X3adJ FdecNDHCS8uFAWzKA5RiuAzwmkHb/DRs6WDnrcesxR2UO1aIqMJAqIffnhW9AeylLynt MW2KaZvMqgEOE9kfkee2qQo1hyG/VcSq6WV/r1QoiMaNYfkORKDMLO+Gexg7QUdHf8LH iPrjBPLGfOXYAbPj1xFsTSrcl1wImZ0ym5ItsKG1V5e3irLvRIroahSF+CH/B7oUWrMs pJGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702992313; x=1703597113; 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=MwlhqZbHVKO3QPCbOKZ9nO5gk+tEigZ4S2tlSc2Hmqk=; b=wymKUsFQMIvyoDH0FGNx2T/Bz0bYTsTfvKaRiE9aa5isliRsoHJdICr8K5kR5il0Rm lEN4YSkpqi6Fyv73YeQfvxhrDS1O0yirDnc6dFDThOtOcw4CwnjaWWiTaRsF4CJe/3/o HP1383tJg6X1s+AENr5qqZ9oPwFvMO5EACcyBLv86p/f4OavZ4uSLDgY5lplwusuUZaY ItRTcjgrd0u8XcsrebFRDhJhWjO/C5pZbA5UfdR4atzWUycheXR+A0h/ni4KOXjBppqI a2wwmOZ0CMXL+FD5tktDYDs7ngHbBPbEMxR+nks/SgwhvqZaQbPa8Tf9g2A2NrE2kcC/ heWg== X-Gm-Message-State: AOJu0Yxz0CQy336XIg2VZT49Ooa5civjmRn9eSFfeCTXr8Zq0/0gvESj H6RoN71enp/wGbxWqRB+R5mvmS19Ccs= X-Google-Smtp-Source: AGHT+IGI7Erg9eM9wk8q7YDhweNRdzQUJ+xYpeWk4bm4hDACLGCpdykGw/DiBKvMHrQsHjlE4f45Dw== X-Received: by 2002:adf:ee0e:0:b0:336:5b42:6a3c with SMTP id y14-20020adfee0e000000b003365b426a3cmr3396445wrn.60.1702992312493; Tue, 19 Dec 2023 05:25:12 -0800 (PST) Original-Received: from smtpclient.apple (eduroam001.rz.htwg-konstanz.de. [141.37.128.1]) by smtp.gmail.com with ESMTPSA id d15-20020adff2cf000000b0033664b4df9esm6910107wrp.60.2023.12.19.05.25.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2023 05:25:12 -0800 (PST) In-Reply-To: <83edfiibzb.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.300.61.1.2) Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=nguyenthieuhuan@gmail.com; helo=mail-wr1-x435.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-Mailman-Approved-At: Tue, 19 Dec 2023 08:41:55 -0500 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:314007 Archived-At: > On Dec 19, 2023, at 14:00, Eli Zaretskii wrote: >=20 >> From: Huan Nguyen >> Date: Tue, 19 Dec 2023 12:43:40 +0100 >>=20 >> Are there any plans on making outline-mode take tree sitter nodes = instead of regex? >=20 > Is there a tree-sitter grammar available somewhere for Outline mode? I am not aware of any. I am writing a treesitter based mode for a markup = language. It has been manageable to write increase/decrease heading levels and = move headings up/down yourself. For folding I am was looking how I could = do it but I only found outline-mode. >=20 >> Is it possible to add that functionality or would a new mode be = necessary. >=20 > It depends on how well the existing mode's features map into a > tree-sitter based one. The features should be the same but they should work on treesitter nodes = instead of regexp. The advantage is that it will be more =E2=80=9Ccorrect=E2= =80=9D. Take the example nodes:=20 (heading1 (content ...))=20 You may wish to hide the child content. (heading1=20 (content (heading2 (content =E2=80=A6)))) You may wish to promote heading2, removing it from its parent heading. The problem I see in that is that not all treesitter grammars have this = tree like structure.=20 Doing it yourself is not that hard as I said before, so it is not a high = priority for me.=