diff options
| author | Mark Oteiza | 2016-09-28 13:08:12 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2016-09-28 13:08:12 -0400 |
| commit | cbb2e845187bfbcc62e2accc9df7891a2326608a (patch) | |
| tree | 1fc3cc9a58e0646119d81cc70663dda7454f867a /lisp/replace.el | |
| parent | 329e0274ec6a4ae82f86905b8cf844971b943085 (diff) | |
| download | emacs-cbb2e845187bfbcc62e2accc9df7891a2326608a.tar.gz emacs-cbb2e845187bfbcc62e2accc9df7891a2326608a.zip | |
Turn on more lexical-binding
* lisp/dom.el:
* lisp/faces.el:
* lisp/htmlfontify.el: Turn on lexical-binding.
(htmlfontify-string): Use pushnew instead of add-to-list.
* lisp/info-xref.el:
* lisp/isearch.el:
* lisp/man.el:
* lisp/ps-def.el:
* lisp/ps-print.el:
* lisp/replace.el: Turn on lexical-binding. Require cl-lib at compile
time.
(multi-occur): Use cl-pushnew instead of add-to-list.
(replace-match-string-symbols): Remove unused lexical variable.
(replace-search, replace-highlight): Fix argument shadowing.
* lisp/sort.el:
* lisp/xml.el: Turn on lexical-binding.
(xml--parse-buffer): Use push instead of add-to-list.
* lisp/xt-mouse.el: Turn on lexical-binding.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index e6124f44c9f..42567516e47 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; replace.el --- replace commands for Emacs | 1 | ;;; replace.el --- replace commands for Emacs -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2016 Free | 3 | ;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2016 Free |
| 4 | ;; Software Foundation, Inc. | 4 | ;; Software Foundation, Inc. |
| @@ -28,6 +28,8 @@ | |||
| 28 | 28 | ||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | (eval-when-compile (require 'cl-lib)) | ||
| 32 | |||
| 31 | (defcustom case-replace t | 33 | (defcustom case-replace t |
| 32 | "Non-nil means `query-replace' should preserve case in replacements." | 34 | "Non-nil means `query-replace' should preserve case in replacements." |
| 33 | :type 'boolean | 35 | :type 'boolean |
| @@ -1408,7 +1410,7 @@ See also `multi-occur-in-matching-buffers'." | |||
| 1408 | "Next buffer to search (RET to end): ") | 1410 | "Next buffer to search (RET to end): ") |
| 1409 | nil t)) | 1411 | nil t)) |
| 1410 | "")) | 1412 | "")) |
| 1411 | (add-to-list 'bufs buf) | 1413 | (cl-pushnew buf bufs) |
| 1412 | (setq ido-ignore-item-temp-list bufs)) | 1414 | (setq ido-ignore-item-temp-list bufs)) |
| 1413 | (nreverse (mapcar #'get-buffer bufs))) | 1415 | (nreverse (mapcar #'get-buffer bufs))) |
| 1414 | (occur-read-primary-args))) | 1416 | (occur-read-primary-args))) |
| @@ -1945,7 +1947,6 @@ type them using Lisp syntax." | |||
| 1945 | 1947 | ||
| 1946 | (defun replace-eval-replacement (expression count) | 1948 | (defun replace-eval-replacement (expression count) |
| 1947 | (let* ((replace-count count) | 1949 | (let* ((replace-count count) |
| 1948 | err | ||
| 1949 | (replacement | 1950 | (replacement |
| 1950 | (condition-case err | 1951 | (condition-case err |
| 1951 | (eval expression) | 1952 | (eval expression) |
| @@ -2046,7 +2047,7 @@ It is called with three arguments, as if it were | |||
| 2046 | `re-search-forward'.") | 2047 | `re-search-forward'.") |
| 2047 | 2048 | ||
| 2048 | (defun replace-search (search-string limit regexp-flag delimited-flag | 2049 | (defun replace-search (search-string limit regexp-flag delimited-flag |
| 2049 | case-fold-search &optional backward) | 2050 | case-fold &optional backward) |
| 2050 | "Search for the next occurrence of SEARCH-STRING to replace." | 2051 | "Search for the next occurrence of SEARCH-STRING to replace." |
| 2051 | ;; Let-bind global isearch-* variables to values used | 2052 | ;; Let-bind global isearch-* variables to values used |
| 2052 | ;; to search the next replacement. These let-bindings | 2053 | ;; to search the next replacement. These let-bindings |
| @@ -2065,7 +2066,7 @@ It is called with three arguments, as if it were | |||
| 2065 | replace-lax-whitespace) | 2066 | replace-lax-whitespace) |
| 2066 | (isearch-regexp-lax-whitespace | 2067 | (isearch-regexp-lax-whitespace |
| 2067 | replace-regexp-lax-whitespace) | 2068 | replace-regexp-lax-whitespace) |
| 2068 | (isearch-case-fold-search case-fold-search) | 2069 | (isearch-case-fold-search case-fold) |
| 2069 | (isearch-adjusted nil) | 2070 | (isearch-adjusted nil) |
| 2070 | (isearch-nonincremental t) ; don't use lax word mode | 2071 | (isearch-nonincremental t) ; don't use lax word mode |
| 2071 | (isearch-forward (not backward)) | 2072 | (isearch-forward (not backward)) |
| @@ -2080,7 +2081,7 @@ It is called with three arguments, as if it were | |||
| 2080 | 2081 | ||
| 2081 | (defun replace-highlight (match-beg match-end range-beg range-end | 2082 | (defun replace-highlight (match-beg match-end range-beg range-end |
| 2082 | search-string regexp-flag delimited-flag | 2083 | search-string regexp-flag delimited-flag |
| 2083 | case-fold-search &optional backward) | 2084 | case-fold &optional backward) |
| 2084 | (if query-replace-highlight | 2085 | (if query-replace-highlight |
| 2085 | (if replace-overlay | 2086 | (if replace-overlay |
| 2086 | (move-overlay replace-overlay match-beg match-end (current-buffer)) | 2087 | (move-overlay replace-overlay match-beg match-end (current-buffer)) |
| @@ -2095,7 +2096,7 @@ It is called with three arguments, as if it were | |||
| 2095 | replace-lax-whitespace) | 2096 | replace-lax-whitespace) |
| 2096 | (isearch-regexp-lax-whitespace | 2097 | (isearch-regexp-lax-whitespace |
| 2097 | replace-regexp-lax-whitespace) | 2098 | replace-regexp-lax-whitespace) |
| 2098 | (isearch-case-fold-search case-fold-search) | 2099 | (isearch-case-fold-search case-fold) |
| 2099 | (isearch-forward (not backward)) | 2100 | (isearch-forward (not backward)) |
| 2100 | (isearch-other-end match-beg) | 2101 | (isearch-other-end match-beg) |
| 2101 | (isearch-error nil)) | 2102 | (isearch-error nil)) |