0

My current helm configuration is

(use-package helm
  :bind (("M-x" . helm-M-x)
         ("C-x b" . helm-mini)
         ("C-x C-f" . helm-find-files)
         ("C-x C-d" . helm-browse-project)
         ("M-y" . helm-show-kill-ring))
  )
(helm-mode 1)
(setq helm-M-x-fuzzy-match 1)
(setq helm-buffers-fuzzy-matching 1)
(setq helm-recentf-fuzzy-match    1)

This works, but I wish it were more idiomatic. If I try to put the trailing commands in :config, like so:

(use-package helm
  :bind (("M-x" . helm-M-x)
         ("C-x b" . helm-mini)
         ("C-x C-f" . helm-find-files)
         ("C-x C-d" . helm-browse-project)
         ("M-y" . helm-show-kill-ring))
  :config ((helm-mode 1)
           (setq helm-M-x-fuzzy-match 1)
           (setq helm-buffers-fuzzy-matching 1)
           (setq helm-recentf-fuzzy-match 1))
  )

I get the error Error (use-package): helm/:config: Invalid function: (helm-mode 1). Does anyone know what's going on here?

For reference, I'm using Emacs 28.2 on Ubuntu 22.10 with straight.el, and use-package is configured to use straight by default, like so:

(use-package straight
  :custom (straight-use-package-by-default t))
1

1 Answer 1

1

The :config clause has too many parens and should read:

(use-package helm
  :bind (("M-x" . helm-M-x)
         ("C-x b" . helm-mini)
         ("C-x C-f" . helm-find-files)
         ("C-x C-d" . helm-browse-project)
         ("M-y" . helm-show-kill-ring))
  :config  (helm-mode 1)
           (setq helm-M-x-fuzzy-match 1)
           (setq helm-buffers-fuzzy-matching 1)
           (setq helm-recentf-fuzzy-match 1)
  )

In your version, emacs evaluates a list whose first entry it expects to be a function (as it always does) but gets (helm-mode 1) instead.

1
  • Yep, that seems to have been the issue. Thanks! Commented Jan 14, 2023 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.