all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* shell-quote-argument seems quoting backup files incorrectly
@ 2009-08-13 12:36 Jin Huang
  2009-08-15 11:48 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Jin Huang @ 2009-08-13 12:36 UTC (permalink / raw)
  To: help-gnu-emacs


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?

Best regards.

Jin Huang





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: shell-quote-argument seems quoting backup files incorrectly
  2009-08-13 12:36 shell-quote-argument seems quoting backup files incorrectly Jin Huang
@ 2009-08-15 11:48 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2009-08-15 11:48 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-15 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-13 12:36 shell-quote-argument seems quoting backup files incorrectly Jin Huang
2009-08-15 11:48 ` Kevin Rodgers

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.