From d33a037f2da93d446c626472c064f148c20836ea Mon Sep 17 00:00:00 2001 From: rgemulla Date: Thu, 31 May 2018 11:15:40 +0200 Subject: [PATCH] Bugfix: do not rely on evenp from cl.el --- smartparens-latex.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/smartparens-latex.el b/smartparens-latex.el index 8cf46bfb..581644cb 100644 --- a/smartparens-latex.el +++ b/smartparens-latex.el @@ -83,12 +83,15 @@ (setq p (- p 1))) (- (point) p))) +(defun sp-evenp (num) + (eq (% num 2) 0)) + (defun sp--latex-backslash-skip-match (ms mb _me) "Skips a match if preceeded by uneven number of backslashes." (and ms (save-excursion (goto-char mb) - (not (evenp (sp-number-of-backslashes-before-point)))))) + (not (sp-evenp (sp-number-of-backslashes-before-point)))))) (defun sp-latex-point-after-backslash (id action context) "Return t if point follows an uneven number of backslashes (a @@ -101,7 +104,7 @@ ID, ACTION, CONTEXT." (when (> start 1) (save-excursion (goto-char start) - (not (evenp (sp-number-of-backslashes-before-point)))))))) + (not (sp-evenp (sp-number-of-backslashes-before-point)))))))) (add-to-list 'sp-navigate-skip-match '((tex-mode plain-tex-mode latex-mode) . sp--latex-backslash-skip-match))