]> code.delx.au - gnu-emacs-elpa/commitdiff
allow search wrapping
authorMichael Heerdegen <michael_heerdegen@web.de>
Sun, 11 Oct 2015 15:05:01 +0000 (17:05 +0200)
committerMichael Heerdegen <michael_heerdegen@web.de>
Sat, 31 Oct 2015 18:16:58 +0000 (19:16 +0100)
packages/el-search/el-search.el

index e3826f201f7e3d37cded7c3301bb83f0f680b878..4fc0a40ee8ce1c11da56632e8efc7f6981f0db33 100644 (file)
@@ -430,8 +430,7 @@ return nil (no error)."
 ;;;###autoload
 (defun el-search-pattern (pattern)
   "Do incremental elisp search forward."
-  (interactive (list (if (and (eq this-command last-command)
-                              el-search-success)
+  (interactive (list (if (eq this-command last-command)
                          el-search-current-pattern
                        (let ((pattern
                               (el-search--read-pattern "Find pcase pattern: "
@@ -447,8 +446,11 @@ return nil (no error)."
   (setq this-command 'el-search-pattern) ;in case we come from isearch
   (setq el-search-current-pattern pattern)
   (let ((opoint (point)))
-    (when (and (eq this-command last-command) el-search-success)
-      (el-search--skip-expression nil t))
+    (when (eq this-command last-command)
+      (if el-search-success
+          (el-search--skip-expression nil t)
+        ;; wrap search
+        (goto-char (point-min))))
     (setq el-search-success nil)
     (when (condition-case nil
               (el-search--search-pattern pattern)