Skip to content

Commit

Permalink
Bugfix: do not rely on evenp from cl.el
Browse files Browse the repository at this point in the history
  • Loading branch information
rgemulla committed Aug 6, 2018
1 parent 602124c commit f8dc3fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions smartparens-latex.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit f8dc3fd

Please sign in to comment.