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: Plug treesit.el into other emacs constructs Date: Tue, 27 Dec 2022 19:12:10 -0500 Message-ID: References: <87wn6whete.fsf@thornhill.no> <4315EFC6-7AA8-4A48-845C-9CA8B88034D9@thornhill.no> <87bko521n0.fsf@thornhill.no> <87359h1ybt.fsf@thornhill.no> <871qp01msi.fsf@thornhill.no> <87v8mczb6b.fsf@thornhill.no> <87sfhgz9s8.fsf@thornhill.no> <87pmckz8p0.fsf@thornhill.no> <5DF07C4E-2CCD-4561-AFFB-D5D81D67BFE0@thornhill.no> <87o7rq7zf2.fsf@thornhill.no> <87wn6cwl1d.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="18976"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Yuan Fu , emacs-devel@gnu.org, eliz@gnu.org To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 28 01:13:04 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 1pAK47-0004jF-CV for ged-emacs-devel@m.gmane-mx.org; Wed, 28 Dec 2022 01:13:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAK3U-0002Io-Ug; Tue, 27 Dec 2022 19:12:26 -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 1pAK3R-0002Ig-S6 for emacs-devel@gnu.org; Tue, 27 Dec 2022 19:12:23 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAK3Q-0005Wt-5E; Tue, 27 Dec 2022 19:12:21 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 35798443064; Tue, 27 Dec 2022 19:12:15 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CE21444305C; Tue, 27 Dec 2022 19:12:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1672186333; bh=+m7IVdhuFbQ118riJP9U+GdfwdLMWxbfXdOBRIH7xWM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=gap6foitK+2pt9nIpdDZWmfmu9cN76rH1OzZ7ej4NkcUrsqWYzFQjbhtu/prQqy+n TP8vkKM1eTXOFlbm44A8LgbckAzz0Ip7hg9oqQdwzQqjKm/bCxVo5cICNRrpdMaHZ9 5WAIgcB5eyX7vTAzTvB+PnzHdK23mIIZ/5xZTiFqidh8MVbvS87NkqK081HkwpseDH lzRlDMZxTpziL8alWaHNn/90gsPtz8FrIcWOJUGDIDFR26b/bUMIb+eSWXeT8KQ4Ov nIsVAgl6noV/i+HWBXPBYY5sVhrqSv/m6bRpqgzyzxpDrRY6RAKwr/TjvsX5swfAAY eBQIPwTs9gLPA== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 837B6120C4F; Tue, 27 Dec 2022 19:12:13 -0500 (EST) In-Reply-To: <87wn6cwl1d.fsf@thornhill.no> (Theodor Thornhill's message of "Tue, 27 Dec 2022 23:15:26 +0100") 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 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:301993 Archived-At: > I think I managed to keep the semantics as they are now. What do you > think? Does this seem like a sane approach? Yes, LGTM. See nitpicks below. > +** New function 'treesit-trnspose-sexps' ^^ a > +(defvar-local transpose-sexps-function I'd keep it a plain `defvar`. > + "If non-nil, `transpose-sexps' delegates to this function. > + > +This function takes one argument ARG, a number as provided > +through running `transpose-sexps'. Its expected return value is > +a position pair, which is a cons (BEG . END), where BEG and END > +are buffer positions.") The ARG is not quite the same as the one passed to `transpose-sexps`. I think we should say something like ".. ARG, a number. Its expected return value is a pair of positions (BEG . END) delimiting the ARGth sibling". The rest looks great, thanks. Stefan