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.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/dired.el
Date: Sun, 16 Dec 2001 20:58:06 -0500

Index: emacs/lisp/dired.el
diff -c emacs/lisp/dired.el:1.214 emacs/lisp/dired.el:1.215
*** emacs/lisp/dired.el:1.214   Tue Nov 27 10:52:52 2001
--- emacs/lisp/dired.el Sun Dec 16 20:58:05 2001
***************
*** 962,967 ****
--- 962,968 ----
      (define-key map "t" 'dired-do-toggle)
      (define-key map "u" 'dired-unmark)
      (define-key map "v" 'dired-view-file)
+     (define-key map "w" 'dired-copy-filename-as-kill)
      (define-key map "x" 'dired-do-flagged-delete)
      (define-key map "y" 'dired-show-file-type)
      (define-key map "+" 'dired-create-directory)
***************
*** 1630,1635 ****
--- 1631,1665 ----
      (if (eq opoint (point))
        nil
        (point))))
+ 
+ 
+ ;;; COPY NAMES OF MARKED FILES INTO KILL-RING.
+ 
+ (defun dired-copy-filename-as-kill (&optional arg)
+   "Copy names of marked (or next ARG) files into the kill ring.
+ The names are separated by a space.
+ With a zero prefix arg, use the complete pathname of each marked file.
+ With \\[universal-argument], use the relative pathname of each marked file.
+ 
+ If on a subdir headerline, use subdirname instead; prefix arg is ignored
+ in this case.
+ 
+ You can then feed the file name(s) to other commands with \\[yank]."
+   (interactive "P")
+   (let ((string
+          (or (dired-get-subdir)
+              (mapconcat (function identity)
+                         (if arg
+                             (cond ((zerop (prefix-numeric-value arg))
+                                    (dired-get-marked-files))
+                                   ((integerp arg)
+                                    (dired-get-marked-files 'no-dir arg))
+                                   (t    ; else a raw arg
+                                    (dired-get-marked-files t)))
+                           (dired-get-marked-files 'no-dir))
+                         " "))))
+     (kill-new string)
+     (message "%s" string)))
  
  
  ;; Keeping Dired buffers in sync with the filesystem and with each other



reply via email to

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