Closed practicalli-johnny closed 7 months ago
Same here. I looked into the source code and didn't find where sp--syntax-class-to-char
is defined.
Is that wrong syntax? Ups, I'll look into it.
Is that wrong syntax? Ups, I'll look into it.
I'm not sure if it is wrong syntax, just pointed to the code for @zyxir. For me it fails for other command:
Debugger entered--Lisp error: (void-function sp--syntax-class-to-char)
sp--syntax-class-to-char(0)
sp-get-buffer-char-syntax(1284)
sp-syntax-after()
sp-skip-forward-to-symbol(t nil t)
sp-get-thing()
sp-forward-sexp()
sp-region-ok-p(1284 1309)
evil-cp-region-ok-p(1284 1309)
evil-cp-delete(1284 1309 line nil nil)
funcall-interactively(evil-cp-delete 1284 1309 line nil nil)
command-execute(evil-cp-delete)
It is working right after update and installation of new version, but stopped working as soon as I've restarted Emacs.
smartparens
version: 20240410.1709major-mode
: clojure-mode
M-x emacs-version
): GNU Emacs 30.0.50 (build 2, aarch64-apple-darwin23.2.0, NS appkit-2487.30 Version 14.2.1 (Build 23C71)) of 2024-01-06PS. The same happens on my Linux machine.
smartparens
version: 20240410.1709major-mode
: clojure-mode
M-x emacs-version
): GNU Emacs 29.3.50 (build 1, x86_64-pc-linux-gnu) of 2024-04-05Maybe (defalias 'sp--syntax-class-to-char 'syntax-class-to-char) is evaluated only on compile time in smartparens.el. Use eval-and-compile instad of eval-when-compile.
Not really wrong syntax but the problem is the separate function namespace of (emacs) lisp. A quick fix is
(defalias 'sp--syntax-class-to-char #'syntax-class-to-char)
Quoting using #'
references the syntax-class-to-char
symbol in the function namespace.
Note: the documentation of syntax-class-to-char
(in emacs 29.2) says the function was probably introduced in emacs 28.1 or before. So it may be more robust to check if the function exists or not instead of relying on the version. Something like
(eval-when-compile
(unless (fboundp 'syntax-class-to-char)
(defun syntax-class-to-char (syntax)
...)
This defines the function when it doesn't exists, so the defalias
or other changes are not necessary.
I'm not sure if it is wrong syntax, just pointed to the code for @zyxir.
Thanks bro. I don't know if it is the right place to complain, but Smartparens lacking a stable branch or a stable tag is a bit troublesome for me sometimes. The last versioned tag (1.11.0), which was updated in 2017, and is available in Melpa-stable and Nongu-ELPA, is a little outdated for me. The temporary solution for me now is to always pin Smartparens at a specific commit, like Doom Emacs does.
@zyxir agreed, I need to start producing some stable releases again, sorry about that.
@fpotargent Excellent points, I will include your solution in a patch, will be out in 2 hours
@zyxir agreed, I need to start producing some stable releases again, sorry about that.
It's just a very minor inconvenience. Smartparens is overall a great package that has saved countless time for me and other users. Thank you for your great work!
I merged a patch by @juergenhoetzel, that should fix the issue.
Thank you @Fuco1 for the quick resolution. SmartParens is working very well again.
Thank you for all the work you put into this project, it is greatly appreciated.
Expected behavior
Should be able to slurp code, e.g. slurp a collection into an expression
Before
after
Actual behavior
Code is not slurped and error in message buffer
Steps to reproduce the problem
Update to
smartparens-20240410.1709
package from melpaTested in latest Spacemacs develop branch and all latest packages downloaded as of 11 April 2024
Using
smartparens-20231024.1804
does not experience this issue (last version used).Backtraces if necessary (
M-x toggle-debug-on-error
)Environment & version information
In recent enough
smartparens
you can callM-x sp-describe-system
to generate this report. Please fill manually what we could not detect automatically. Edit the output as you see fit to protect your privacy.smartparens
version: 20240410.1709major-mode
:clojure-mode
M-x emacs-version
): GNU Emacs 29.2 (build 1, aarch64-apple-darwin23.3.0, NS appkit-2487.40 Version 14.3 (Build 23D56)) of 2024-02-02