fix(evil): obsolete evil-command-window advice

As noted in #7556, the advice `+popup--evil-command-window-a` fails,
preventing the command window from being opened. This is because
`evil-command-window` has been rewritten extensively.

In particular, emacs-evil/evil@a09fdca0b3 made it use
`display-buffer` instead of `switch-to-buffer`, so that users could
customize how the window opens. Since this was the function of this
advice, it is obsolete and can be removed.

Fix: #7556
Ref: emacs-evil/evil@a09fdca0b3
This commit is contained in:
Mathew 2024-02-01 07:36:16 +00:00 committed by GitHub
parent ff33ec8f7a
commit 2c15e4e6fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,26 +102,6 @@ were followed."
;;;###package evil
(progn
;; Make evil-mode cooperate with popups
(defadvice! +popup--evil-command-window-a (hist cmd-key execute-fn)
"Monkey patch the evil command window to use `pop-to-buffer' instead of
`switch-to-buffer', allowing the popup manager to handle it."
:override #'evil-command-window
(when (eq major-mode 'evil-command-window-mode)
(user-error "Cannot recursively open command line window"))
(dolist (win (window-list))
(when (equal (buffer-name (window-buffer win))
"*Command Line*")
(kill-buffer (window-buffer win))
(delete-window win)))
(setq evil-command-window-current-buffer (current-buffer))
(ignore-errors (kill-buffer "*Command Line*"))
(with-current-buffer (pop-to-buffer "*Command Line*")
(setq-local evil-command-window-execute-fn execute-fn)
(setq-local evil-command-window-cmd-key cmd-key)
(evil-command-window-mode)
(evil--command-window-insert-commands hist)))
(defadvice! +popup--evil-command-window-execute-a ()
"Execute the command under the cursor in the appropriate buffer, rather than
the command buffer."