[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Brand new clojure support in Emacs ;-)
From: |
Philip Kaludercic |
Subject: |
Re: Brand new clojure support in Emacs ;-) |
Date: |
Wed, 30 Aug 2023 07:17:35 +0000 |
João Távora <joaotavora@gmail.com> writes:
> On Fri, Aug 25, 2023 at 8:26 AM Philip Kaludercic <philipk@posteo.net> wrote:
>>
>> Richard Stallman <rms@gnu.org> writes:
>>
>> > [[[ To any NSA and FBI agents reading my email: please consider ]]]
>> > [[[ whether defending the US Constitution against all enemies, ]]]
>> > [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>> >
>> > It appears that there is no clojure-mode command in core Emacs.
>> > There is a Clojure mode package, but it is in NonGNU ELPA.
>> >
>> > I think that language is important enough that, notwithstanding not
>> > really being similar to Lisp, we ought to have a major mode to support it.
>> > Would someone please work on that?
>>
>> I had brought this up in the recent clojure-ts-mode thread, that I
>> assume you are referring to. Sadly, I have no experience with the
>> language, but one idea might be to extend lisp-data-mode by whatever the
>
> I don't know if this counts as "work on that" but here's two interesting lines
> Elisp:
>
> (define-derived-mode clojure-mode lisp-data-mode "Clojure"
> "Barebones Clojure")
> (add-to-list 'auto-mode-alist '("\\.clj" . clojure-mode))
I suggested something along these lines up the thread, but didn't try it
out myself. Nice to see that the idea works. To avoid confusion, I
think it might be a good idea to not call this `clojure-mode' as well,
but something like "clojure-proto-mode" or "primitive-clojure-mode".
> Since it is a lisp dialect many things works here, like indentation,
> symbol recognition, parenthesis balancing, C-M navigation, and thing-at-point.
>
> And then there's LSP, right?
>
> So I installed clojure-lsp from here:
> https://aur.archlinux.org/packages/clojure-lsp-bin
>
> I created a hello world project with the "lein" tool, git init, found the
> src/helloworld/core.clj inside it, pressed M-x eglot and suddenly I had
> at-point-documentation, diagnostics, lots of refactorings, completion, etc.
>
> The thing that's a bit minimal is the syntax highlighting, but it's
> not that bad either IMHO. Eglot doesn't yet support LSP-mandated syntax
> highlighting. I have no idea what it takes to add TreeSitter support
> to such a bare-bones mode (but shouldn't it be really easy like mapping
> syntactic symbols to faces?)
>
> No idea if this works with the CIDER or SLIME backends for clojure.
> Don't ask me to test any more cause I've just uninstalled it all
> but any clojurians rading can have a go.
I would guess that anyone who is seriously interested in working with
Clojure, would install the proper major mode and the proper packages.
> João
- Re: Clojure mode, (continued)
- Re: Clojure mode, Richard Stallman, 2023/08/30
- Re: Clojure mode, Eli Zaretskii, 2023/08/31
- Re: Bundling ELPA packages with Emacs, Philip Kaludercic, 2023/08/31
- Re: Bundling ELPA packages with Emacs, Eli Zaretskii, 2023/08/31
- Re: Clojure mode, Richard Stallman, 2023/08/28
- Re: Clojure mode, Dmitry Gutov, 2023/08/28
- Re: Clojure mode, Danny Freeman, 2023/08/28
- Brand new clojure support in Emacs ;-), João Távora, 2023/08/29
- Re: Brand new clojure support in Emacs ;-),
Philip Kaludercic <=
- Re: Brand new clojure support in Emacs ;-), João Távora, 2023/08/30
- Re: Brand new clojure support in Emacs ;-), Philip Kaludercic, 2023/08/30
- Re: Brand new clojure support in Emacs ;-), João Távora, 2023/08/30
- Re: Brand new clojure support in Emacs ;-), Philip Kaludercic, 2023/08/31
- Re: Brand new clojure support in Emacs ;-), Kévin Le Gouguec, 2023/08/31
- Re: Brand new clojure support in Emacs ;-), Philip Kaludercic, 2023/08/31
- Re: Brand new clojure support in Emacs ;-), João Távora, 2023/08/31
- Re: Brand new clojure support in Emacs ;-), Richard Stallman, 2023/08/31
- Re: Brand new clojure support in Emacs ;-), Dmitry Gutov, 2023/08/31
- Re: New Package for NonGNU-ELPA: clojure-ts-mode, Stefan Kangas, 2023/08/24