diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2016-09-28 13:08:12 -0400 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 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.tar.bz2 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 @@ -;;; replace.el --- replace commands for Emacs +;;; replace.el --- replace commands for Emacs -*- lexical-binding: t -*- ;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2016 Free ;; Software Foundation, Inc. @@ -28,6 +28,8 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) + (defcustom case-replace t "Non-nil means `query-replace' should preserve case in replacements." :type 'boolean @@ -1408,7 +1410,7 @@ See also `multi-occur-in-matching-buffers'." "Next buffer to search (RET to end): ") nil t)) "")) - (add-to-list 'bufs buf) + (cl-pushnew buf bufs) (setq ido-ignore-item-temp-list bufs)) (nreverse (mapcar #'get-buffer bufs))) (occur-read-primary-args))) @@ -1945,7 +1947,6 @@ type them using Lisp syntax." (defun replace-eval-replacement (expression count) (let* ((replace-count count) - err (replacement (condition-case err (eval expression) @@ -2046,7 +2047,7 @@ It is called with three arguments, as if it were `re-search-forward'.") (defun replace-search (search-string limit regexp-flag delimited-flag - case-fold-search &optional backward) + case-fold &optional backward) "Search for the next occurrence of SEARCH-STRING to replace." ;; Let-bind global isearch-* variables to values used ;; to search the next replacement. These let-bindings @@ -2065,7 +2066,7 @@ It is called with three arguments, as if it were replace-lax-whitespace) (isearch-regexp-lax-whitespace replace-regexp-lax-whitespace) - (isearch-case-fold-search case-fold-search) + (isearch-case-fold-search case-fold) (isearch-adjusted nil) (isearch-nonincremental t) ; don't use lax word mode (isearch-forward (not backward)) @@ -2080,7 +2081,7 @@ It is called with three arguments, as if it were (defun replace-highlight (match-beg match-end range-beg range-end search-string regexp-flag delimited-flag - case-fold-search &optional backward) + case-fold &optional backward) (if query-replace-highlight (if replace-overlay (move-overlay replace-overlay match-beg match-end (current-buffer)) @@ -2095,7 +2096,7 @@ It is called with three arguments, as if it were replace-lax-whitespace) (isearch-regexp-lax-whitespace replace-regexp-lax-whitespace) - (isearch-case-fold-search case-fold-search) + (isearch-case-fold-search case-fold) (isearch-forward (not backward)) (isearch-other-end match-beg) (isearch-error nil)) |