Hi,
Put this function into a file, compile the file and then load the file:
(defun foobar ()
(save-restriction
(widen)))
then:
(defun restrict-widen (orig-widen)
(message "here")
(apply orig-widen nil))
(advice-add 'widen :around #restrict-widen)
(foobar)
The advice is not triggered.
Eval the `foobar` definition interactively and the advice will start
working. The problem occurs only for primitive c functions. Elisp
functions are fine. It doesn't work with 24.4.1 either.
Vitalie
In GNU Emacs 25.0.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
of 2015-09-26
Repository revision: 139e55a58466058a8c9ae54536cb790ac7b7cc64
Windowing system distributor 'The X.Org Foundation', version 11.0.11600000
System Description: Ubuntu 14.10