I've hit a problem that region is deactivated (in transient-mark-mode). The function deactivate-mark
is called and I would like to find out where (and why) it is called from.
I tried M-x debug-on-entry RET deactivate-mark
and it stops but I found no way to find out the caller. Whole displayed stacktrace is:
Debugger entered--entering a function:
* deactivate-mark()
I tried M-x edebug-eval-defun
but Edebug does not show the caller either.
How do I find out why (where from) deactivate-mark
is called? I'm look for backtrace or stacktrace functinality.
EDIT:
An advice-add
trick:
(defun message-show-backtrace ()
(message "%s" (backtrace-frame 10)))
(advice-add deactivate-mark :before #'message-show-backtrace)
produces nil
in *Messages*
.
Edit: more info about deactivate-mark
: http://emacshorrors.com/posts/deactivate-mark.html
emacs -Q
, turn on the debugM-x debug-on-entry deactivate-mark
, activate markC-<SPC>
, type a character.deactiveate-mark
and in your advice function usebacktrace-frames
to get a view of the whole call stack if edebug is not showing what you expect.advice-add
andbacktrace-frame
. It did not help.self-insert-command
and "self-insert-command is an interactive built-in function in 'C source code'." This, together with the other behavior noted so far, suggests that one will have to debug withgdb
.