SystemCrafters / crafted-emacs

A sensible base Emacs configuration.
MIT License
742 stars 116 forks source link

Is rational-ensure-package broken? #203

Closed iquabius closed 2 years ago

iquabius commented 2 years ago

I'm getting this error since I first installed rational-emacs

Debugger entered--Lisp error: (error "Not enough arguments for format string")
  message("Package '%s' does not appear to be installed by Gu...")
  (if (featurep package) nil (message "Package '%s' does not appear to be installed by Gu..."))
  (if crafted-prefer-guix-packages (if (featurep package) nil (message "Package '%s' does not appear to be installed by Gu...")) (if (package-installed-p package) nil (package-install package)))
  crafted-ensure-package(ergoemacs-mode)
  eval-buffer(#<buffer  *load*-888675> nil "/home/pop/.config/crafted-emacs/config.el" nil t)  ; Reading at buffer position 159
  load-with-code-conversion("/home/pop/.config/crafted-emacs/config.el" "/home/pop/.config/crafted-emacs/config.el" nil t)
  load("/home/pop/.config/crafted-emacs/config.el" nil nomessage)
  (progn (load crafted-config-file nil 'nomessage))
  (if (file-exists-p crafted-config-file) (progn (load crafted-config-file nil 'nomessage)))
  eval-buffer(#<buffer  *load*> nil "/home/pop/.config/emacs/init.el" nil t)  ; Reading at buffer position 2894
  load-with-code-conversion("/home/pop/.config/emacs/init.el" "/home/pop/.config/emacs/init.el" t t)
  load("/home/pop/.config/emacs/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x133102b70ac2972e>) #f(compiled-function () #<bytecode 0x4d12c0e0e44348b>) t)
  command-line()
  normal-top-level()

I'm using rational-ensure-package in my config:

Click to see my config.el ```elisp ;;; config.el --- Personal Rational Emacs Config -*- lexical-binding: t; -*- ;;; Code: (toggle-frame-fullscreen) (rational-ensure-package 'ergoemacs-mode) (require 'ergoemacs-mode) (ergoemacs-mode t) (require 'rational-defaults) (require 'rational-ui) (require 'rational-completion) ;; Archcraft pre-installed: ;; "JetBrains Mono", "FiraCode Nerd Font", "DejaVu Sans Mono", "Source Code Pro" (custom-set-variables '(rational-ui-default-font'(:font "FiraCode Nerd Font Light 12" :height 230))) (set-face-attribute 'variable-pitch nil :font "Iosevka" :weight 'light) ;; (eval-after-load "projectile")?? (variable-pitch-mode 1) (custom-set-variables '(rational-ui-display-line-numbers t)) (define-key vertico-map (kbd "C-f") 'vertico-exit) (when (version<= "9.2" (org-version)) (require 'org-tempo)) (setq org-startup-folded t) ;; Didn`t work ;; (setq org-startup-truncated nil) ;; Try (toggle-truncate-lines) (provide 'config) ;;; config.el ends here ```

I've made these changes to ~/.config/emacs/init.el to fix it:

diff --git a/init.el b/init.el
index 2d684d0..ed8ebbf 100644
--- a/init.el
+++ b/init.el
@@ -43,7 +43,7 @@ package.el or Guix depending on the value of
 `crafted-prefer-guix-packages'."
   (if crafted-prefer-guix-packages
       (unless (featurep package)
-        (message "Package '%s' does not appear to be installed by Guix!"))
+        (message "Package '%s' does not appear to be installed by Guix: " package))
     (crafted-package-install-package package)))

 ;; Check the system used
(END)

Am I using rational-ensure-package the wrong way or is it actually broken?

jeffbowman commented 2 years ago

That would be a bug. Your fix is correct, maybe submit a PR?

iquabius commented 2 years ago

Sure: #205