Subject: Re: 28.0.50; Dynbind add-function and lambdas as file vars

From: Stefan Monnier <[email-masked]>
Date: Sun, 27 Jun 2021 18:18:14 -0400

>> -     (save-excursion (eval val)))
>> +     (save-excursion (eval val t)))
> I would certainly welcome that.

Pushed.  I understand it doesn't directly satisfies your original
request, but that seems harder to do.

This said, technically you *can* get exactly what you asked for with
something like:

    Local Variables:
    my-do-with-test-process-fun: #[257 "\300\301\^B\302\303\^B\"\302\304\^C\"B\262\^A\305\306$\207" [advice--add-function :before make-closure #[0 "\301\300!\207" [V0 process-sentinel] 2] #[257 "\301\300\^B\"\207" [V0 set-process-sentinel] 4 "\n\n(fn GV--VAL)"] #[128 "\300\301!\207" [message "Test"] 3 "\n\n(fn &rest _)"] nil] 8 "\n\n(fn P)"]
    End:

which you can generate with:

    M-: (let ((lexical-binding t) (print-escape-newlines t)) (insert (format "%S" (byte-compile '(lambda (p) (add-function :before (process-sentinel p) (lambda (&rest _) (message "Test"))))))))

I wouldn't encourage you to do that, tho.

        Stefan