Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memoization for sp--strict-regexp-quote #605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cask
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

(depends-on "cl-lib" "0.3")
(depends-on "dash" "2.12.1")
(depends-on "memoize" "1.0.1")

(development
(depends-on "f")
Expand Down
3 changes: 2 additions & 1 deletion smartparens-pkg.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(define-package "smartparens" "1.7.1" "Automatic insertion, wrapping and paredit-like navigation with user defined pairs."
'((dash "2.12.1")
'((memoize "1.0.1")
(dash "2.12.1")
(cl-lib "0.3")))
3 changes: 2 additions & 1 deletion smartparens.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
(require 'cl-lib)
(require 'dash)
(require 'thingatpt)
(require 'memoize)

(eval-when-compile (defvar cua--region-keymap))
(declare-function cua-replace-region "cua-base")
Expand Down Expand Up @@ -2885,7 +2886,7 @@ that the strings are not matched in-symbol."
(mapconcat (lambda (g) (apply 'sp--regexp-for-group g)) it "\\|")
(concat "\\(?:" it "\\)"))))

(defun sp--strict-regexp-quote (string)
(defmemoize sp--strict-regexp-quote (string)
"Like regexp-quote, but make sure that the string is not
matched in-symbol."
(sp--wrap-regexp (regexp-quote string)
Expand Down