Code Monkey home page Code Monkey logo

Comments (10)

bcarrell avatar bcarrell commented on June 7, 2024

Additionally, for the quoted list stuff I mentioned above, it does the same thing for function literal syntax using # in Clojure. Its probably for any character in front of a form, not just quotes.

Edit -- actually, the behavior is slightly different for Clojure.

from lispy.

abo-abo avatar abo-abo commented on June 7, 2024

lispy-delete-backwards isn't working properly with braces {}. To reproduce, try lispy-delete-backwards from inside {-|-}. Throws Variable binding depth exceeds max-specpdl-size. If the braces are inside a list, e.g. (1 2 3 {-|-}), lispy-delete-backwards will actually blow away the entire containing list, too. It seems to be working properly for brackets and parens.

I'm guessing you're getting this error in Elisp, not in Clojure.
This is because Elisp has a different syntax for {} than for ().
You can test this by calling backward-list from:

(1 2 3 {}|)

So this bug will only surface in the case of {} in Elisp code, which
should not actually contain them. A way to overcome this is to
override the Elisp syntax table, but I don't know if a minor mode
should do this.

I'll look into fixing the other thing shortly.

from lispy.

bcarrell avatar bcarrell commented on June 7, 2024

Yes, you are right. It throws that for Elisp, not Clojure. I ran into it because I accidentally inserted a brace into Elisp and trying to delete it made me notice the issues above. Since this should be pretty rare, it should be ok as is.

from lispy.

bcarrell avatar bcarrell commented on June 7, 2024

For the quote behavior in Clojure, backward deletion does this --

(def quot-list '(|1 2 3)) --> (def quot-list ')|

from lispy.

abo-abo avatar abo-abo commented on June 7, 2024

This should happen now:

(def quot-list (1 2 3) '(|1 2 3))

->

(def quot-list (1 2 3)|)

from lispy.

abo-abo avatar abo-abo commented on June 7, 2024

I like this deletion behavior mostly for:

(progn
  (asdf)
  (|))

->

(progn
  (asdf)|)

This is the case when I wanted to write one more statement and
realized that it's not necessary. After this I'll probably want to be
in special, since I've finished writing something.

from lispy.

bcarrell avatar bcarrell commented on June 7, 2024

Cool, looks great. That behavior looks good to me.

from lispy.

abo-abo avatar abo-abo commented on June 7, 2024

If you have the time and the will, please
have a look at https://github.com/abo-abo/lispy/tree/deletion.
It re-defines deletion for many cases.
I plan to merge it into master after testing it for a few days. Suggestions and corrections are welcome.

from lispy.

bcarrell avatar bcarrell commented on June 7, 2024

I took a look at the code on the deletion branch, mostly at the test cases demonstrating the changes in behavior.

I think the behavior you're aiming for with your altered deletion logic is a step in the right direction and I think it makes much more intuitive sense.

I haven't tested the code, but I think you're going the right way with those changes. 👍

from lispy.

abo-abo avatar abo-abo commented on June 7, 2024

Most of the things discussed in this thread should be fixed now. If
new problems with deletions arise, just start a new issue to make
things less cluttered.

from lispy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.