From 20d78ae4fe2b128411f0ddb0aa22ba25aa5d6d3f Mon Sep 17 00:00:00 2001 From: akater Date: Fri, 30 Jul 2021 05:57:50 +0000 Subject: [PATCH] Fix byte-compilation warning on Emacs --without-x * ivy.el (ivy--minibuffer-setup): Modify mwheel variables only after the library has been loaded (PR #2900). Copyright-paperwork-exempt: yes --- ivy.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ivy.el b/ivy.el index 659ba3e2..c693ab73 100644 --- a/ivy.el +++ b/ivy.el @@ -2986,8 +2986,11 @@ tries to ensure that it does not change depending on the number of candidates." (defun ivy--minibuffer-setup () "Setup ivy completion in the minibuffer." - (setq-local mwheel-scroll-up-function 'ivy-next-line) - (setq-local mwheel-scroll-down-function 'ivy-previous-line) + ;; Guard for --without-x builds where `mwheel' is not preloaded. + (when (boundp 'mwheel-scroll-up-function) + (setq-local mwheel-scroll-up-function 'ivy-next-line)) + (when (boundp 'mwheel-scroll-down-function) + (setq-local mwheel-scroll-down-function 'ivy-previous-line)) (setq-local completion-show-inline-help nil) (setq-local line-spacing nil) (setq-local minibuffer-default-add-function