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 match-data
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 tex-info.el
.
Also the override-advice of texinfo-mode
with TeX-texinfo-mode
is contained in tex-info.el
.
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
via
M-x customize-option
RET TeX-modes
RET. You can also use the menu item
Options
→ Customize Emacs
→ Specific Option...
.
Toggle texinfo-mode
from the TeX-modes
list off.
General method to remove an advice
The opt-out of the override of texinfo-mode
via 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 texinfo-mode
.
One would put the following code in one's init file:
(with-eval-after-load 'tex-info
(advice-remove 'texinfo-mode #'TeX-texinfo-mode))
But, you do not need to do that since you have the customization option TeX-modes
.