Fork me on GitHub
#emacs
<
2019-08-30
>
tianshu07:08:51

In clojure-mode, can I have entire qualified keyword(including the namespace part) using the clojure-keyword-face?

bozhidar09:08:04

No, that’s not configurable.

yuhan18:08:16

(it's Emacs, technically anything is configurable)

yuhan18:08:46

ie. search clojure-mode.el for where the face is defined (clojure-font-lock-keywords) and you can patch it however you like

tianshu19:08:20

@qythium Hi, I found the face definition, it is a const, if I redefine that, it seems not work:disappointed:

yuhan19:08:19

(add-to-list 'clojure-font-lock-keywords
             `(,(concat "\\(:\\{1,2\\}\\)\\(" clojure--sym-regexp "?\\)\\(/\\)\\(" clojure--sym-regexp "\\)")
               (0 'clojure-keyword-face)))

yuhan19:08:27

try this ^

yuhan19:08:36

which reminds me, I should clean up and submit that PR for multiple #_#_ forms I brought up a few weeks ago

yuhan19:08:02

I've made so many changes to my local version of clojure-mode that it's hard to separate out the relevant bits 😅

tianshu19:08:35

@qythium Great! it works, thank you very much!

bozhidar23:08:37

Yeah, obviously overrides are always an option, although I never recommend them unless you really know what you’re doing. 🙂

bozhidar23:08:11

(they tend to break when implementation internals change, not to mention that font-locking is dependent on the order in which regexps get matched there and you can get some weird result in certain situations)