branch: elpa/smartparens commit c6cd1c307be47de58d4046c192c0c2f9f2628ba5 Merge: 77327ee064 8e4130dd40 Author: Matus Goljer <matus.gol...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #1206 from juergenhoetzel/fix-invalid-alias-definition Fix invalid alias definition for `syntax-class-to-char' --- smartparens.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/smartparens.el b/smartparens.el index 2c7109c210..3e45ab8461 100644 --- a/smartparens.el +++ b/smartparens.el @@ -1858,12 +1858,13 @@ P is the point at which we run `syntax-ppss'" (list p (point-min) (point-max)) (sp-state-last-syntax-ppss-result sp-state) (syntax-ppss p))))) -(eval-when-compile - (defalias 'sp--syntax-class-to-char 'syntax-class-to-char) - (when (version< emacs-version "28.1") +;; `syntax-class-to-char' is new in Emacs 28.1. +(defalias 'sp--syntax-class-to-char + (if (fboundp 'syntax-class-to-char) + #'syntax-class-to-char ;; Ripped from Emacs 27.0 subr.el. ;; See Github Issue#946 and Emacs bug#31692. - (defun sp--syntax-class-to-char (syntax) + (lambda (syntax) "Return the syntax char of CLASS, described by an integer. For example, if SYNTAX is word constituent (the integer 2), the character ‘w’ (119) is returned.