]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/dired-x.el (dired-mark-sexp): Bind the vars lexically rather
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 6 Sep 2013 21:12:22 +0000 (17:12 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 6 Sep 2013 21:12:22 +0000 (17:12 -0400)
than dynamically.

lisp/ChangeLog
lisp/dired-x.el

index ca487ad2fefdfade62a27516cf752659661ff0f7..4b6245d5791ddaf7067aefd4267fd58dddcca4ed 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * dired-x.el (dired-mark-sexp): Bind the vars lexically rather
+       than dynamically.
+
 2013-09-06  Juri Linkov  <juri@jurta.org>
 
        * info.el (Info-display-images-node): When image file doesn't exist
index 3527a3fc756acb4198118e67bad11db61b243a7e..c6ecbf1e718edf27bdbe23329559ef26d8e30af3 100644 (file)
@@ -1,4 +1,4 @@
-;;; dired-x.el --- extra Dired functionality
+;;; dired-x.el --- extra Dired functionality  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1993-1994, 1997, 2001-2013 Free Software Foundation,
 ;; Inc.
@@ -1185,7 +1185,7 @@ results in
           (setq count (1+ count)
                 start (1+ start)))
         ;; ... and prepend a "../" for each slash found:
-        (dotimes (n count)
+        (dotimes (_ count)
           (setq name1 (concat "../" name1)))))
     (make-symbolic-link
      (directory-file-name name1)        ; must not link to foo/
@@ -1397,22 +1397,6 @@ Considers buffers closer to the car of `buffer-list' to be more recent."
 ;; Does anyone use this? - lrd 6/29/93.
 ;; Apparently people do use it. - lrd 12/22/97.
 
-(with-no-warnings
-  ;; Warnings are suppressed to avoid "global/dynamic var `X' lacks a prefix".
-  ;; This is unbearably ugly, but not more than having global variables
-  ;; named size, time, name or s, however practical it can be while writing
-  ;; `dired-mark-sexp' predicates.
-  (defvar inode)
-  (defvar s)
-  (defvar mode)
-  (defvar nlink)
-  (defvar uid)
-  (defvar gid)
-  (defvar size)
-  (defvar time)
-  (defvar name)
-  (defvar sym))
-
 (defun dired-mark-sexp (predicate &optional unflag-p)
   "Mark files for which PREDICATE returns non-nil.
 With a prefix arg, unmark or unflag those files instead.
@@ -1505,7 +1489,17 @@ to mark all zero length files."
                                           (line-end-position))
                       ""))
           t)
-        (eval predicate)))
+        (eval predicate
+              `((inode . ,inode)
+                (s . ,s)
+                (mode . ,mode)
+                (nlink . ,nlink)
+                (uid . ,uid)
+                (gid . ,gid)
+                (size . ,size)
+                (time . ,time)
+                (name . ,name)
+                (sym . ,sym)))))
      (format "'%s file" predicate))))
 
 \f