Skip to content

Instantly share code, notes, and snippets.

View errge's full-sized avatar

Gergely Risko errge

  • Nilcons []:
  • Zurich, Switzerland
View GitHub Profile
@errge
errge / claude-elisp.md
Created March 27, 2025 11:31
Claude Sonnet 3.7 Thinking vs Emacs Lisp => Claude wins...

Gergo

I'd like to write a very tricky elisp code that does the following in a non-compiled .el file. If we are being byte compiled, use the secure-hash function with sha-256 to compute the whole file's sha256, and emit code into the byte compiled result, that when will be read in later, will compute the sha256 of the .el that is belonging to the .elc being loaded and errors on difference. E.g. we solve the problem of not loading outdated result without depending on timestamps (that is incompatible with git commits). We obviously have to define a defmacro for this at least, since we want to have difference between initial .el and compiled .elc. Can you design this macro for me, and show me the result with a minimal usage example? Make sure to think a lot about this and be concise in presenting your results.

Cloude 3.7 Sonnet thinking

Let's break down the problem:

  1. We need to create a macro that, when a file is byte-compiled, computes the SHA-256 hash of the entire file.
  2. The byte-compiled .elc
@errge
errge / .Xresources
Created July 3, 2020 15:53
xresources
vncviewer*grabKeyboard: true
Xft.antialias: 1
Xft.hinting: 1
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xft.lcdfilter: lcddefault
Xft.dpi: 100
@errge
errge / dot-emacs.el
Created July 3, 2020 15:49
dot-emacs.el
;; (package-initialize)
(setq nce/accepted-version "26.3")
(load "/home/errge/work/nilcons-emacs/bin/init.elc" nil t)
(defun increment-number-at-point ()
(interactive)
(skip-chars-backward "0-9")
(or (looking-at "[0-9]+")
(error "No number at point"))

Keybase proof

I hereby claim:

  • I am errge on github.
  • I am errge (https://keybase.io/errge) on keybase.
  • I have a public key whose fingerprint is BD1D DA69 6803 C41A 564A 6207 2930 1001 0000 3344

To claim this, I am signing this object: