emacs

Consider also joining #cider, #lsp and #inf-clojure, where most of the tool-specific discussions are happening.
agilecreativity 2021-03-21T20:40:28.012800Z

I am trying to prevent the comment in Clojure code that starts with single ; to be align to the right. Is there a way to customize this in Emacs? e.g. I would love to get the same result when commenting the Clojure/Lisp code ;; and ;

dotemacs 2021-03-22T09:09:05.013200Z

There was this discussion about this a while back: https://github.com/clojure-emacs/clojure-mode/issues/516

practicalli-john 2021-03-22T09:30:07.017700Z

;; is the recommended line comment for Clojure, please consider using this style. Clojure aware editors typically have a key binding that comments using this style (or are easily configured to do so)

➕ 2
grazfather 2021-03-22T14:40:43.018Z

I was wondering why my editor kept changing my comments to two ;

cgore 2021-03-22T15:33:05.018200Z

As someone who came from Common Lisp, I'd instead rather implement the Emacs behavior in IntelliJ 😄

👍 1
cgore 2021-03-22T15:33:11.018400Z

So people comment correctly.

practicalli-john 2021-03-22T18:23:27.021100Z

Cursive can be configured to use ;; for comments

ag 2021-03-23T05:36:52.021800Z

> is the recommended line comment for Clojure There are line comments and "end of line comments". They are not the same thing. This SO post illustrates the difference perfectly: https://stackoverflow.com/a/8825101/116395

cgore 2021-03-23T13:59:29.023600Z

Also:

;;; Let's talk about this block of code below ...
(some-code 
   doing-things
   ...)
And also:
;;;; Big huge section commentary, like a file header or something

ag 2021-03-23T14:30:47.023800Z

For the "Big huge section commentary, like a file header or something", there's M-x comment-box

👍 1
cgore 2021-03-23T16:35:23.024100Z

How do you make IntelliJ do that anyway? Asking for a friend who for some reason doesn't use Emacs 🙂

practicalli-john 2021-03-23T17:26:13.024700Z

@cgore In the IntelliJ settings: Editor->General->Smart Keys->Clojure->Use ;; for line comments

agilecreativity 2021-03-23T22:33:35.028300Z

I always use ;; for my parts, but when I have to contribute to some project and they are using the ; then my Emacs always pushed it to the right and I hate to introduce these changes when possible.

cgore 2021-03-24T00:34:08.029900Z

I view it as a teaching moment :troll:

cgore 2021-03-24T00:34:37.030100Z

(Actually sadly no, I just silently tweak the comment blocks in my PR.)

Ben Sless 2021-04-07T11:11:00.062Z

@vemv can you shed some light on the special meaning attached to ; ? Is there anything to it besides margin comment?

vemv 2021-04-07T17:03:59.062700Z

Aside from https://github.com/bbatsov/clojure-style-guide/tree/d096eaadf63a7899cda1e5051597a99f1d51b10f#comments I'd add the observation (not hinted in that link?) that margin comments can span multiple lines. I'd say Emacs is optimized for multi-line margin comments, which is why a single-line margin comment can be auto-aligned in an odd-looking position (which in the context of a multi-line comment, would be less odd) Another good read: https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html

👍 2
cgore 2021-04-07T18:18:18.066Z

What that Emacs link says matches my memory from Common Lisp.

👍 1
cgore 2021-04-07T18:19:08.066300Z

I think that must have been a convention in Lisp for quite a few decades, no idea how long.