Subject: Re: bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive functions

From: Dmitry Gutov <[email-masked]>
Date: Mon, 19 Oct 2015 18:56:25 +0300

On 10/19/2015 06:51 PM, Vitalie Spinu wrote:
> 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.

Yesss. This has been discussed a few times already: you can't advice 
`widen', and hence you can't make a "perfect" multiple-major-modes solution.

The current thinking on that subject is to use prog-indentation-context 
for indentation (it must be supported in the respective major modes as 
well), and introduce something similar for font-lock/syntax-ppss.

Doing anything with parse-partial-sexp is dommed to fail.