From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Quesseveur Newsgroups: gmane.emacs.help Subject: Question about dired-map-over-marks-check Date: Fri, 06 Jun 2008 14:54:57 +0200 Organization: Les Enchantements de Miraldra Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212764557 26187 80.91.229.12 (6 Jun 2008 15:02:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Jun 2008 15:02:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 06 17:03:19 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K4dSk-0005LL-1i for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jun 2008 17:02:42 +0200 Original-Received: from localhost ([127.0.0.1]:33240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4dRx-0007Al-Et for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jun 2008 11:01:53 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp8-2.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) X-Attribution: PQsr Cancel-Lock: sha1:AYGHND6y6/Ro2H61SUK90P2Ht1k= Original-Lines: 40 Original-NNTP-Posting-Date: 06 Jun 2008 14:55:05 MEST Original-NNTP-Posting-Host: 82.255.44.210 Original-X-Trace: 1212756905 news-2.free.fr 10858 82.255.44.210:49519 Original-X-Complaints-To: abuse@proxad.net Original-Xref: news.stanford.edu gnu.emacs.help:159162 X-Mailman-Approved-At: Fri, 06 Jun 2008 10:50:14 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54527 Archived-At: 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