aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-04-03 17:23:23 -0400
committerChong Yidong2011-04-03 17:23:23 -0400
commit0d9e9a12cad5d96845fdb03ff20ab47dc081d435 (patch)
tree84e0733b4459442bee6dc2213a31d8a841f18248
parent43c594f2287d9e0f65b971bc64d296d4dc6b7229 (diff)
downloademacs-0d9e9a12cad5d96845fdb03ff20ab47dc081d435.tar.gz
emacs-0d9e9a12cad5d96845fdb03ff20ab47dc081d435.zip
* lisp/dired-aux.el (dired-create-files): Add docstring (Bug#7970).
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/dired-aux.el39
2 files changed, 19 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fe429f6f161..ceafa680aaf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12011-04-03 Chong Yidong <cyd@stupidchicken.com> 12011-04-03 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * dired-aux.el (dired-create-files): Add docstring (Bug#7970).
4
3 * textmodes/flyspell.el (flyspell-word): Recognize default 5 * textmodes/flyspell.el (flyspell-word): Recognize default
4 dictionary case for flyspell-mark-duplications-exceptions. Use 6 dictionary case for flyspell-mark-duplications-exceptions. Use
5 regexp matching for languages. 7 regexp matching for languages.
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 9ab1fcb0e2b..6ff7ff7d77d 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1363,33 +1363,28 @@ Special value `always' suppresses confirmation."
1363;; The basic function for half a dozen variations on cp/mv/ln/ln -s. 1363;; The basic function for half a dozen variations on cp/mv/ln/ln -s.
1364(defun dired-create-files (file-creator operation fn-list name-constructor 1364(defun dired-create-files (file-creator operation fn-list name-constructor
1365 &optional marker-char) 1365 &optional marker-char)
1366 "Create one or more new files from a list of existing files FN-LIST.
1367This function also handles querying the user, updating Dired
1368buffers, and displaying a success or failure message.
1366 1369
1367;; Create a new file for each from a list of existing files. The user 1370FILE-CREATOR should be a function. It is called once for each
1368;; is queried, dired buffers are updated, and at the end a success or 1371file in FN-LIST, and must create a new file, querying the user
1369;; failure message is displayed 1372and updating Dired buffers as necessary. It should accept three
1373arguments: the old file name, the new name, and an argument
1374OK-IF-ALREADY-EXISTS with the same meaning as in `copy-file'.
1370 1375
1371;; FILE-CREATOR must accept three args: oldfile newfile ok-if-already-exists 1376OPERATION should be a capitalized string describing the operation
1377performed (e.g. `Copy'). It is used for error logging.
1372 1378
1373;; It is called for each file and must create newfile, the entry of 1379FN-LIST is the list of files to copy (full absolute file names).
1374;; which will be added. The user will be queried if the file already
1375;; exists. If oldfile is removed by FILE-CREATOR (i.e, it is a
1376;; rename), it is FILE-CREATOR's responsibility to update dired
1377;; buffers. FILE-CREATOR must abort by signaling a file-error if it
1378;; could not create newfile. The error is caught and logged.
1379 1380
1380;; OPERATION (a capitalized string, e.g. `Copy') describes the 1381NAME-CONSTRUCTOR should be a function accepting a single
1381;; operation performed. It is used for error logging. 1382argument, the name of an old file, and returning either the
1382 1383corresponding new file name or nil to skip.
1383;; FN-LIST is the list of files to copy (full absolute file names).
1384
1385;; NAME-CONSTRUCTOR returns a newfile for every oldfile, or nil to
1386;; skip. If it skips files for other reasons than a direct user
1387;; query, it is supposed to tell why (using dired-log).
1388
1389;; Optional MARKER-CHAR is a character with which to mark every
1390;; newfile's entry, or t to use the current marker character if the
1391;; oldfile was marked.
1392 1384
1385Optional MARKER-CHAR is a character with which to mark every
1386newfile's entry, or t to use the current marker character if the
1387old file was marked."
1393 (let (dired-create-files-failures failures 1388 (let (dired-create-files-failures failures
1394 skipped (success-count 0) (total (length fn-list))) 1389 skipped (success-count 0) (total (length fn-list)))
1395 (let (to overwrite-query 1390 (let (to overwrite-query