Some information about advices
An advice is mainly a method of last resort to customize the behavior of functions defined in other libraries. There are many variants of advice. Examples are:
- overriding the function with another function (That is the extreme case where one completely replaces the original function.)
- wrapping the original function with an advising function
- filtering the arguments of the original function
- filtering the return value of the original function
Also special hook variables can be advised (see the manual).
One should prefer other methods for influencing the behavior of library functions. Often the library developer provides normal and special hook variables. Those have following advantages over advices:
- they are at places where the library developer thinks it is safe to tweak the behavior of the function
- hooks are often well documented by the library developer; often conditions on the hook functions are specified such as whether they may move
point or change
Source of the advice of
texinfo-mode and how one can avoid it
TeX-texinfo-mode comes from the AUCTeX package. It is defined in
Also the override-advice of
TeX-texinfo-mode is contained in
You can find that information yourself by the key sequence C-h f
TeX-texinfo-mode. (Note that the key sequence C-h f is bound to the command
describe-function.) The link provided with the help page points to the file where the function is defined.
You can get back the old behavior by customizing the variable
TeX-modes RET. You can also use the menu item
Customize Emacs →
texinfo-mode from the
TeX-modes list off.
General method to remove an advice
The opt-out of the override of
TeX-modes is possible in AUCTeX.
The more general approach to revert the effect of an (override) advice is
advice-remove after the advising package has been loaded.
This is demonstrated for
One would put the following code in one's init file:
(advice-remove 'texinfo-mode #'TeX-texinfo-mode))
But, you do not need to do that since you have the customization option