cider

oyakushev 2025-02-26T10:58:20.814809Z

Hello folks! I am trying to get an estimate how many of you have cider-repl-use-pretty-printing enabled AND use a non-default pretty printer in cider-print-fn (Fipp, Puget, zprint). Choose โž• or โž– . Could you also please reply in the comments what is the main value for you of those third-party pretty printers? Thank you!

โž– 12
โž• 3
iarenaza 2025-03-03T08:34:36.128149Z

In my case, adding fipp as a dependency manually wouldn't be an issue. I'm already adding both cider-nrepl and nrepl manually through ~/.leiningen/profiles.clj.

๐Ÿ‘ 1
Akiz 2025-03-17T13:38:13.942539Z

(cider-repl-use-pretty-printing t)         
(cider-print-fn 'fipp)

2025-03-01T21:13:24.009009Z

namespace maps also break grep i use REPL pretty printing with zprint. zprint gives me control over things like highlighting, layout, filtering/summarization.

๐Ÿ‘ 1
oyakushev 2025-03-01T21:20:00.934409Z

Given that cider-nrepl doesn't include zprint dependency itself, I assume you add it to dependencies manually? Is that OK for you?

2025-03-01T21:21:20.372399Z

totally. i add the zprint dep to the :cider alias in my ~/.clojure/deps.edn.

๐Ÿ‘ 1
daveliepmann 2025-02-26T11:13:38.411189Z

I use Puget because of one specific old project on which the team decided they hated namespaced maps and it was necessary to make sure they never arose

oyakushev 2025-02-26T11:18:30.761429Z

Would it work for you if sometime in the future you needed to bring Puget dependency explicitly (but the rest of the integration would still work the same)?

daveliepmann 2025-02-26T11:37:23.325859Z

i think so

cjohansen 2025-02-26T13:39:55.565819Z

Nothing wrong with hating namespaced maps, their readability is terrible ๐Ÿ˜…

โ˜๏ธ 2
oyakushev 2025-02-26T13:41:31.641109Z

Namespaced maps are fine as long as you use short synethetic namespaces. But namespace as FQDN is indeed terrible.

โž• 1
cjohansen 2025-02-26T14:54:34.863969Z

Even with short keys, it takes away your ability to copy pieces of data.

iarenaza 2025-02-26T14:57:42.585609Z

I use fipp (mainly for historical reasons, that may not be that relevant as of today).

๐Ÿ™ 1
Harold 2025-02-26T16:41:45.792969Z

cider-repl-use-pretty-printing -> t

cider-print-fn -> pprint

โž• 2
๐Ÿ™ 1
Jeremy 2025-02-26T16:53:23.343749Z

Hi everyone, Is there an easy way to make C-M-x work with custom blocks as it does with comment? When there are lots of comment blocks in my notebook, I use a def to name them so I can jump around with imenu

(comment
  (def named-block)
  ...
  ,)
I'd like to use a custom macro for this:
(defmacro def-comment
  [block-name & args])
(def-comment named-block
  ...)
My issue is that I can evaluate specific forms within comment using C-M-x; however, inside def-comment, it evaluates everything to nil

Jeremy 2025-02-27T09:03:47.552389Z

Awesommee. Thanks @dpsutton @a13

dpsutton 2025-02-26T18:01:36.344539Z

thereโ€™s a regex hardcoded in clojure-mode

dpsutton 2025-02-26T18:01:38.788809Z

you could hack on that

dpsutton 2025-02-26T18:46:35.231819Z

itโ€™s not extensible, but it is very straightforward: https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el

๐Ÿ‘ 1
a13 2025-02-26T23:17:00.609029Z

you can add imenu support for (comment) blocks by adjusting imenu-generic-expression defcustom

imenu-generic-expression is a variable defined in 'imenu.el'.

Its value is ((nil clojure-match-next-def 0))
Local in buffer ktl/core.clj; global value is nil

List of definition matchers for creating an Imenu index.
Each element of this list should have the form

  (MENU-TITLE REGEXP INDEX [FUNCTION] [ARGUMENTS...])

dpsutton 2025-02-26T23:18:02.456509Z

Sorry I lost the line number

a13 2025-02-26T23:25:06.695839Z

so, for example, by using this

(setq-local imenu-generic-expression
            '((nil clojure-match-next-def 0)
              ("comment" "^(comment\\s-+:\\([^ )]+\\)\\s-*$" 1)))
I can jump to comment expressions like
(comment :foo
         (+ 1 2)
         )

(comment :bar
         (inc 123123)
         )

๐Ÿ˜ฎ 1
1
a13 2025-02-26T23:25:19.661439Z

you can adjust the regexp to your needs of course

dpsutton 2025-02-26T23:25:46.348099Z

Oh thatโ€™s clever

๐Ÿซก 1
a13 2025-02-26T23:27:46.187709Z