emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/dired-aux.el


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/dired-aux.el
Date: Tue, 14 Jan 2003 18:11:44 -0500

Index: emacs/lisp/dired-aux.el
diff -c emacs/lisp/dired-aux.el:1.107 emacs/lisp/dired-aux.el:1.108
*** emacs/lisp/dired-aux.el:1.107       Mon Nov 11 06:44:05 2002
--- emacs/lisp/dired-aux.el     Tue Jan 14 18:11:42 2003
***************
*** 1417,1429 ****
  ;;; 5K
  ;;;###begin dired-re.el
  (defun dired-do-create-files-regexp
!   (file-creator operation arg regexp newname &optional whole-path marker-char)
    ;; Create a new file for each marked file using regexps.
    ;; FILE-CREATOR and OPERATION as in dired-create-files.
    ;; ARG as in dired-get-marked-files.
    ;; Matches each marked file against REGEXP and constructs the new
    ;;   filename from NEWNAME (like in function replace-match).
!   ;; Optional arg WHOLE-PATH means match/replace the whole file name
    ;;   instead of only the non-directory part of the file.
    ;; Optional arg MARKER-CHAR as in dired-create-files.
    (let* ((fn-list (dired-get-marked-files nil arg))
--- 1417,1429 ----
  ;;; 5K
  ;;;###begin dired-re.el
  (defun dired-do-create-files-regexp
!   (file-creator operation arg regexp newname &optional whole-name marker-char)
    ;; Create a new file for each marked file using regexps.
    ;; FILE-CREATOR and OPERATION as in dired-create-files.
    ;; ARG as in dired-get-marked-files.
    ;; Matches each marked file against REGEXP and constructs the new
    ;;   filename from NEWNAME (like in function replace-match).
!   ;; Optional arg WHOLE-NAME means match/replace the whole file name
    ;;   instead of only the non-directory part of the file.
    ;; Optional arg MARKER-CHAR as in dired-create-files.
    (let* ((fn-list (dired-get-marked-files nil arg))
***************
*** 1436,1442 ****
                                          (downcase operation)))
         (regexp-name-constructor
          ;; Function to construct new filename using REGEXP and NEWNAME:
!         (if whole-path                ; easy (but rare) case
              (function
               (lambda (from)
                 (let ((to (dired-string-replace-match regexp from newname))
--- 1436,1442 ----
                                          (downcase operation)))
         (regexp-name-constructor
          ;; Function to construct new filename using REGEXP and NEWNAME:
!         (if whole-name                ; easy (but rare) case
              (function
               (lambda (from)
                 (let ((to (dired-string-replace-match regexp from newname))
***************
*** 1451,1457 ****
                            to)
                     (dired-log "%s: %s did not match regexp %s\n"
                                operation from regexp)))))
!           ;; not whole-path, replace non-directory part only
            (function
             (lambda (from)
               (let* ((new (dired-string-replace-match
--- 1451,1457 ----
                            to)
                     (dired-log "%s: %s did not match regexp %s\n"
                                operation from regexp)))))
!           ;; not whole-name, replace non-directory part only
            (function
             (lambda (from)
               (let* ((new (dired-string-replace-match
***************
*** 1474,1494 ****
  
  (defun dired-mark-read-regexp (operation)
    ;; Prompt user about performing OPERATION.
!   ;; Read and return list of: regexp newname arg whole-path.
!   (let* ((whole-path
          (equal 0 (prefix-numeric-value current-prefix-arg)))
         (arg
!         (if whole-path nil current-prefix-arg))
         (regexp
          (dired-read-regexp
!          (concat (if whole-path "Path " "") operation " from (regexp): ")))
         (newname
          (read-string
!          (concat (if whole-path "Path " "") operation " " regexp " to: "))))
!     (list regexp newname arg whole-path)))
  
  ;;;###autoload
! (defun dired-do-rename-regexp (regexp newname &optional arg whole-path)
    "Rename selected files whose names match REGEXP to NEWNAME.
  
  With non-zero prefix argument ARG, the command operates on the next ARG
--- 1474,1494 ----
  
  (defun dired-mark-read-regexp (operation)
    ;; Prompt user about performing OPERATION.
!   ;; Read and return list of: regexp newname arg whole-name.
!   (let* ((whole-name
          (equal 0 (prefix-numeric-value current-prefix-arg)))
         (arg
!         (if whole-name nil current-prefix-arg))
         (regexp
          (dired-read-regexp
!          (concat (if whole-name "Abs. " "") operation " from (regexp): ")))
         (newname
          (read-string
!          (concat (if whole-name "Abs. " "") operation " " regexp " to: "))))
!     (list regexp newname arg whole-name)))
  
  ;;;###autoload
! (defun dired-do-rename-regexp (regexp newname &optional arg whole-name)
    "Rename selected files whose names match REGEXP to NEWNAME.
  
  With non-zero prefix argument ARG, the command operates on the next ARG
***************
*** 1505,1514 ****
    (interactive (dired-mark-read-regexp "Rename"))
    (dired-do-create-files-regexp
     (function dired-rename-file)
!    "Rename" arg regexp newname whole-path dired-keep-marker-rename))
  
  ;;;###autoload
! (defun dired-do-copy-regexp (regexp newname &optional arg whole-path)
    "Copy selected files whose names match REGEXP to NEWNAME.
  See function `dired-do-rename-regexp' for more info."
    (interactive (dired-mark-read-regexp "Copy"))
--- 1505,1514 ----
    (interactive (dired-mark-read-regexp "Rename"))
    (dired-do-create-files-regexp
     (function dired-rename-file)
!    "Rename" arg regexp newname whole-name dired-keep-marker-rename))
  
  ;;;###autoload
! (defun dired-do-copy-regexp (regexp newname &optional arg whole-name)
    "Copy selected files whose names match REGEXP to NEWNAME.
  See function `dired-do-rename-regexp' for more info."
    (interactive (dired-mark-read-regexp "Copy"))
***************
*** 1516,1540 ****
      (dired-do-create-files-regexp
       (function dired-copy-file)
       (if dired-copy-preserve-time "Copy [-p]" "Copy")
!      arg regexp newname whole-path dired-keep-marker-copy)))
  
  ;;;###autoload
! (defun dired-do-hardlink-regexp (regexp newname &optional arg whole-path)
    "Hardlink selected files whose names match REGEXP to NEWNAME.
  See function `dired-do-rename-regexp' for more info."
    (interactive (dired-mark-read-regexp "HardLink"))
    (dired-do-create-files-regexp
     (function add-name-to-file)
!    "HardLink" arg regexp newname whole-path dired-keep-marker-hardlink))
  
  ;;;###autoload
! (defun dired-do-symlink-regexp (regexp newname &optional arg whole-path)
    "Symlink selected files whose names match REGEXP to NEWNAME.
  See function `dired-do-rename-regexp' for more info."
    (interactive (dired-mark-read-regexp "SymLink"))
    (dired-do-create-files-regexp
     (function make-symbolic-link)
!    "SymLink" arg regexp newname whole-path dired-keep-marker-symlink))
  
  (defun dired-create-files-non-directory
    (file-creator basename-constructor operation arg)
--- 1516,1540 ----
      (dired-do-create-files-regexp
       (function dired-copy-file)
       (if dired-copy-preserve-time "Copy [-p]" "Copy")
!      arg regexp newname whole-name dired-keep-marker-copy)))
  
  ;;;###autoload
! (defun dired-do-hardlink-regexp (regexp newname &optional arg whole-name)
    "Hardlink selected files whose names match REGEXP to NEWNAME.
  See function `dired-do-rename-regexp' for more info."
    (interactive (dired-mark-read-regexp "HardLink"))
    (dired-do-create-files-regexp
     (function add-name-to-file)
!    "HardLink" arg regexp newname whole-name dired-keep-marker-hardlink))
  
  ;;;###autoload
! (defun dired-do-symlink-regexp (regexp newname &optional arg whole-name)
    "Symlink selected files whose names match REGEXP to NEWNAME.
  See function `dired-do-rename-regexp' for more info."
    (interactive (dired-mark-read-regexp "SymLink"))
    (dired-do-create-files-regexp
     (function make-symbolic-link)
!    "SymLink" arg regexp newname whole-name dired-keep-marker-symlink))
  
  (defun dired-create-files-non-directory
    (file-creator basename-constructor operation arg)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]