]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/el-search/el-search.el
Reduce duration of a `sit-for'
[gnu-emacs-elpa] / packages / el-search / el-search.el
index 0f40e83f90269a1ecef567da42bebfa6b8adcd2c..90be0aca7418d36c714cc13bb266e70925161143 100644 (file)
@@ -1016,12 +1016,12 @@ Hit any key to proceed."
             (unless (eq this-command last-command)
               (el-search-hl-other-matches pattern)))
           (let* ((region (list (point) (el-search--end-of-sexp)))
-                 (substring (apply #'buffer-substring-no-properties region))
-                 (expr      (read substring))
+                 (original-text (apply #'buffer-substring-no-properties region))
+                 (expr      (read original-text))
                  (replaced-this nil)
                  (new-expr  (funcall get-replacement expr))
                  (get-replacement-string
-                  (lambda () (el-search--format-replacement new-expr substring to-input-string splice)))
+                  (lambda () (el-search--format-replacement new-expr original-text to-input-string splice)))
                  (to-insert (funcall get-replacement-string))
                  (replacement-contains-another-match
                   (with-temp-buffer
@@ -1096,7 +1096,7 @@ Hit any key to proceed."
                 (message "Replacement contains another match%s"
                          (if replace-all " - falling back to interactive mode" ""))
                 (setq replace-all nil)
-                (sit-for 3.)))))))
+                (sit-for 2.)))))))
     (el-search-hl-remove)
     (goto-char opoint)
     (message "Replaced %d matches%s"