From 911bb5697453594ffe86c5b953ca2b50a6d6a182 Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Mon, 16 May 2016 08:00:38 -0700 Subject: [PATCH] Add memoization for sp--strict-regexp-quote --- Cask | 1 + smartparens-pkg.el | 3 ++- smartparens.el | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cask b/Cask index e61a943f..0071d88f 100644 --- a/Cask +++ b/Cask @@ -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") diff --git a/smartparens-pkg.el b/smartparens-pkg.el index 0322b9e2..0fb1fa6e 100644 --- a/smartparens-pkg.el +++ b/smartparens-pkg.el @@ -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"))) diff --git a/smartparens.el b/smartparens.el index fe94ebaf..3024109b 100644 --- a/smartparens.el +++ b/smartparens.el @@ -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") @@ -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)