Fork me on GitHub
#emacs
<
2017-07-13
>
adamfrey16:07:39

I saw a screenshot of some clojure today that had a colored font-face for names in let forms: https://twitter.com/ra/status/885525643315859457 Does anyone have a set up like this in Emacs?

mattly17:07:52

it doesn't appear clojure-mode sets a face there

mattly17:07:02

is that atom?

mattly17:07:20

I'm curious how it handles destructuring

mattly17:07:04

clojure-mode only defines three faces:

mattly17:07:22

characters, keywords, and interop-methods

mattly17:07:39

...since I'm waiting for a build to finish and otherwise curious, I took a look at clojure-mode to see how the font-locking is done

mattly17:07:13

it seems we're kinda stuck with using regexes to bind to a font-lock

andrea.crotti18:07:59

in case it might help

caio18:07:31

I think cider does font locking as well

dpsutton18:07:45

yes cider will "intelligently" font lock what it knows is defined

dpsutton18:07:56

beyond just positional font lock

dpsutton18:07:50

it also knows about locals as well

dpsutton18:07:53

There are text properties here:
  cider-locals         ("m" "v" "k" "nested" "sub")

dpsutton18:07:10

so it won't font lock locals that shadow real values

onionpancakes18:07:54

Does anyone know if there is a way to indent Hiccup vectors? Like this?

[:div
   "foo"
   "bar"]
ATM, my emacs config is aligning them like regular vectors, like so.
[:div
 "foo"
 "bar"]

andrea.crotti20:07:21

first it would have to detect that they are Hiccup vectors

andrea.crotti20:07:28

which might not be so easy

dpsutton20:07:51

yeah i just put the second thing on the first line so that things line up with that

andrea.crotti20:07:16

mm to me it gets indented like that

[:div "foo"
 "bar"]

andrea.crotti20:07:18

if that's what you mean

dpsutton20:07:35

ah nevermind i was misremembering

dpsutton20:07:01

[:ul {:class "nav navbar-nav"}
     [:li (hiccup.element/link-to "/Conditions" "Conditions")]
     [:li (hiccup.element/link-to "/Rules" "Rules")]
     [:li (hiccup.element/link-to "/Rules/Differences" "Rules Matrix Diff")]
     [:li (hiccup.element/link-to "/TooLong" "Too Long")]
     [:li (hiccup.element/link-to "/Mappings" "Slang")]]

dpsutton20:07:06

that's what mine usually look like

dpsutton20:07:16

so kinda clear but not super clear

onionpancakes20:07:24

Yea, I guess its fine. leaving the indents as normal.

adamfrey21:07:38

this might not exist, but is there a way in Emacs to have a buffer that has the contents of both file1 and file2? So the contents are one after the other like

file1 text...
file1 text...
----
file2 text...
you can move your cursor throughout the buffer and if you save the buffer while your cursor is in the top section, file1 is saved, if it's in the bottom file2 is saved.