This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-21
Channels
- # announcements (2)
- # asami (8)
- # aws (4)
- # beginners (32)
- # calva (12)
- # cider (72)
- # clj-kondo (16)
- # clojure (11)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-serbia (2)
- # clojurescript (26)
- # data-oriented-programming (8)
- # datomic (9)
- # deps-new (17)
- # eastwood (4)
- # emacs (20)
- # fulcro (18)
- # funcool (1)
- # graalvm (8)
- # leiningen (12)
- # lsp (34)
- # malli (25)
- # meander (4)
- # membrane (4)
- # off-topic (153)
- # practicalli (1)
- # releases (2)
- # remote-jobs (3)
- # rewrite-clj (77)
- # ring (5)
- # shadow-cljs (108)
- # spacemacs (12)
- # tools-deps (9)
- # vscode (11)
- # xtdb (4)
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 ;
there isn't a way (without major hacking) although there's some desire from the clojure-emacs
people to implement it
As of today, IMO the right approach is to avoid ;
. Under Lisp/emacs tradition ;
has a very specific meaning, but 99% of Clojure developers don't know about it, or decide to disregard it.
So it is counterproductive to use it, given that emacs will apply assumptions that don't match our reality.
There was this discussion about this a while back: https://github.com/clojure-emacs/clojure-mode/issues/516
;;
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)
I was wondering why my editor kept changing my comments to two ;
As someone who came from Common Lisp, I'd instead rather implement the Emacs behavior in IntelliJ 😄
Cursive can be configured to use ;; for comments
> 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
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
For the "Big huge section commentary, like a file header or something", there's M-x comment-box
How do you make IntelliJ do that anyway? Asking for a friend who for some reason doesn't use Emacs 🙂
@U06DP0SAV In the IntelliJ settings: Editor->General->Smart Keys->Clojure->Use ;; for line comments
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.
@U45T93RA6 can you shed some light on the special meaning attached to ; ? Is there anything to it besides margin comment?
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