[Top][All Lists]

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

[elpa] master a99a741: el-search: some small improvements

From: Michael Heerdegen
Subject: [elpa] master a99a741: el-search: some small improvements
Date: Wed, 05 Aug 2015 01:01:01 +0000

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

    el-search: some small improvements
 packages/el-search/el-search.el |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index a8086f6..25eb69b 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -7,7 +7,7 @@
 ;; Created: 29 Jul 2015
 ;; Keywords: lisp
 ;; Compatibility: Gnu Emacs 25
-;; Version: 0.0.1
+;; Version: 0.0.2
 ;; Package-Requires: ((emacs "25") (cl-lib "0"))
@@ -213,6 +213,7 @@ expression."
     (define-key map [up]   nil)
     (define-key map [down] nil)
     (define-key map [(control meta backspace)] #'backward-kill-sexp)
+    (define-key map [(control ?S)] #'exit-minibuffer)
   "Map for reading input with `el-search-read-expression'.")
@@ -405,14 +406,18 @@ return nil (no error)."
   (interactive (list (if (and (eq this-command last-command)
-                       (let ((pattern (el-search--read-pattern "Find pcase 
pattern: " nil nil t)))
+                       (let ((pattern
+                              (el-search--read-pattern "Find pcase pattern: "
+                                                       (car el-search-history)
+                                                       nil t)))
                          ;; A very common mistake: input "foo" instead of 
                          (when (and (symbolp pattern)
                                     (not (eq pattern '_))
                                     (or (not (boundp pattern))
                                         (not (eq (symbol-value pattern) 
                            (error "Please don't forget the quote when 
searching for a symbol"))
-                         (setq el-search-current-pattern 
(el-search--maybe-wrap-pattern pattern))))))
+                         (el-search--maybe-wrap-pattern pattern)))))
+  (setq el-search-current-pattern pattern)
   (setq el-search-success nil)
   (let ((opoint (point)))
     (when (eq this-command last-command)
@@ -498,6 +503,7 @@ return nil (no error)."
 (defun el-search-query-replace (from to &optional mapping)
   "Replace some occurrences of FROM pattern with evaluated TO."
   (interactive (el-search-query-replace-read-args))
+  (setq el-search-current-pattern from)
   (el-search-search-and-replace-pattern from to mapping))

reply via email to

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