From: Michael Heerdegen Date: Sun, 11 Oct 2015 15:05:01 +0000 (+0200) Subject: allow search wrapping X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/3459015a0097b2066e8f1f0be567111cedb410b7 allow search wrapping --- diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index e3826f201..4fc0a40ee 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -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)