I have been wanting for a while to edit linear #sexpressions in
different contexts in #emacs. Some time ago I wrote a function using
the separedit #elisp library and it has been so useful
and so simple to write that I feel I have to share it!

(so (if (you (have to (edit (linear (s- (expressions (maybe this)))))))))

is interesting for you!

https://alejandrogallo.github.io/blog/posts/editing-linear-s-expressions/

#emacs #EmacsLisp #lisp #LispBlog #blog #ergonomics
#LiterateProgramming

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.

Ale's Ecke