[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive fun
From: |
Vitalie Spinu |
Subject: |
bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive functions |
Date: |
Mon, 19 Oct 2015 17:51:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>> On Sun, Oct 18 2015 14:25, Daniel Colascione wrote:
> On 10/18/2015 02:16 PM, Philipp Stephani wrote:
>> This is documented behavior:
Well, conceptually the call is from elisp, even if it's a compiled code. What is
technically happening in the compiled code shouldn't be the user's concern.
I think that piece of documentation should be nuanced that advice doesn't work
in compiled elisp calls. I took me 4 hours to figure out why my font-lock code
was chaotically working here and not there.
> I just haven't had a good reason to want to advise a primitive, but if someone
> wants to do this work, I wouldn't object to it.
I am trying hard to make polymode [1] functional for complex sub-modes like
c-lang. For that I need to restrict `widen` and `parse-partial-sexp` in order
for the sub-mode to have an illusion that a region of a buffer is a whole
buffer.
> If we wanted to allow advising of primitives such that we also redirect direct
> calls from C, it wouldn't be that hard:
That would be so great!
Vitalie
[1] https://github.com/vspinu/polymode/