Convert energy into Hartree energy in emacs

There is a neat program in emacs which is called (GNU Emacs Calc Manual). Up to now in order to do energy conversion I always wrote small scripts in whatever language to do this. Now I discovered that you do these conversions also in emacs, you can do M-x calc, insert an algebraic form typing ' followed by 1.5 ev, which inputs 1.5 electron volt into the stack of the calculator....

May 18, 2023 · 1 min · 173 words · Alejandro Gallo

Editing linear s-expressions

I have been wanting to edit some s-expressions on single lines, like for instance to edit org-mode macros. This is a very short blog post but I just wanted to share this function that allows to edit a linearised s-expression quite trivially. For instance in a certain buffer I have a local variable like this # Local Variables: # eval: (add-hook 'after-save-hook (let ((name (buffer-name (current-buffer)))) (lambda () (message "Automatically committing %s" buffer-name) (ale/scratchpad/stage-and-commit))) nil t) # End: and of course this is extremely annoying to edit....

November 28, 2022 · 3 min · 493 words · Alejandro Gallo

Using p5js with org-mode in emacs

This week I wanted to do some tests with the cool project p5js and I wanted to use it from org-mode. Regrettably, there is no package I could find that allows to use p5js in an org-mode document. What’s worse however is that apparently you can’t have two sketches in a single html file. Of course, to be fair, maybe this is my assessment of the library. As far as I can tell p5js can only deal with a single...

October 14, 2022 · 4 min · 744 words · Alejandro Gallo