branch: elpa/popup
commit 4438b94ea78dd8d38783d8ea742d4b13c44b51e0
Merge: 46632ab 47008e1
Author: Syohei YOSHIDA <syo...@gmail.com>
Commit: Syohei YOSHIDA <syo...@gmail.com>

    Merge pull request #95 from Konubinix/master
    
    Allow the user to specify a custom function to build the regexp in isearch
---
 popup.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/popup.el b/popup.el
index 392833b..bad8404 100644
--- a/popup.el
+++ b/popup.el
@@ -887,13 +887,18 @@ Pages up through POPUP."
 (defvar popup-menu-show-quick-help-function 'popup-menu-show-quick-help
   "Function used for showing quick help by `popup-menu*'.")
 
+(defcustom popup-isearch-regexp-builder-function 'regexp-quote
+  "Function used to construct a regexp from a pattern. You may for instance
+  provide a function that replaces spaces by '.+' if you like helm or ivy style
+  of completion.")
+
 (defsubst popup-isearch-char-p (char)
   (and (integerp char)
        (<= 32 char)
        (<= char 126)))
 
 (defun popup-isearch-filter-list (pattern list)
-  (cl-loop with regexp = (regexp-quote pattern)
+  (cl-loop with regexp = (funcall popup-isearch-regexp-builder-function 
pattern)
            for item in list
            do
            (unless (stringp item)

Reply via email to