Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unload a mode (e.g. unload ECB to restore winner.el functionality)

I find ECB mode quite useful at times due to its souped up Speedbar and nice code browsing capabilities. Unfortunately, I also heavily rely on winner mode, which is incompatible with ECB. Even after I do M-x ecb-deactivate, all the ECB defuns appear loaded, and winner commands still throw an error about ECB/winner incompatibility. Is there a way to remove the ECB definitions so that winner works as before, short of restarting Emacs?

like image 909
Leo Alekseyev Avatar asked Feb 22 '12 05:02

Leo Alekseyev


1 Answers

The problem seems to be that ECB uses advice to display the error message ("Can't use winner-mode functions in the ecb-frame"), and this advice is not activated when ecb-deactivate is called.

I was able to work around this problem by disabling the advice in ecb-deactivate-hook:

(add-hook 'ecb-deactivate-hook 
      (lambda ()
         (ecb-disable-advices 'ecb-winman-not-supported-function-advices t)))

However, you should probably report this as a bug to the maintainers of ECB.

like image 131
Luke Girvin Avatar answered Sep 27 '22 19:09

Luke Girvin