[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shell commands in deleted directories
From: |
Ted Zlatanov |
Subject: |
Re: Shell commands in deleted directories |
Date: |
Mon, 14 Feb 2011 09:00:05 -0600 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
On Sun, 13 Feb 2011 23:05:56 +0100 Antoine Levitt <address@hidden> wrote:
AL> 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.
AL> I wasn't suggesting it be merged after the objection Paul raised (see
AL> the other half of my post).
I agreed with you :)
AL> In the end, it's probably better to be handled by the user or by
AL> error-catching from calling code. Maybe there should be some kind of
AL> checks when creating new buffers though? Like if a new buffer is
AL> created that isn't associated with a file, then if its pwd doesn't
AL> exist, it's reset to ~/?
There are many situations where this solution would be a problem. I
don't know if there is a good solution that doesn't involve lots of
error-catching at some level.
Ted
Re: Shell commands in deleted directories, Eli Zaretskii, 2011/02/13
Re: Shell commands in deleted directories, Stefan Monnier, 2011/02/14