drym-org / symex.el

An intuitive way to edit Lisp symbolic expressions ("symexes") structurally in Emacs
Other
271 stars 22 forks source link

Fix broken overlay when focussing on first symex of a string #140

Closed pbaille closed 2 months ago

pbaille commented 2 months ago

Summary of Changes

When the point is on the first symex of a string, the symex-lisp--point-at-start-p returns nil instead of true. It brokes the overlay badly. By adding a clause to symex-lisp--point-at-start-p the issue seems to be fixed but maybe I miss something.

https://github.com/drym-org/symex.el/assets/4739483/9bf7f2dc-dbc8-40a7-9a7b-0cd169c9169d

Public Domain Dedication

(Why: The freely released, copyright-free work in this repository represents an investment in a better way of doing things called attribution-based economics. Attribution-based economics is based on the simple idea that we gain more by giving more, not by holding on to things that, truly, we could only create because we, in our turn, received from others. As it turns out, an economic system based on attribution -- where those who give more are more empowered -- is significantly more efficient than capitalism while also being stable and fair (unlike capitalism, on both counts), giving it transformative power to elevate the human condition and address the problems that face us today along with a host of others that have been intractable since the beginning. You can help make this a reality by releasing your work in the same way -- freely into the public domain in the simple hope of providing value. Learn more about attribution-based economics at drym.org, tell your friends, do your part.)

countvajhula commented 2 months ago

Note that currently, Symex considers "entering" a string to be undefined behavior, since a string is an atom i.e. a single symex that doesn't have any components. Generally speaking we don't provide any official support for navigating the words of a string using Symex mode, though, of course, we secretly can do that and it sometimes works for what we need. Technically this would be more the province of something like Rigpa's Word mode.

Anyway, having said all that, as we secretly do use Symex to navigate within a string upon occasion, I suppose there's no harm in merging this, necessarily. But please don't rely on this functionality as it's technically unsupported 😆