bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49163: 28.0.50; Dynbind add-function and lambdas as file vars


From: Michael Heerdegen
Subject: bug#49163: 28.0.50; Dynbind add-function and lambdas as file vars
Date: Mon, 28 Jun 2021 04:56:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> >> -     (save-excursion (eval val)))
> >> +     (save-excursion (eval val t)))
>
> Pushed.  I understand it doesn't directly satisfies your original
> request, but that seems harder to do.

Thanks, Stefan.

I can live with what we have now.

> 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"))))))))

Good to know that this works.  The main problem is that it's not human
readable and doesn't contain the "source", so it's not less complex
than using `eval' at the end.


Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]