Fork me on GitHub
#emacs
<
2018-04-25
>
sophiago00:04:07

anyone here know elisp regex well? i'm trying to hack together some really simple yet idiosyncratic syntax highlighting

bozhidar03:04:39

@sophiago Try us. I don’t think anyone really knows elisps regexes well, but we can probably help you.

sophiago03:04:35

i learned the trick is mostly just to use two backslashes whenever you'd normally use one 😛

sophiago03:04:43

and no perl crap

sophiago03:04:02

(which kind of sucks, because i could really use lookahead/lookbehind)

sophiago03:04:13

i'm almost at what i think is the best i can get with just plain regex. really two issues remaining if you have idea. one is \\[\\w*\\|\\b*\\] will match for [foo whereas i'm trying to get [foo bar. i would think i could just use \\[[\\w*\\|\\b*]*\\] but no dice

sophiago03:04:21

oh, i just solved the other issue on my own. it's really just painstaking is all 😛

dpsutton03:04:57

Theres an API to help build them so you don't have to union them together

dpsutton03:04:25

Cider compiles it's font locking with these

sophiago03:04:50

do you mean (rx ...)?

dpsutton03:04:26

wow. what a doc string on that macro

sophiago03:04:31

ha. yeah, i was stubborn about that but now i'm realizing that last issue doesn't work because i can't use | both to delimit matches and matches inside matches

sophiago03:04:21

ugh, the closest i can get to matching on a vector is \\[\\w*\\|\\b*\\|\\w*\\]. this seems just a matter of repetition, not recursion, though. i still think it's weird elisp regex syntax throwing me off

richiardiandrea04:04:43

Also re-builder is very helpful

😮 4
sophiago04:04:10

to be fair, i'm momentarily taking a stubborn approach just as a regex refresher. for example, i've read about the pumping lemma a lot and think i only actually understood it today via the example of matching parens

Maris09:04:51

@bozhidar thank you so much !!!!

bozhidar11:04:48

You’re welcome!

bozhidar11:04:21

At some point I really want to make this more flexible, but for now it will do.

theeternalpulse18:04:13

Holy crap magit's merge rebase functionality was giving me the biggest heart attack until I realized what it's doing. I reallly need to read the docs lol

bozhidar19:04:44

We all should! 🙂

richiardiandrea20:04:56

What Emacs colore themes do you folks use? I think I need some change

tanzoniteblack20:04:18

https://github.com/kuanyui/moe-theme.el is what I've been using for the last few years

richiardiandrea20:04:18

Pretty cool thank you!

tanzoniteblack20:04:41

Has support for an amazingly large number of custom font faces from various modes

richiardiandrea20:04:38

But every now and then I need something new 😄

artenator23:04:33

Just upgraded to emacs 26.1 and I’m running into an issue with clj-refactor causing this error.. “Wrong type argument: stringp, package-desc” Anyone else run into this?