Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.82k stars 194 forks source link

Error when loading smartparens #1077

Closed joca-bt closed 3 years ago

joca-bt commented 3 years ago

Getting this error when loading smartparens after pulling the latest code: Eager macro-expansion failure: (wrong-type-argument listp [(first-item . rest-items) (sp-get-list-items)]).

manuel-uberti commented 3 years ago

I am seeing this too. From emacs -Q, installing and enabling smartparens-global-mode triggers the above mentioned error.

bymoz089 commented 3 years ago

I have the same issue, but this seems to be a simple typo.

To fix it replace [ with ( and
] with )
on line 8386 in file smartparens.el

Line 8386 should then look like:

(-when-let ((first-item . rest-items) (sp-get-list-items))
manuel-uberti commented 3 years ago

@bymoz089 isn't when-let already available in subr-x.el? On my Emacs I get this:

when-let is an autoloaded Lisp macro in ‘subr-x.el’.

(when-let SPEC &rest BODY)

  Probably introduced at or before Emacs version 25.1.
bymoz089 commented 3 years ago

@manuel-uberti IMO when-let is no drop in replacement for -when-let. -when-let can destructure the argument list. Here is a video which explains some aspect of this topic.

Try to eval following two code fragments in your Emacs scratch buffer.

(when-let ((first-item . rest-items) '(foo bar baz))
  (message (format "%s | %s" first-item rest-items)))

(-when-let ((first-item . rest-items) '(foo bar baz))
  (message (format "%s | %s" first-item rest-items)))

But I think this goes out of topic of this issue.

manuel-uberti commented 3 years ago

Thanks for the clarification.

mkaschenko commented 3 years ago

The message disappears when I comment (require 'smartparens-config) line within my init.el file. Replacing [] via () also helps https://github.com/Fuco1/smartparens/issues/1077#issuecomment-779349052.

duianto commented 3 years ago

There's a PR pending with a fix: Fix #1077 #1079

mambolevis commented 3 years ago

The melpa version still has this problem: Loading package smartparens... Eager macro-expansion failure: (wrong-type-argument listp [(first-item . rest-items) (sp-get-list-items)])