-
Notifications
You must be signed in to change notification settings - Fork 23
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
Applying symex-tidy after at each symex-delete can be annoying #105
Comments
Could you give an example of these indentation practices and how the result of tidying deviates from it? I'm also curious how your team keeps the code formatted according to the convention -- do you use any built-in formatting functions like One idea is to make the tidying function user customizable ( Also, in the
|
Thank you for the quick feedback ! (a-function obj
arg1
arg2
arg3) But symex is tidying this as so (a-function obj
arg1
arg2
arg3) here is a fragment of our
;; Sensible - these are all just arbitrary values
(def values [haggis
:tatties
"neeps"])
;; Un-semantic - a `let`'s bindings and body have distinct meanings
(let
[something (foo)]
(println something)
;; Also un-semantic - `cook` is an action, distinct from its ingredients
(let [food (cook
haggis
tatties
neeps)]) |
Same. I think it makes sense that would be a toggleable behavior, which can be done per-project in a .dir-locals.el . I really like the notion of semantic alignment in a style guide manner. Is there a public version of this style guide anywhere? After seeing this I get the feeling my intuitive indenting is somewhat like this (whenever I go against the symex-tidy, which is rare) |
It is not yet published, but will be soon, I will remember to send a link to you ! |
Yeah, I like all these too, but it's worth noting that Symex mostly relies on Emacs / the relevant major mode to tell it how to indent. In the Some major modes allow you to customize the indenting behavior. For instance, with Racket Mode, you can modify the indent behavior by setting a property on the symbol to tell Emacs how to indent that form. I'm not too familiar with that way of doing it, but I use it in my config and it works well enough. According to the Racket Mode docs, this is also how If for some reason that's not possible, then another option could be to look at indentation packages for Emacs like Format All the Code -- I haven't tried it, but if this is usable and if it's customizable for what you need that would be good to know so we can define a proper integration with it and include it in the docs. If that doesn't work either, you could try implementing an indenting function yourself, for which Emacs docs on And of course, worst case, you would just disable the auto-indenting. So to summarize, it seems like we could address this by adding a |
Thank you a lot for this detailed answer ! |
I was wondering if applying
symex-tidy
automatically after eachsymex-delete
was really a good thing.Most of the time I like this behavior, but when working with teams that has specific indentation practices it can be annoying.
What do you think ?
The text was updated successfully, but these errors were encountered: