Fork me on GitHub
#emacs
<
2022-08-13
>
jasonjckn01:08:01

any way to get >defn to highlight like defn?

Benjamin08:08:02

Also you can configure clj kondo to analyze it like defn

pppaul18:08:44

you can add highlights to any symbol in clojure mode, i actually has an issue for clojure-mode related to this, though cider should really be doing this for you.

jasonjckn18:08:05

i'm using lsp for highlighting not cider , i'll try the clojure mode way now let you know

pppaul18:08:05

i haven't used lsp, i assume it's not cider, are you using cider-jack-in ?

jasonjckn18:08:23

i am, but i disabled cider highlights

pppaul18:08:52

anyway, the issue i posted was something cider wasn't fixing, so it seems ok to add special font-locking in clojure mode when other modes fail

πŸ‘ 1
jasonjckn18:08:19

does cider have a highlight face for macros or how would you use cider to highlight >defn

pppaul18:08:30

cider does do some fontlocking. you can see it when you open a clj file and it changes font locking after jack-in or file-load C-c C-l

pppaul18:08:37

highlight doesn't sound like font-locking, though... i'm not sure what that is.... i'm not an expert with cider, i fix stuff when i run into problems, but i generally don't want to know much about cider

jasonjckn18:08:34

interestingly any macro named with prefix β€˜def’ is given function definition font locking by default

pppaul18:08:21

that's a bit of an idiom. i have a lot of defmacros πŸ™‚

Benjamin08:08:14

Looking for complement in the standard lib or dash , doesn't exist?

Benjamin08:08:42

I'ts 1 line with lexical binding t

(defun complement (f)
  "Returns the function that has the
opposite truthyness of `f`."
  (lambda (&rest r) (not (apply f r))))

chef_kiss 1