emacs 2025-01-24

Anyone know of a tool that can format code like this? As if a sequence of maps were laid out in a grid, like a spreadsheet.

M-x align-regexp

☝️ 3

does M-x clojure-align help?

❓ Is there an easy way to get syntax highlighting for SQL strings embedded in Go code? I use edit-indirect.el to edit the SQL with sql-mode, but getting some syntax highlighting in the go-mode buffer would be nice.

You can also handle this with tree-sitter and go-ts-mode

1

Ooh, that sounds like it might be slightly easier πŸ™‚

Just published a new package to github: https://github.com/hkjels/mini-ontop.el/

πŸ‘ 1
❀️ 1

Interesting, I personally like the native behavior because I can always see the row I was in and it is not hidden by the mini-buffer.

Feels like a bugfix tbh πŸ™‚ Any feedback would by warmly welcome

This sounds like something I have suffered through for years without noticing, but I can't reproduce the "jumping" behavior you're talking about. In what instance does the Emacs window jump?

If you put point close to the mode-line and then issue M-x

😱 1

God damn, that is jumpy. Installing now.

πŸ‘ 1

Once you see it, it is hard to unsee it πŸ₯²

Yeah, I think I'm broken for life now

The default install command in the README complained about missing Git. This worked thought on E30.

(use-package mini-ontop
  :vc (:url ""
       :rev :newest)
  :config (mini-ontop-mode 1))

πŸ‘ 1

I'm using edit-indirect.el to edit SQL embedded in go files. That works well, except it's not setting the correct mode. I've tried adding a very naΓ―ve detection based on content:

(add-to-list 'magic-fallback-mode-alist
	     '(".*\\(?:SELECT\\|UPDATE\\|DELETE\\|ALTER\\)" . sql-mode) t)
But this does not work. From my reading of normal-mode no content-based detection is attempted if the buffer doesn't visit a file. Is there any way around that, and get content-based detection on temporary buffers?

take a look at this: https://github.com/Fanael/edit-indirect/pull/25/files Unfortunately, Fanael didn't accept the PR, but I think you can just use the function I provided as edit-indirect-guess-mode-function

πŸŽ‰ 1

Ok, I made it a separate package

Thanks, that works for me πŸ™‚

I'll set a reminder and check back once the emacs nix flake has had a chance to pick it up πŸ™‚

πŸ‘ 1