Fork me on GitHub
#emacs
<
2022-11-23
>
Benjamin C00:11:14

Is there a simple way to alter the contents being saved from a buffer to a file without changing the buffer itself? Backstory on this is that I really like using https://github.com/AbhinavOmprakash/snitch as I am developing, but I'd like to automatically replace all the defn*s and *lets with defn s and let s respectively.

vemv00:11:05

normally (unless disabling auto-revert-mode, which seems generally undesirable if not dangerous for data loss) almost as soon as you would persist to disk, emacs would pick up those changes from disk and apply them to the buffer again. i.e. how emacs distinguish between "normal" changes from outside and the "hacked" changes? ref https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Revert.html

Benjamin C00:11:46

Ah, okay. Probably makes sense to just add it before certain commands then, most notably magit-commit :P

vemv01:11:10

there are many approaches to debugging of course. A quick one that would come to mind is a custom nrepl middleware such that for each Var that is defined, an add-watch is performed capturing args and ret. Or automatically walkthe forms and Tufte them. The sky is the limit :)

1
George02:11:15

hi, I'm wondering if I have my org-mode Clojure highlighting in source blocks set up correctly. It seems to work but doesn't highlight all the core forms, so for example it highlights def and fn but not coll? -- right now I'm requiring ob-clojure, have fontify-natively set to true and insert the source block as #+begin_src clojure ... . Does it seem like I'm missing anything?

jumar03:11:17

What's the correct way to enable multiple flycheck checks in the same file? I have my own checker that I would like to enable for several major modes without having to flycheck-select-checker

(flycheck-define-checker my-checker
    "A checker"
    :command ("my-checker" "check" source)
    :error-patterns
    ()
    :modes (clojure-mode js-mode java-mode))
This sort of works but I need to flycheck-select-checker manually and only one checker is active at the time. What I want, is have them active both/all - for example both clj-kondo and my-checker for clojure-mode. I tried this but it doesn't seem to work: https://emacs.stackexchange.com/questions/13392/using-multiple-flycheck-syntax-checkers-in-web-mode
(with-eval-after-load 'flycheck
    (flycheck-add-mode 'codescene 'clojure-mode)
    (flycheck-add-mode 'codescene 'java-mode)
    (flycheck-add-mode 'codescene 'js-mode)
    )

borkdude09:11:51

flycheck has something called chains for this. how to use this you can find in the flycheck-clj-kondo README

oly08:11:17

Just started watching this video https://youtu.be/AYKIR1oh62Y?t=794 about repl development, noticed it has number of references a function has curious what I need to make that work ? anyone able to point me in the right direction ?

Hermann08:11:26

That is lsp-mode, requires the proper clojure-lsp-server (emacs will offer to install the server when you activate the mode)

oly08:11:52

ah I see I always thought clojure lsp was an alternative to cider

oly09:11:36

as you get a lot of functionality from cider like auto complete and jump to definition, so felt like they would conflict

oly09:11:31

I will add it in and give it a try, thanks for the tip @U03KLA1A00K

ericdallo11:11:31

@UU67HFS2X https://clojure-lsp.io/features/#code-lenses-showing-symbol-references the code lens feature you are looking for https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/ a post explaining about lsp and using with cider, for more info check #CPABC1H61

Drew Verlee19:11:26

does anyone have this linter working https://github.com/aws-cloudformation/cfn-lint if so, can you share your install steps?

Drew Verlee19:11:17

i'm at that point where i'm just going to use vscode when i can't get something working in an hour. Like, installing packages that i'm not customizing shouldn't require special attention. In vs code you just install the extension.

Drew Verlee19:11:42

ok after some random looking around, fly check tells me this:

Syntax checker in buffer fix-etl-centriq-cluster.yaml in yaml-mode:

  cfn-lint
    - major mode: `yaml-mode' not supported
    - may enable: yes
    - executable: Found at /home/linuxbrew/.linuxbrew/bin/cfn-lint

Flycheck cannot use this syntax checker for this buffer.

Flycheck Mode is enabled. Use SPC u SPC e d to enable disabled checkers.

--------------------

Flycheck version: 33snapshot (package: 20221104.549)
Emacs version:    28.2
System:           x86_64-pc-linux-gnu
Window system:    x

Drew Verlee20:11:38

I can enable cfn mode, so yes? It doesn't seem to do anything

Drew Verlee20:11:57

Does it work for you?

Drew Verlee22:11:05

I was able to get the linting after enabling cfn-mode then enabling flycheck-mode i'm not sure why i have to take those steps.

oly10:11:12

I notice Clojure is not in the list https://tree-sitter.github.io/tree-sitter/ :(

Benjamin14:11:04

The Bork 😅

borkdude 2