Fork me on GitHub
#emacs
<
2018-08-17
>
j0ni16:08:28

Anyone know how to make single ; comments align the same way as double ;; comments? I'm pretty sure this is built-in lisp mode behaviour, and tho I don't hate it, my co-workers who don't use emacs use single ; for regular, not end of line comments

bozhidar17:08:41

@j0ni That’s not possible. This behaviour is not configurable. In classic Lisp style ; is an inline comment and ;; is a line comment, therefore the different behaviour.

bozhidar17:08:09

This can be changed, of course, but it’d be pretty painful as we’ll have to override some of the lisp-mode code. Cursive recently added support to use ;; for line comments, which should alleviate problems like yours.

vemv21:08:53

I (unfortunately) found myself in the same situation as you, @j0ni. You can set setq comment-indent-function to something like the following: https://github.com/vemv/.emacs.d/blob/c31246010a7c8862515b365437d58a38cecf5d01/lib/non-submodules/vemv.paredit.el#L349 Battle-tested for a few weeks, finally works fine after some traumatic first iterations. I'd recommend just settling on ;; like good Clojure citizens 🙂

vemv21:08:52

(btw that code links to a SO question I made 5 years ago... my thinking has definitely changed since then ;p)