Is helm-exit-minibuffer-hook
working correctly? · Issue #1386 · emacs-helm/helm (original) (raw)
I'd like to turn popwin-mode
off when using Helm, and turn it back on after leaving Helm. This is because Helm's persistent action displays Help buffers in the other window. When popwin-mode
is active, both the persistent action's Help buffer and the popwin
Help buffer are shown.
I've done the following:
(defun *-popwin-help-mode-off () (when (boundp 'popwin:special-display-config) (customize-set-variable 'popwin:special-display-config (delq 'help-mode popwin:special-display-config))))
(defun *-popwin-help-mode-on () (when (boundp 'popwin:special-display-config) (customize-set-variable 'popwin:special-display-config (push 'help-mode popwin:special-display-config))))
(add-hook 'helm-minibuffer-set-up-hook #'-popwin-help-mode-off) (add-hook 'helm-exit-minibuffer-hook #'-popwin-help-mode-on)
Turning popwin-mode
off for Helm works fine. Turning it back on does not work, however, when exiting Helm with C-g. It does work when exiting Helm by selecting a candidate.
This is not what I would expect from the documentation:
Run just before exiting minibuffer.
Quitting seems as valid a method of "exiting" as selecting a candidate.
I've gotten around this by using helm-cleanup-hook
instead. Its documentation is:
Run after helm minibuffer is closed. IOW this hook is executed BEFORE performing action.
Is this the right hook to use? What does "IOW" mean?