all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Question about dired-map-over-marks-check
@ 2008-06-06 12:54 Pascal Quesseveur
  0 siblings, 0 replies; only message in thread
From: Pascal Quesseveur @ 2008-06-06 12:54 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

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

TIA.


-- 
Pascal Quesseveur
pascal.quesseveur@free.fr


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-06 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06 12:54 Question about dired-map-over-marks-check Pascal Quesseveur

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.