]> code.delx.au - gnu-emacs/blobdiff - lisp/dired.el
w32.c (sys_open): Don't reset the flags for FD in fd_info[].
[gnu-emacs] / lisp / dired.el
index fb2f7281130f052602cf92766c856f61611656f1..76809f992cc1d6688b7fd7f58d36c9e7e882a930 100644 (file)
@@ -1,7 +1,7 @@
 ;;; dired.el --- directory-browsing commands -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1992-1997, 2000-2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-1997, 2000-2013 Free Software
+;; Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;; Maintainer: FSF
@@ -137,9 +137,12 @@ A value of t means move to first file."
   "Controls marking of renamed files.
 If t, files keep their previous marks when they are renamed.
 If a character, renamed files (whether previously marked or not)
-are afterward marked with that character."
+are afterward marked with that character.
+This option affects only files renamed by `dired-do-rename' and
+`dired-do-rename-regexp'.  See `wdired-keep-marker-rename'
+if you want to do the same for files renamed in WDired mode."
   :type '(choice (const :tag "Keep" t)
-                (character :tag "Mark"))
+                (character :tag "Mark" :value ?R))
   :group 'dired-mark)
 
 (defcustom dired-keep-marker-copy ?C
@@ -617,12 +620,14 @@ Optional third argument FILTER, if non-nil, is a function to select
 If DISTINGUISH-ONE-MARKED is non-nil, then if we find just one marked file,
 return (t FILENAME) instead of (FILENAME).
 Don't use that together with FILTER."
-  (let* ((all-of-them
-         (save-excursion
-           (dired-map-over-marks
-            (dired-get-filename localp 'no-error-if-not-filep)
-            arg nil distinguish-one-marked)))
-        result)
+  (let ((all-of-them
+        (save-excursion
+          (delq nil (dired-map-over-marks
+                     (dired-get-filename localp 'no-error-if-not-filep)
+                     arg nil distinguish-one-marked))))
+       result)
+    (when (equal all-of-them '(t))
+      (setq all-of-them nil))
     (if (not filter)
        (if (and distinguish-one-marked (eq (car all-of-them) t))
            all-of-them
@@ -3106,7 +3111,7 @@ argument or confirmation)."
            (insert dired-marker-char)))
       (forward-line 1))))
 
-(defun dired-mark (arg)
+(defun dired-mark (arg &optional interactive)
   "Mark the file at point in the Dired buffer.
 If the region is active, mark all files in the region.
 Otherwise, with a prefix arg, mark files on the next ARG lines.
@@ -3116,10 +3121,10 @@ If on a subdir headerline, mark all its files except `.' and `..'.
 Use \\[dired-unmark-all-files] to remove all marks
 and \\[dired-unmark] on a subdir to remove the marks in
 this subdir."
-  (interactive "P")
+  (interactive (list current-prefix-arg t))
   (cond
    ;; Mark files in the active region.
-   ((and transient-mark-mode mark-active)
+   ((and interactive (use-region-p))
     (save-excursion
       (let ((beg (region-beginning))
            (end (region-end)))
@@ -3136,7 +3141,7 @@ this subdir."
        (prefix-numeric-value arg)
        (function (lambda () (delete-char 1) (insert dired-marker-char))))))))
 
-(defun dired-unmark (arg)
+(defun dired-unmark (arg &optional interactive)
   "Unmark the file at point in the Dired buffer.
 If the region is active, unmark all files in the region.
 Otherwise, with a prefix arg, unmark files on the next ARG lines.
@@ -3144,11 +3149,11 @@ Otherwise, with a prefix arg, unmark files on the next ARG lines.
 If looking at a subdir, unmark all its files except `.' and `..'.
 If the region is active in Transient Mark mode, unmark all files
 in the active region."
-  (interactive "P")
+  (interactive (list current-prefix-arg t))
   (let ((dired-marker-char ?\040))
-    (dired-mark arg)))
+    (dired-mark arg interactive)))
 
-(defun dired-flag-file-deletion (arg)
+(defun dired-flag-file-deletion (arg &optional interactive)
   "In Dired, flag the current line's file for deletion.
 If the region is active, flag all files in the region.
 Otherwise, with a prefix arg, flag files on the next ARG lines.
@@ -3156,9 +3161,9 @@ Otherwise, with a prefix arg, flag files on the next ARG lines.
 If on a subdir headerline, flag all its files except `.' and `..'.
 If the region is active in Transient Mark mode, flag all files
 in the active region."
-  (interactive "P")
+  (interactive (list current-prefix-arg t))
   (let ((dired-marker-char dired-del-marker))
-    (dired-mark arg)))
+    (dired-mark arg interactive)))
 
 (defun dired-unmark-backward (arg)
   "In Dired, move up lines and remove marks or deletion flags there.
@@ -3788,7 +3793,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
 ;;;;;;  dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
 ;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
 ;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "244227ae609852d3dc10ab3fc40ba9ab")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "066bb17769887a7fbc0490003f59e4b3")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
@@ -4291,7 +4296,7 @@ instead.
 ;;;***
 \f
 ;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
-;;;;;;  "dired-x" "dired-x.el" "a4e6844421c2c5e6fde90e959fbcc26f")
+;;;;;;  "dired-x" "dired-x.el" "ce753ade80ea9f4e64ab3569e3a5421e")
 ;;; Generated autoloads from dired-x.el
 
 (autoload 'dired-jump "dired-x" "\