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 195 forks source link

sp-get-buffer-char-syntax: Symbol’s function definition is void: syntax-class-to-char #1200

Closed rechvs closed 5 months ago

rechvs commented 5 months ago

Expected behavior

Calling sp-backward-kill-word kills the word before point.

Actual behavior

The function displays the following error in the minibuffer:

sp-get-buffer-char-syntax: Symbol’s function definition is void: syntax-class-to-char

Steps to reproduce the problem

In any file with Smartparens mode active, call sp-backward-kill-word.

Backtraces if necessary (M-x toggle-debug-on-error)

Debugger entered--Lisp error: (void-function syntax-class-to-char)
  syntax-class-to-char(2)
  sp-get-buffer-char-syntax(49219)
  sp-syntax-before()
  sp-skip-backward-to-symbol()
  sp-get-symbol(t)
  sp-backward-kill-symbol(1 t)
  sp-backward-kill-word(1)
  funcall-interactively(sp-backward-kill-word 1)
  call-interactively(sp-backward-kill-word nil nil)
  command-execute(sp-backward-kill-word)

Environment & version information

Fuco1 commented 5 months ago

Hmm, seems like the function syntax-class-to-char was introduced in Emacs 28. I'll add a compat function for it.

rechvs commented 5 months ago

@Fuco1 I’m afraid the problem still persists. Should I open a new issue?

Backtraces

Debugger entered--Lisp error: (void-function sp--syntax-class-to-char)
  sp--syntax-class-to-char(0)
  sp-get-buffer-char-syntax(50349)
  sp-syntax-before()
  sp-skip-backward-to-symbol()
  sp-get-symbol(t)
  sp-backward-kill-symbol(1 t)
  sp-backward-kill-word(1)
  funcall-interactively(sp-backward-kill-word 1)
  call-interactively(sp-backward-kill-word nil nil)
  command-execute(sp-backward-kill-word)

Environment & version information

Fuco1 commented 5 months ago

@rechvs thanks for checking it out, there is already an issue for it #1204