cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
ghosttoaster 2021-02-13T02:15:24.259600Z

I've bumped it up to 1000 now, but according to my settings is was already set to 100. But I was getting more like 8.

motform 2021-02-13T09:59:23.259700Z

How would one go about to use an add-tap to add the cider repl to the tap set? I find this amazingly handy in reveal, but I don't always have it running.

bozhidar 2021-02-13T12:34:52.260400Z

@cdimara Just saw your message on discord and responded there. 🙂 Basically that's characters, not lines. For everyone else - https://docs.cider.mx/cider/1.0/repl/configuration.html#auto-trimming-the-repl-buffer

anonimitoraf 2021-02-13T12:46:55.261Z

I have this in my emacs config:

;; Highlight particular macros similar to built-in stuff
;; For example, highlight ghostwheel's `>defn' similar
;; the same way as built-in `defn'
(add-hook 'clojure-mode-hook
          '(lambda ()
             ;; Set some new syntax-highlighting rules.
             (font-lock-add-keywords nil
                                     ;; So many escape codes! But we're really just saying:
                                     ;; Match the '(' character.
                                     ;; Match and group the string '>defn'.
                                     ;; Match some whitespace. \\s-+
                                     ;; Match and group some word characters. \\w+
                                     '(("(\\(>defn\\)\\s-+\\(\\w+\\)"
                                        ;; The first regexp group is a keyword.
                                        (1 font-lock-keyword-face)
                                        ;; The second regexp group is a name.
                                        (2 font-lock-function-name-face))))))

anonimitoraf 2021-02-13T12:47:32.261500Z

I can't get the docstring highlight (yet) though

bozhidar 2021-02-13T12:59:58.261800Z

The docstring parsing is in clojure-mode's clojure-font-lock-syntactic-face-function.

bozhidar 2021-02-13T13:00:35.262200Z

It's not just static rules for font-locking.

anonimitoraf 2021-02-13T13:01:10.262700Z

Right, so is there a way to override the rules so >defn is treated the same as defn for example?

bozhidar 2021-02-13T13:20:49.263100Z

I guess something like (put '>defn 'clojure-doc-string-elt 2) will do the trick.

anonimitoraf 2021-02-13T13:27:57.263300Z

Ah, seems to work. Thanks (indentation is off, but that's a separate issue)

anonimitoraf 2021-02-13T13:34:39.264Z

Is there any way to extend the parser without this hacky method?

bozhidar 2021-02-13T14:11:42.264300Z

Not really.

bozhidar 2021-02-13T14:12:07.264800Z

It relies on this metadata and somehow you need to supply it to it.

bozhidar 2021-02-13T14:12:30.265300Z

clojure-mode simply hardcodes the data for the common macros, that's why people don't notice this.

bozhidar 2021-02-13T14:15:35.265800Z

For the indent try something like (put-clojure-indent '>defn :defn)