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!
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.
(cider-repl-use-pretty-printing t)
(cider-print-fn 'fipp)namespace maps also break grep i use REPL pretty printing with zprint. zprint gives me control over things like highlighting, layout, filtering/summarization.
Given that cider-nrepl doesn't include zprint dependency itself, I assume you add it to dependencies manually? Is that OK for you?
totally. i add the zprint dep to the :cider alias in my ~/.clojure/deps.edn.
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
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)?
i think so
Nothing wrong with hating namespaced maps, their readability is terrible ๐
Namespaced maps are fine as long as you use short synethetic namespaces. But namespace as FQDN is indeed terrible.
Even with short keys, it takes away your ability to copy pieces of data.
I use fipp (mainly for historical reasons, that may not be that relevant as of today).
cider-repl-use-pretty-printing -> t
cider-print-fn -> pprintHi 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 nilthereโs a regex hardcoded in clojure-mode
you could hack on that
itโs not extensible, but it is very straightforward: https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el
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...])
https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L2402
Sorry I lost the line number
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)
)you can adjust the regexp to your needs of course
Oh thatโs clever