GNU bug report logs - #60128
30.0.50; [PATCH]: Add treesit-transpose-sexps

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Fri, 16 Dec 2022 20:05:01 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#60128: closed (30.0.50; [PATCH]: Add treesit-transpose-sexps)
Date: Tue, 05 Sep 2023 15:57:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 5 Sep 2023 08:56:25 -0700
with message-id <CADwFkmk+EevGutGg6nxZh+x0UrU5mBfnBXx5rp0ajh6ybuLvwg <at> mail.gmail.com>
and subject line Re: bug#60128: 30.0.50; [PATCH]: Add treesit-transpose-sexps
has caused the debbugs.gnu.org bug report #60128,
regarding 30.0.50; [PATCH]: Add treesit-transpose-sexps
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
60128: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60128
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH]: Add treesit-transpose-sexps
Date: Fri, 16 Dec 2022 21:04:28 +0100
[Message part 3 (text/plain, inline)]
Hi there!

Attached is a patch that enables transpose-sexps for tree-sitter enabled
modes.

This function will swap the node _before_ node-at-point with the node
_after_, so it would do something like:

       foo a|nd bar => bar and foo|

or
       foo(a + 4,| y + c * b, b, d); => foo(y + c * b, a + 4|, b, d);

It will _not_ try to swap things that are not siblings.  I think that
makes sense in the case of non-lisp languages, since _most_ places you
can transpose-sexps you will end up with broken code.

What do you think?  I think this makes sense on the master branch, not
release.

Theo

[0001-Add-treesit-transpose-sexps.patch (text/x-diff, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Stefan Kangas <stefankangas <at> gmail.com>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Yuan Fu <casouri <at> gmail.com>,
 60128-done <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#60128: 30.0.50; [PATCH]: Add treesit-transpose-sexps
Date: Tue, 5 Sep 2023 08:56:25 -0700
Theodor Thornhill <theo <at> thornhill.no> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Yuan Fu <casouri <at> gmail.com>
>>> Date: Sat, 7 Jan 2023 15:18:17 -0800
>>> Cc: Theodor Thornhill <theo <at> thornhill.no>,
>>>  60128 <at> debbugs.gnu.org,
>>>  monnier <at> iro.umontreal.ca
>>>
>>>
>>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>>
>>> >> From: Theodor Thornhill <theo <at> thornhill.no>
>>> >> Cc: casouri <at> gmail.com,  Stefan Monnier <monnier <at> iro.umontreal.ca>, eliz <at> gnu.org
>>> >> Date: Mon, 26 Dec 2022 21:53:57 +0100
>>> >>
>>> >> Eli, does this require a NEWS entry or more documentation?
>>> >
>>> > A NEWS entry should be enough.
>>>
>>> IIRC this is pushed to master right?
>>
>> I don't see it there, no.
>>
>> I asked to add a NEWS entry, and then it can be installed on master.
>>
>> Theo?
>
> Yeah, it was added in 7e98b8a0fa67f51784024fac3199d774dfa77192 and
> commited by Stefan :-)
>
> Should I add anything else?
>
> Theo

It seems like this bug is done, as the patch was committed.  Closing.


This bug report was last modified 1 year and 256 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.