Okay, I need to do a hacky #elisp thing. Yes, I know it's terrible.
Basically, I have an existing defun. Let's call it foo. I need to replace it with a new function that calls the old one and transforms its output before returning it.
I naΓ―vely assumed I could do it like this:
(let ((oldfunc (function foo)))
(defun foo ()
(my-transform (funcall oldfunc))))...but this doesn't actually copy the old function, just a reference to the symbol, so it ends up locking itself in a recursive loop.
I'm sure there's a way to do this.
#AskFedi
Edit: Got it. It's:
(let ((oldfunc (symbol-function 'foo)))
(defun foo ()
(my-transform (funcall oldfunc))))Edit 2: It turns out there's a cleaner way still.
See: aus.social/@carlozancanaro/116β¦
Also, there's still something Gmail isn't liking. Looking at the differences in the headers between emacs and my other clients (whose mail does get through), the next most obvious difference is that the Content-Type header doesn't specify an encoding. Whether this is the actual problem or not, I should probably fix that. I'm just working on how.
reshared this

Jonathan Lamothe
in reply to Jonathan Lamothe • •Okay, so I wrote this hacky nonsense in my
~/.emacs.d/init.el, but it doesn't seem to be having any effect. The function in question seems completely unaffected.Perhaps this code is being evaluated before the original function is defined?
The idea is to hash the Message-ID header in outgoing mail because Gmail seems to have decided the original format looks like spam.
#emacs #elisp #AskFedi
Daniel
in reply to Jonathan Lamothe • • •Jonathan Lamothe
in reply to Daniel • •@Daniel It turns out that the better solution was here:
Carlo Zancanaro
2026-04-12 02:26:37
Carlo Zancanaro
in reply to Jonathan Lamothe • • •Sensitive content
gnu.org
www.gnu.orgJonathan Lamothe likes this.
Jonathan Lamothe
in reply to Carlo Zancanaro • •Peter J. Jones
in reply to Jonathan Lamothe • • •Sensitive content
Here's a cleaner version that should work. However, I'd be surprised if it's actually the message IDs that are the problem.
```
(defun jrl-message-unique-id (orig &rest args)
"Hash the output of ORIG.
ARGS are passed on to ORIG"
(secure-hash 'sha256 (apply orig args)))
(advice-add ''message-unique-id :around #'jrl-message-unique-id)
```
Jonathan Lamothe likes this.