Fork me on GitHub
#emacs
<
2023-02-03
>
xificurC13:02:39

Given code that has nested p/server and p/client calls as below, I'd like to apply a different style to the code (e.g. change background color. So the innermost p/server code is blue, the p/client around it, not including the inner p/server is red, etc. Any guidance what functions to look for?

upvote 2
Benjamin C00:02:50

Way out of my zone of expertise, but maybe fontlock or overlay or treesitter? (Sorry to be so vague, I'm shooting in the dark here).

xificurC11:02:58

Thanks. I found this package, which will serve as a good starting point https://github.com/istib/rainbow-blocks

2
motform11:02:58

Not strictly the same thing, but this twitter thread might be some inspo: https://twitter.com/redblobgames/status/1535372843222896642

dev-hartmann23:02:54

for the people using consult: I’m having a strange issue with my setup on an m1 mac (i installed emacs using brew install emacs-mac). consult-line and consult-imenu return Invalid function: 1 . has any of you experienced that?

ag23:02:54

Have you updated the packages recently?

ag23:02:43

there were a couple of changes that broke my previous setup

dev-hartmann23:02:57

yes, it was sa fresh install today

ag23:02:33

namely, embark-define-keymap got deprecated. I'm not sure if you're using Embark, but many people who use Consult do. another thing is that the convention for consult-preview-key has changed.

ag23:02:22

i.e. if you had before -preview-key (kbd "C-SPC"), you have to do simply: -preview-key "C-SPC" now

dev-hartmann23:02:03

I do use embark. but don’t use preview-key

ag23:02:37

consult-preview-key is a consult var

dev-hartmann23:02:39

interestingly helpful command shows consult-line’s doc just fine.

dev-hartmann23:02:12

i just looked it up, it’s set to any

ag23:02:19

the reason I'm telling you to grep for preview key (and not consult-preview-key) is because you may have it like this:

(consult-customize
   consult-ripgrep consult-git-grep consult-grep ...
   :preview-key (kbd "some key"))

ag23:02:07

so change it to simply :preview-key "some key"

César Olea23:02:40

This exact thing happened to me.

ag23:02:01

and lookup for embark-define-keymap, that fn is now deprecated

ag23:02:56

also, embark-cycle-key - the same story. I used to have it as embark-cycle-key (kbd "C;") - now it has to be simplified

dev-hartmann23:02:30

hm, don’t have :preview-key set and don’t use embark-define-keymap

ag23:02:11

well something maybe does. You're not using Spacemacs/Doom/etc.?

dev-hartmann23:02:22

i have just bound embark-act

dev-hartmann23:02:41

(use-package embark
  :bind (("C-S-a" . embark-act)
         :map minibuffer-local-map
         ("C-d" . embark-act))
  :config
  ;; Show Embark actions via which-key
  (setq embark-action-indicator
        (lambda (map)
          (which-key--show-keymap "Embark" map nil nil 'no-paging)
          #'which-key--hide-popup-ignore-command)
        embark-become-indicator embark-action-indicator))

ag23:02:30

I dunno then, try emacs --debug-init

dev-hartmann23:02:58

thanks @U0G75ARHC, really strange

dev-hartmann23:02:11

all other consult-fns work

dev-hartmann23:02:30

consult-line-multi works fine too

ag00:02:36

let me try updating. Maybe there are some new changes. I am stupid. I don't pin my versions, I just pull the latest vertico/consult/embark from GitHub. Don't be like me. It's a miserable way of computing... lol

dev-hartmann00:02:53

haha, I’m the same 🙂

dev-hartmann00:02:14

my work machine doesn’t have the issue… it’s just the new one here roll

dev-hartmann00:02:54

maybe I should start doing that…. started using straight to have reproducible builds. then I go about NOT doing straight-freeze-versions

ag00:02:02

Updated, restarted. Things look good for me. The commit that gave me a headache was this one: https://github.com/minad/consult/commit/9f2ea67ab87f615599a32707c84b4d4287df84d4

ag00:02:19

But also embark-define-keymap annoyed me for a bit. This is actually an interesting anecdote. So they've deprecated that macro. You have to use defvar-keymap now. And that would be fine. But I'm using Doom. Even though I almost don't use "official" Doom modules, I have "vertico" module enabled. Because it's really good and until now, it served me well. But as I said, I'm stupid. Doom pins the packages in the module. But I deliberately unpined them. So I thought, "well, I guess maybe it's time to write my own, custom completion module for vertico/consult/embark". Which I have, but it does stuff on top of the Doom's module. And I don't even care specifically about that bit in the module that uses embark-define-keymap. So then I scratched my head for a few seconds and just added this at the top of my init:

(defmacro embark-define-keymap (&rest args)
  "Temp. fix for:
"
  `())

dev-hartmann00:02:51

Thx for checking, must be some kind of other issue

ag00:02:47

maybe something to do with .elc files?

dev-hartmann00:02:15

Hm, that could be a thing