]> git.eshelyaron.com Git - emacs.git/commitdiff
Turn on more lexical-binding
authorMark Oteiza <mvoteiza@udel.edu>
Wed, 28 Sep 2016 17:08:12 +0000 (13:08 -0400)
committerMark Oteiza <mvoteiza@udel.edu>
Wed, 28 Sep 2016 17:08:12 +0000 (13:08 -0400)
* 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.

12 files changed:
lisp/dom.el
lisp/faces.el
lisp/htmlfontify.el
lisp/info-xref.el
lisp/isearch.el
lisp/man.el
lisp/ps-def.el
lisp/ps-print.el
lisp/replace.el
lisp/sort.el
lisp/xml.el
lisp/xt-mouse.el

index cf3a02a51dbcc1d0963e2a77d673f2422ac677b8..9f5e177e986267caeaa41d73450de6f844810601 100644 (file)
@@ -1,4 +1,4 @@
-;;; dom.el --- XML/HTML (etc.) DOM manipulation and searching functions
+;;; dom.el --- XML/HTML (etc.) DOM manipulation and searching functions -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
 
index a7c4cce741f8e2c8ba90e525ba7a635a3d0b9ef0..15090e1f94a6adadc12e90e408d186b92aa3936e 100644 (file)
@@ -1,4 +1,4 @@
-;;; faces.el --- Lisp faces
+;;; faces.el --- Lisp faces -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1992-1996, 1998-2016 Free Software Foundation, Inc.
 
index 8cbe3c1dc9e4c2597d7a943bd68074603d54478a..52bc36e360605c20be3d075aac535ab58c3db23d 100644 (file)
@@ -1,4 +1,4 @@
-;;; htmlfontify.el --- htmlize a buffer/source tree with optional hyperlinks
+;;; htmlfontify.el --- htmlize a buffer/source tree with optional hyperlinks -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2002-2003, 2009-2016 Free Software Foundation, Inc.
 
@@ -1805,8 +1805,7 @@ It is assumed that STRING has text properties that allow it to be
 fontified.  This is a simple convenience wrapper around
 `htmlfontify-buffer'."
   (let* ((hfy-optimizations-1 (copy-sequence hfy-optimizations))
-         (hfy-optimizations (add-to-list 'hfy-optimizations-1
-                                         'skip-refontification)))
+         (hfy-optimizations (pushnew 'skip-refontification hfy-optimizations-1)))
     (with-temp-buffer
       (insert string)
       (htmlfontify-buffer)
index cafc0e4b06a54bf94eb93853e5efe2e8706e6b06..81a2a5a01678853bf0c44a253fb9cdf8898ff186 100644 (file)
@@ -1,4 +1,4 @@
-;;; info-xref.el --- check external references in an Info document
+;;; info-xref.el --- check external references in an Info document -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2003-2016 Free Software Foundation, Inc.
 
index 39ed8af370255ff664de2e7bf9c282a7eee2780b..ce87d1bac3c8a6fbe7c6f7e9cb98e8e55d903f29 100644 (file)
@@ -1,4 +1,4 @@
-;;; isearch.el --- incremental search minor mode
+;;; isearch.el --- incremental search minor mode -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1992-1997, 1999-2016 Free Software Foundation, Inc.
 
index d127decfebd8497411944ae66f67972d577ee225..0f3c4ba98e87050bcc177b4ddc321ccfb65e4df1 100644 (file)
@@ -1,4 +1,4 @@
-;;; man.el --- browse UNIX manual pages
+;;; man.el --- browse UNIX manual pages -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1993-1994, 1996-1997, 2001-2016 Free Software
 ;; Foundation, Inc.
index 60016285e7cc626fbe4ab00e13048bdbaf6790ac..fbb61b53e73fd6a8d529804d6c3949c339046e76 100644 (file)
@@ -1,4 +1,4 @@
-;;; ps-def.el --- XEmacs and Emacs definitions for ps-print
+;;; ps-def.el --- XEmacs and Emacs definitions for ps-print -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
index 54ffe2874dff69b9ea850992280f247949669433..6c2a8c6161aada31f78b0edd497a4ae758f36aa3 100644 (file)
@@ -1,4 +1,4 @@
-;;; ps-print.el --- print text from the buffer as PostScript
+;;; ps-print.el --- print text from the buffer as PostScript -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1993-2016 Free Software Foundation, Inc.
 
index e6124f44c9fc620cb5bb46d552a6afccc87450bb..42567516e479692ce9503ccfc78ddc16e54a04da 100644 (file)
@@ -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))
index 8bc71388ad5642c020e862dd2903c9b434521961..7f8acfc9b83ea3d238bce97981cd6bf4745d5c72 100644 (file)
@@ -1,4 +1,4 @@
-;;; sort.el --- commands to sort text in an Emacs buffer
+;;; sort.el --- commands to sort text in an Emacs buffer -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1986-1987, 1994-1995, 2001-2016 Free Software
 ;; Foundation, Inc.
index 414300cb40207259c7de62d90f8572447c5c0ed0..2563c13094fe4609ae7fe25cd38cdc7fe690ae4b 100644 (file)
@@ -1,4 +1,4 @@
-;;; xml.el --- XML parser
+;;; xml.el --- XML parser -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2000-2016 Free Software Foundation, Inc.
 
@@ -401,9 +401,9 @@ Both features can be combined by providing a cons cell
                     parse-dtd)
                (setq dtd (car result))
                (if (cdr result)        ; possible leading comment
-                   (add-to-list 'xml (cdr result))))
+                   (push (cdr result) xml)))
               (t
-               (add-to-list 'xml result))))
+               (push result xml))))
          (goto-char (point-max))))
       (if parse-dtd
          (cons dtd (nreverse xml))
index a2b64019f97ccbe8bd98c066b066dfec642ed47d..5fb977d99e56d6ecee2750287f83cb64fe69e88c 100644 (file)
@@ -1,4 +1,4 @@
-;;; xt-mouse.el --- support the mouse when emacs run in an xterm
+;;; xt-mouse.el --- support the mouse when emacs run in an xterm -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1994, 2000-2016 Free Software Foundation, Inc.