Fork me on GitHub
#cider
<
2017-09-18
>
oskarkv04:09:17

For some reason cider-nrepl can't dynamically font lock itself. But the code works for other projects...

oskarkv12:09:57

Hm, do I want that a-fn after def to be orange?

oskarkv12:09:14

Still no good solution for the ns/fn problem, i have just commeted out the clojure-mode code

oskarkv12:09:26

But I made a PR for the other part, about def:ed fns

dpsutton14:09:21

it looks like set/union is font lcoked here, right?

dpsutton14:09:29

doesn't that mean the ns/fn feature s working?

oskarkv14:09:38

As I said, I have just commented out those lines in my clojure-mode. But I don't know if just removing a feature in clojure-mode is a good idea.

oskarkv14:09:01

But, yeah, I guess it works in CIDER.

oskarkv14:09:23

But people use clojure-mode too, right?

oskarkv14:09:43

@dpsutton ^

dpsutton14:09:57

i think its a requirement for cider

dpsutton14:09:33

one thing, i haven't seen the clojure mode but the compiled font lock info is put in a cider var. perhaps you could inhibit the font locking when this var is present and not nil

oskarkv14:09:26

You mean disable clojure-mode's font locking?

dpsutton14:09:16

yes, when its apparent that cider has done more intelligent font-locking

oskarkv14:09:27

I think some font locking from clojure-mode is still useful. For docstrings, keywords, etc.

oskarkv14:09:35

But maybe that's not how it works πŸ˜›

dpsutton14:09:01

is it possible to inhibit it for just the functions?

dpsutton14:09:13

i haven't looked into this at all, just wondering

oskarkv14:09:24

I haven't look that much either πŸ˜›

oskarkv14:09:28

But it must be possible

oskarkv16:09:13

I almost have a solution. But I don't know how to refontify.

richiardiandrea16:09:17

This can be of help, I use these functions a lot when hacking on font lock: http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Basics.html

oskarkv16:09:58

They don't seem to do anything for me.

oskarkv16:09:38

I have not tried unfontify. But fontify, flush and ensure don't work...

oskarkv16:09:30

But killing the buffer and reopening works.

richiardiandrea16:09:17

Yeah that's the extreme solution πŸ˜‰

oskarkv16:09:00

Yeah, but I meant that my settings work. It's not really a solution. πŸ˜›

oskarkv17:09:00

Apparently turning the major mode off and on works.

oskarkv16:09:54

But the solution is bad...

oskarkv16:09:00

The more relaxed font-locking is so complected with the original.

oskarkv16:09:55

There's a very easy way to do it. But then the functions overwrite everything, even comments. πŸ˜›

oskarkv17:09:55

@dpsutton Hm, from what I can tell at this point, these are the alternatives for the ns/part problem. 1. Remove the feature in clojure-mode (it's not that important to font lock the namespace part, I'd say). 2. Set overwrite to t in the new font lock rules in CIDER, but then they overwrite even comments, so that's not so good. 3. Remove elements from clojure-font-lock-keywords in clojure-mode when cider-font-lock-dynamically is set (but then one loses colors if not jacked-in). 4. Remove elements from clojure-font-lock-keywords in clojure-mode if cider--dynamic-font-lock-keywords is set, but when? Maybe with some sort of hook? 5. Remove elements from clojure-font-lock-keywords in CIDER, but that would be horribly complected with clojure-mode. Worst idea ever. πŸ™‚ Even removing elements from clojure-font-lock-keywords in clojure-mode would be complecting two functions such that you gotta keep them in sync.

oskarkv17:09:35

Maybe there is something I'm not thinking of thought. πŸ˜›

malabarba21:09:17

@nooga looks like company-mode completion, it should work in Clojure buffers

nooga22:09:38

@malabarba somehow it doesn’t 😞 and I don’t know how to debug

nooga22:09:51

and repl has all the same minor modes as clojure buffer

malabarba22:09:46

Is the buffer loaded? (C-c C-k)

nooga08:09:35

It is. But I don’t think it matters. While I get doc based hints in minibuffer when typing function names, I don’t get this popup for auto completion.

nooga18:09:30

Ooooh…. it works under M-TAB in buffers and under TAB in the repl, lame me ;(

malabarba22:09:04

Ah. You'll need to bind TAB to one of the company-mode commands.