[Top][All Lists]

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

Question about dired-map-over-marks-check

From: Pascal Quesseveur
Subject: Question about dired-map-over-marks-check
Date: Fri, 06 Jun 2008 14:54:57 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt)


I am trying to set a command in dired which will operate on marked
files. I use the following code in an interactive function:

| (dired-map-over-marks-check (function my-dired-func) arg 'do-something t)

Function my-dired-func tries to delete one file by calling an external
command, sdelete on Windows or shred on others systems. That function
return nil when successed, and file when file has not been deleted.

| (defun my-dired-func ()
|   (let ((file (dired-get-filename)))
|     (if (eq 'windows-nt system-type)
|         (call-process "sdelete" nil "*Messages*" nil file)
|       (call-process "shred" nil "*Messages*" nil file
|                     "--remove" "--verbose"))
|     (if (file-exists-p file)
|         (progn
|           (dired-log (concat "Failed to delete " file "\n")
|           file))
|       (dired-remove-entry file)
|       nil)))

The problem is the following. When there is more than one marked file,
only the first file is removed. When I supress the call to
(dired-remove-entry) the command works fine. So clearly the problem is
caused by the dired buffer modification, But I can't figure to make it


Pascal Quesseveur

reply via email to

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