Skip to content

Commit

Permalink
Fix byte-compilation warning on Emacs --without-x
Browse files Browse the repository at this point in the history
* ivy.el (ivy--minibuffer-setup): Modify mwheel variables only after
the library has been loaded (PR #2900).

Copyright-paperwork-exempt: yes
  • Loading branch information
akater authored and basil-conto committed Jul 30, 2021
1 parent 031d4d0 commit 20d78ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20d78ae

Please sign in to comment.