From 2c15e4e6fc2f8edb95ca0344364877b20a6483db Mon Sep 17 00:00:00 2001 From: Mathew <45mm.cartridge421@slmail.me> Date: Thu, 1 Feb 2024 07:36:16 +0000 Subject: [PATCH 1/2] 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@a09fdca0b35e 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@a09fdca0b35e --- modules/ui/popup/+hacks.el | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index 1b040fd34..ab3e70275 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -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." From d509d8bea1ad27ab9b7e9ddca329f494686b336e Mon Sep 17 00:00:00 2001 From: RBckmnn <53320014+RBckmnn@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:38:34 +0100 Subject: [PATCH 2/2] fix(file-templates): invalid function call `evil-initialize-state` recently changed to no longer accept any arguments, so use `evil-change-state` instead. Ref: emacs-evil/evil@1c4c3bfff898 --- modules/editor/file-templates/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/editor/file-templates/autoload.el b/modules/editor/file-templates/autoload.el index 7cbd0f343..934c84880 100644 --- a/modules/editor/file-templates/autoload.el +++ b/modules/editor/file-templates/autoload.el @@ -81,7 +81,7 @@ evil is loaded and enabled)." (and yas--active-field-overlay (overlay-buffer yas--active-field-overlay) (overlay-get yas--active-field-overlay 'yas--field))) - (evil-initialize-state 'insert)))))) + (evil-change-state 'insert)))))) ;;;###autoload (defun +file-templates-get-short-path ()