diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2011-04-19 15:44:55 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2011-04-19 15:44:55 +0200 |
commit | 06b605171f1c9d8b42bd3326a243b8b03d2e4e58 (patch) | |
tree | e96c135042999136bf0e75d113aae306e51983e3 /lisp/replace.el | |
parent | 04c569546ad52f6270d8fc6d4aa0750950a0ac05 (diff) | |
download | emacs-06b605171f1c9d8b42bd3326a243b8b03d2e4e58.tar.gz emacs-06b605171f1c9d8b42bd3326a243b8b03d2e4e58.tar.bz2 emacs-06b605171f1c9d8b42bd3326a243b8b03d2e4e58.zip |
lisp/*.el: Lexical-binding cleanup.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r-- | lisp/replace.el | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 0ed716966ed..31a48d48960 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -98,6 +98,10 @@ is highlighted lazily using isearch lazy highlighting (see :group 'matching :version "22.1") +(defvar replace-count 0 + "Number of replacements done so far. +See `replace-regexp' and `query-replace-regexp-eval'.") + (defun query-replace-descr (string) (mapconcat 'isearch-text-char-description string "")) @@ -849,7 +853,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (setq next-error-function 'occur-next-error)) -(defun occur-revert-function (ignore1 ignore2) +(defun occur-revert-function (_ignore1 _ignore2) "Handle `revert-buffer' for Occur mode buffers." (apply 'occur-1 (append occur-revert-arguments (list (buffer-name))))) @@ -1069,6 +1073,8 @@ are not modified." (interactive (occur-read-primary-args)) (occur-1 regexp nlines (list (current-buffer)))) +(defvar ido-ignore-item-temp-list) + (defun multi-occur (bufs regexp &optional nlines) "Show all lines in buffers BUFS containing a match for REGEXP. This function acts on multiple buffers; otherwise, it is exactly like @@ -1204,11 +1210,12 @@ See also `multi-occur'." (set-buffer-modified-p nil) (run-hooks 'occur-hook))))))) -(defun occur-engine (regexp buffers out-buf nlines case-fold-search +(defun occur-engine (regexp buffers out-buf nlines case-fold title-face prefix-face match-face keep-props) (with-current-buffer out-buf (let ((globalcount 0) - (coding nil)) + (coding nil) + (case-fold-search case-fold)) ;; Map over all the buffers (dolist (buf buffers) (when (buffer-live-p buf) @@ -1308,8 +1315,7 @@ See also `multi-occur'." (nth 0 ret)))) ;; Actually insert the match display data (with-current-buffer out-buf - (let ((beg (point)) - (end (progn (insert data) (point))))))) + (insert data))) (goto-char endpt)) (if endpt (progn @@ -1557,8 +1563,9 @@ type them using Lisp syntax." (setcar n 'replace-count)))))) (setq n (cdr n)))) -(defun replace-eval-replacement (expression replace-count) - (let ((replacement (eval expression))) +(defun replace-eval-replacement (expression count) + (let* ((replace-count count) + (replacement (eval expression))) (if (stringp replacement) replacement (prin1-to-string replacement t)))) @@ -1578,15 +1585,15 @@ with the `noescape' argument set. (prin1-to-string replacement t)) t t))) -(defun replace-loop-through-replacements (data replace-count) +(defun replace-loop-through-replacements (data count) ;; DATA is a vector contaning the following values: ;; 0 next-rotate-count ;; 1 repeat-count ;; 2 next-replacement ;; 3 replacements - (if (= (aref data 0) replace-count) + (if (= (aref data 0) count) (progn - (aset data 0 (+ replace-count (aref data 1))) + (aset data 0 (+ count (aref data 1))) (let ((next (cdr (aref data 2)))) (aset data 2 (if (consp next) next (aref data 3)))))) (car (aref data 2))) @@ -2011,6 +2018,11 @@ make, or the user didn't cancel the call." (if (= replace-count 1) "" "s"))) (or (and keep-going stack) multi-buffer))) +(defvar isearch-error) +(defvar isearch-forward) +(defvar isearch-case-fold-search) +(defvar isearch-string) + (defvar replace-overlay nil) (defun replace-highlight (match-beg match-end range-beg range-end |