]> code.delx.au - gnu-emacs/blobdiff - lisp/wdired.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / wdired.el
index 59a09d6d5a07e4169bb6568ce6903b85e25095a1..9f258794f96eff17525557aa5c557463230338cd 100644 (file)
@@ -1,9 +1,9 @@
 ;;; wdired.el --- Rename files editing their names in dired buffers
 
-;; Copyright (C) 2004-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2016 Free Software Foundation, Inc.
 
 ;; Filename: wdired.el
-;; Author: Juan León Lahoz García <juanleon1@gmail.com>
+;; Author: Juan León Lahoz García <juanleon1@gmail.com>
 ;; Version: 2.0
 ;; Keywords: dired, environment, files, renaming
 
@@ -73,8 +73,6 @@
 
 ;;; Code:
 
-(defvar dired-backup-overwrite) ; Only in Emacs 20.x this is a custom var
-
 (require 'dired)
 (autoload 'dired-do-create-files-regexp "dired-aux")
 
@@ -185,7 +183,8 @@ renamed by `dired-do-rename' and `dired-do-rename-regexp'."
     (define-key map [remap capitalize-word] 'wdired-capitalize-word)
     (define-key map [remap downcase-word] 'wdired-downcase-word)
 
-    map))
+    map)
+  "Keymap used in `wdired-mode'.")
 
 (defvar wdired-mode-hook nil
   "Hooks run when changing to WDired mode.")
@@ -239,8 +238,8 @@ See `wdired-mode'."
        (dired-remember-marks (point-min) (point-max)))
   (set (make-local-variable 'wdired-old-point) (point))
   (set (make-local-variable 'query-replace-skip-read-only) t)
-  (set (make-local-variable 'isearch-filter-predicate)
-       'wdired-isearch-filter-read-only)
+  (add-function :after-while (local 'isearch-filter-predicate)
+                #'wdired-isearch-filter-read-only)
   (use-local-map wdired-mode-map)
   (force-mode-line-update)
   (setq buffer-read-only nil)
@@ -268,9 +267,8 @@ or \\[wdired-abort-changes] to abort changes")))
 
 (defun wdired-isearch-filter-read-only (beg end)
   "Skip matches that have a read-only property."
-  (and (isearch-filter-visible beg end)
-       (not (text-property-not-all (min beg end) (max beg end)
-                                  'read-only nil))))
+  (not (text-property-not-all (min beg end) (max beg end)
+                             'read-only nil)))
 
 ;; Protect the buffer so only the filenames can be changed, and put
 ;; properties so filenames (old and new) can be easily found.
@@ -496,8 +494,8 @@ non-nil means return old filename."
                                        overwrite))
                 (error
                  (setq errors (1+ errors))
-                 (dired-log (concat "Rename `" file-ori "' to `"
-                                    file-new "' failed:\n%s\n")
+                 (dired-log "Rename `%s' to `%s' failed:\n%s\n"
+                            file-ori file-new
                             err)))))))))
     errors))
 
@@ -653,8 +651,8 @@ If OLD, return the old target.  If MOVE, move point before it."
                (substitute-in-file-name link-to-new) link-from))
           (error
            (setq errors (1+ errors))
-           (dired-log (concat "Link `" link-from "' to `"
-                              link-to-new "' failed:\n%s\n")
+           (dired-log "Link `%s' to `%s' failed:\n%s\n"
+                      link-from link-to-new
                       err)))))
     (cons changes errors)))
 
@@ -839,11 +837,11 @@ Like original function but it skips read-only words."
               (unless (equal 0 (process-file dired-chmod-program
                                             nil nil nil perm-tmp filename))
                 (setq errors (1+ errors))
-                (dired-log (concat dired-chmod-program " " perm-tmp
-                                   " `" filename "' failed\n\n"))))
+                (dired-log "%s %s `%s' failed\n\n"
+                           dired-chmod-program perm-tmp filename)))
           (setq errors (1+ errors))
-          (dired-log (concat "Cannot parse permission `" perms-new
-                             "' for file `" filename "'\n\n"))))
+          (dired-log "Cannot parse permission `%s' for file `%s'\n\n"
+                     perms-new filename)))
       (goto-char (next-single-property-change (1+ (point)) prop-wanted
                                              nil (point-max))))
     (cons changes errors)))
@@ -851,7 +849,6 @@ Like original function but it skips read-only words."
 (provide 'wdired)
 
 ;; Local Variables:
-;; coding: latin-1
 ;; byte-compile-dynamic: t
 ;; End: