emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master d5f798c 4/7: factor out `el-search--search-pattern-1'


From: Michael Heerdegen
Subject: [elpa] master d5f798c 4/7: factor out `el-search--search-pattern-1'
Date: Thu, 31 Dec 2015 21:43:08 +0000

branch: master
commit d5f798c721734ab5cbf402166b9ec91a13cdfd58
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>

    factor out `el-search--search-pattern-1'
---
 packages/el-search/el-search.el |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index 8724071..ce37d91 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -409,13 +409,8 @@ of the definitions is limited to \"el-search\"."
     (goto-char (match-end 0)))
    (t (forward-char))))
 
-(defun el-search--search-pattern (pattern &optional noerror)
-  "Search elisp buffer with `pcase' PATTERN.
-Set point to the beginning of the occurrence found and return
-point.  Optional second argument, if non-nil, means if fail just
-return nil (no error)."
-  
-  (let ((matcher (el-search--matcher pattern)) (match-beg nil) (opoint 
(point)) current-expr)
+(defun el-search--search-pattern-1 (matcher &optional noerror)
+  (let ((match-beg nil) (opoint (point)) current-expr)
 
     ;; when inside a string or comment, move past it
     (let ((syntax-here (syntax-ppss)))
@@ -441,6 +436,13 @@ return nil (no error)."
         (if noerror nil (signal 'end-of-buffer nil)))
     match-beg))
 
+(defun el-search--search-pattern (pattern &optional noerror)
+  "Search elisp buffer with `pcase' PATTERN.
+Set point to the beginning of the occurrence found and return
+point.  Optional second argument, if non-nil, means if fail just
+return nil (no error)."
+  (el-search--search-pattern-1 (el-search--matcher pattern) noerror))
+
 (defun el-search--do-subsexps (pos do-fun &optional ret-fun bound)
   ;; In current buffer, for any expression start between POS and BOUND
   ;; or (point-max), in order, call two argument function DO-FUN with



reply via email to

[Prev in Thread] Current Thread [Next in Thread]