help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: shell-quote-argument seems quoting backup files incorrectly


From: Kevin Rodgers
Subject: Re: shell-quote-argument seems quoting backup files incorrectly
Date: Sat, 15 Aug 2009 05:48:18 -0600
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

Jin Huang wrote:

Dear All,

I just set my emacs (GNU Emacs 23.0.91.1) to use the system (Ubuntu
9.04) trash.  It works fine for most of the file, however cannot move
backup files (with ~ in the end of the file name) into trash, even
cannot delete it.

I followed the instruction from
http://www.emacswiki.org/emacs/SystemTrash.  Then I shrunk the code
for the minimal set to reproduce the problem:

========== Code A ==========
(setq delete-by-moving-to-trash t)
(defun system-move-file-to-trash (filename)
   (call-process "gvfs-trash" nil nil nil filename))

========== Code B ==========
(setq delete-by-moving-to-trash t)
(defun system-move-file-to-trash (filename)
   (call-process "gvfs-trash" nil nil nil (shell-quote-argument filename)))

Code A can move the backup file into trash correctly, however Code B
cannot.

One possible reason is that the backup suffix "~" mixes up with the
notation for home directory.

Is there any solution?

call-process does not invoke the shell, so you should not use
shell-quote-argument with it (cf. call-process-shell-command
and shell-command).

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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