On Mon, 06 Apr 2020 14:06:02 -0400 Stefan Monnier wrote: >> @@ -299,7 +299,11 @@ unload-feature >> ;; Known abnormal hooks etc. >> (memq x unload-feature-special-hooks))) >> (dolist (func removables) >> - (remove-hook x func))))) >> + (remove-hook x func) >> + (save-current-buffer >> + (dolist (buffer (buffer-list)) >> + (set-buffer buffer) >> + (remove-hook x func t))))))) >> ;; Remove any feature-symbols from auto-mode-alist as well. >> (dolist (func removables) >> (setq auto-mode-alist > > Maybe instead of `(dolist (buffer (buffer-list))` within that big > `mapatoms` within `(dolist (func removables)` (which is O(B*F*V) where > B is the number of buffers, F is the number of functions and V is the > number of hook vars), we should instead do it as: > > (dolist (buffer (buffer-list)) > (dolist (varvar (buffer-local-variables buffer)) ^^^^^^^^^^^^^^^^^^^^^^ Ha! Didn't know/think about that one, and indeed it makes a world of difference. Thanks! So I guess my defeatism will not prevail after all. Updated [2/3] attached. -- Štěpán