Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support universal arg for debugging in clojure and elisp #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

markgdawson
Copy link
Contributor

Summary of Changes

In elisp and clojure, the universal arg evaluates an expression in a debug mode. These are pretty handy and universal arg isn't currently used for these commands in symex. So I've added it here in the hope that we think it's a good idea.

Public Domain Dedication

  • In contributing, I relinquish any copyright claims on my contribution and freely release it into the public domain in the simple hope that it will provide value.

(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
Copy link
Collaborator

That does sound useful. One thing to consider though is that in Evil, typically the universal argument is expected to be a count. While Symex adopts this convention for many interfaces (like symex-evaluate, e.g. 3e evaluates three expressions), it doesn't at present adopt it universally. In principle, 3d in Symex is analogous to 3diw in Evil/Vim, which, I'm not sure if you're familiar with Vim, but this is a command to essentially delete 3 words, but which, unlike 3dw, can be run from within a word and doesn't require you to be at the beginning of the word (in practice though, because this command treats spaces as words, it undercounts what we consider to be words and isn't that useful!).

So it's not inconceivable that we'd want to support 3d to mean "evaluate the next 3 definitions, including the current one," and this usage would be in conflict with the use of the universal argument for debugging.

How about using a distinct keybinding for this, e.g. gd, which would correspond to a new symex-eval-for-debug?

@tommy-mor
Copy link
Collaborator

not related to symex, but what is "universal arg", i've never heard this term

@markgdawson
Copy link
Contributor Author

This explains it better then I could:
https://www.emacswiki.org/emacs/PrefixArgument#universal_argument

@markgdawson
Copy link
Contributor Author

i wasn't aware of that count and prefix used the same function argument. In that case the gd option sounds like a good way forward. I won't be able to take a look at this for a week or so at least, but I'll take a look at this when I get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants