From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Comments to the new tree sitter implementation Date: Sun, 24 Apr 2022 16:27:06 -0400 Message-ID: References: <87y1zwq8sf.fsf@thornhill.no> <87v8uzqddz.fsf@thornhill.no> <87sfq3qbys.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4246"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel , Yuan Fu To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 24 22:28:39 2022 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 1niiqU-0000u3-M7 for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Apr 2022 22:28:38 +0200 Original-Received: from localhost ([::1]:59270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niiqT-0007mT-A2 for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Apr 2022 16:28:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niip7-0006QY-58 for emacs-devel@gnu.org; Sun, 24 Apr 2022 16:27:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niip4-0005Pv-DZ for emacs-devel@gnu.org; Sun, 24 Apr 2022 16:27:11 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1B88580626; Sun, 24 Apr 2022 16:27:09 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CE695803E6; Sun, 24 Apr 2022 16:27:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1650832027; bh=wGXWjSd2zaiTh9WQQJB293OuF6djUxY8T7jbiUlA+HQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=f0wy4+4G2H9SZ3kx1FBr0pyed/E7UJSTDXsWd58c9M0+hMI+aWJXxTJK0GRGBgE/L pCB9f5DoCYZnZUdoU1jcfWOvQ3f5bQFbSJdj/11WM2QHFITRe10J51yVYtcazieaix qC6vYB1BR61Pncl/V9m1DcbZoFnNrjolApY1NqqsS71kPQWRALJAVnupXdzQ41GoYF zaKBhmktraLZJNcK0JAYJHmb7a6TcoHr8RyuOLnzehRbSmg4cPxVYH54nHFpS5GyTW i1ph7++7vxxQVZd8YVVVZa0q4trfdpqb4xMplX+TJWL8uR9KYkITyw6XYbHkvIiVNs PQFFnG2Hy2oUQ== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8C17812068A; Sun, 24 Apr 2022 16:27:07 -0400 (EDT) In-Reply-To: <87sfq3qbys.fsf@thornhill.no> (Theodor Thornhill's message of "Sun, 24 Apr 2022 07:36:43 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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" Xref: news.gmane.io gmane.emacs.devel:288838 Archived-At: > the example I provided. But for the case where what you want is to find > the first parent, then move to beginning of indentation, I guess it's > fine? What I mean is that When this rule gives the right answer it's just by lucky accident (usually because of other conventions that the writer follows which causes the desired "anchor point" to be the node that's at the beginning of the line). A good indentation rule should try not to depend so arbitrarily on where line-feeds were inserted in the code. This is more important for code that's not (fully) written by humans. As a concrete example, the auto-fill-mode support in SMIE behaves worse with such rules (because it works by trying to insert a line-feed at different places on the line and choose the spot that most reduced indentation, and the above rule would lead to choosing poor places to insert the line-feeds because it basically assumes that the line-feeds were placed with care). Stefan