[Top][All Lists]

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

Re: Shell commands in deleted directories

From: Antoine Levitt
Subject: Re: Shell commands in deleted directories
Date: Sun, 13 Feb 2011 23:05:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

13/02/11 22:34, Ted Zlatanov
> On Sun, 13 Feb 2011 22:21:38 +0100 Antoine Levitt <address@hidden> wrote: 
> AL> 13/02/11 22:07, Paul Eggert
>>> On 02/13/2011 01:02 PM, Antoine Levitt wrote:
>>>> +  /* If current_dir is unreachable (typically, does not exist), use
>>>> +     ~/ as default */
>>> This looks like a bad idea.  Suppose I run the shell
>>> command "rm *" in a deleted directory?
>>> The change would cause me to remove files in
>>> my home directory.  Better safe than sorry.
> AL> Mmh, true. But then again, if you're using "rm *" as a shell command
> AL> without being absolutely sure where you are, you're just asking for
> AL> trouble.
> I am strongly against this kind of surprise and hope it doesn't go into
> Emacs.

I wasn't suggesting it be merged after the objection Paul raised (see
the other half of my post). In the end, it's probably better to be
handled by the user or by error-catching from calling code. Maybe there
should be some kind of checks when creating new buffers though? Like if
a new buffer is created that isn't associated with a file, then if its
pwd doesn't exist, it's reset to ~/?

reply via email to

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