From 09615b953aa9f5eb88d27f7bf646247ee9de7527 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 25 May 2023 15:29:42 -0700 Subject: [oni-core] Require ‘consult’ when byte-compiling ‘oni-core’ When everything is interpreted it all works fine because ‘consult’ is loaded before the ‘with-eval-after-load’ part is run, but when byte compiling the byte compiler doesn't know that ‘consult-customize’ is a macro unless ‘consult’ is loaded, which it isn't when Guix compiles it. When it's byte-compiled as if it's a function ‘consult-buffer’ is assumed to be a variable that's passed in, so I'm guessing it's trying to dereference it first before passing it on to a non-existent function? But of course ‘consult-buffer’ is only a function (Emacs Lisp is a Lisp-2 after all), so it fails, but only when byte compiled (and even only when byte-compiled in a clean environment where there are no packages loaded that aren't explicity said to be). Hopefully this fixes my issue with being unable to switch buffers until I explicitly load ‘consult’. --- oni-core.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'oni-core.el') diff --git a/oni-core.el b/oni-core.el index ca9b403..4d16a11 100644 --- a/oni-core.el +++ b/oni-core.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.0524.235720 +;; Version: 2023.0525.151855 ;; Package-Requires: (oni-data-dir oni-embrace oni-hydra expand-region multiple-cursors gcmh diminish ws-butler which-key insert-char-preview mixed-pitch ace-window vertico marginalia orderless consult embark docstr mini-frame) ;; This program is free software; you can redistribute it and/or modify @@ -450,14 +450,14 @@ _s_: String list" :enabled buffer-file-name :action find-file)) -(defun oni-core-remove-consult-buffer-preview () - (consult-customize consult-buffer :preview-key nil)) +(eval-when-compile + (require 'consult)) (with-eval-after-load 'consult (with-eval-after-load 'related-files (add-to-list 'consult-buffer-sources 'oni-core-related-places-source)) - (oni-core-remove-consult-buffer-preview)) + (consult-customize consult-buffer :preview-key nil)) ;;; Embark -- cgit v1.2.3-54-g00ecf