diff options
| author | Vasilij Schneidermann <mail@vasilij.de> | 2018-02-22 19:12:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-22 19:12:26 +0100 |
| commit | ef389387c6ebbd68a9e7f78f365d28d5760bf1c6 (patch) | |
| tree | 8a10da1e692c252b9b1b5bbfadc1f11855af304f | |
| parent | 2992858748e6fe8ae706d182b86b684e7b9be8b9 (diff) | |
| parent | 21d3f06489d8fe30f54c22d6a56aea938f88099a (diff) | |
Merge pull request #1019 from emacs-evil/evil-ex-global-parse-command-once
evil-ex-global: parse COMMAND only once, not on each matching line
| -rw-r--r-- | evil-commands.el | 5 | ||||
| -rw-r--r-- | evil-ex.el | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/evil-commands.el b/evil-commands.el index f2770ae..466f36d 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -3599,6 +3599,9 @@ This is the same as :%s//~/&" (evil-with-single-undo (let ((case-fold-search (eq (evil-ex-regex-case pattern 'smart) 'insensitive)) + (command-form (evil-ex-parse command)) + (transient-mark-mode transient-mark-mode) + (deactivate-mark deactivate-mark) match markers) (when (and pattern command) (setq isearch-string pattern) @@ -3618,7 +3621,7 @@ This is the same as :%s//~/&" (unwind-protect (dolist (marker markers) (goto-char marker) - (evil-ex-eval command)) + (eval command-form)) ;; ensure that all markers are deleted afterwards, ;; even in the event of failure (dolist (marker markers) @@ -826,14 +826,8 @@ Returns the line number of the match." NUMBER defaults to 1." (funcall sign (or number 1))) -(defun evil-ex-eval (string &optional start) - "Evaluate STRING as an Ex command. -START is the start symbol, which defaults to `expression'." - ;; disable the mark before executing, otherwise the visual region - ;; may be used as operator range instead of the ex-range - (let ((form (evil-ex-parse string nil start)) - transient-mark-mode deactivate-mark) - (eval form))) +;; function `evil-ex-eval' has been superseded by `evil-ex-parse' plus `eval' +(make-obsolete 'evil-ex-eval 'evil-ex-parse "1.2.14") (defun evil-ex-parse (string &optional syntax start) "Parse STRING as an Ex expression and return an evaluation tree. |
