Post #3796305
2026-07-14 00:28 UTC
Honestly one of the many reasons why I like emacs so much is because of how malleable it is as a peice of software, like practically every weird setup is possible and it never feels like the editor is fighting hard against you
an example of something you can do is using Local Variables to evaluate lisp code upon entering a file (you get prompted to every time), for example, say I have a script but I need to set a specific env variable, I can just do the following
# Local Variables:
# eval: (setq compilation-environment '("SOME_VAR=some_value"))
# End:
print("doing something here")
# ...
it’s comment agnostic so u can put it in any typeof comments, now when visiting the file (or reverting the buffer if you want to apply it) you will be asked if you want to evaluate the code embedded in the comments. Which in this case allows you to specify a list of env vars to set when running compile
now lets say you don’t like how you always need to specify the compile command when u compile fo the first time in a session, well u can add another local variable like so
# -*- compilatio-command: "echo meowing; python this.py" -*-
print("some more code")
again u need to revert or revisit the file in order for it to apply but now using compile will auto insert this instead of the default make -k
it’s small niceties like this that are sprinkeled around emacs, it’s so nice ~v~
Replies (0)
No replies.