Re: Suppress directory not empty message



On Mon, 09 Sep 2013 05:00:03 -0700, <mc-request gnome org> wrote:


Message: 1
Date: Wed, 4 Sep 2013 17:32:33 +0200
From: Marco <lists homerow info>
To: mc gnome org
Subject: Re: Suppress directory not empty message
Message-ID: <20130904153233 GC27101 homerow>
Content-Type: text/plain; charset="utf-8"

On 2013?08?05 Marco wrote:

When deleting a directory tree mc displays the following message:

  Delete directory "<directory>"?

  [Yes] [No]

I hit ?Yes?, then another message pops up:

  Directory not empty.
  Delete it recursively?

  [Yes] [No] [All] [None] [Abort]

I hit ?All? since I want to delete the entire tree. This is very
cumbersome. Is is possible to suppress both messages entirely or at
least suppress the second message?

Is it possible to suppress the deletion window displaying the
deleted files list with the [Skip] [Abort] buttons as well? Since
the deletion/copy/move processes often take several minutes, mc
becomes totally unusable until those operations are finished. The
only way to continue working is to open up a second mc instance.

I couldn't find anything relevant in the manual.

So apparently there is no way of suppressing those messages?

Marco

I can think of 2 options:

1. Write a special dialog where the user can choose which dialogs
get shown, and which don't. I believe there is more to this than
meets the eye. Easier said than done, as they say. Which dialogs
should be optional, and what should they default to if they don't
get shown?

2. Hack your source and comment out the offending dialog calls.
I have done this myself with the "Edit extension file" dialog
where it always asks "[Local] [User] [System Wide]".
The only one I ever edit is [User], so I made it skip the dialog
and go for that one automatically. Hey, that's what having
the source code means to me:)

I, for one, very much appreciate the second 'Directory not empty'
dialog, because my usual habits are to go through work directories
once in a while on garbage cleanup duty. Accidentally removing a
sprawling subtree seems to me far worse than having to hit ENTER
one more time.

As an addendum, after a quick peek at the source, in
filemanager/file.c, you could just add a line 672:

ctx->recursive_result = RECURSIVE_ALWAYS;

cd ../..; make; make install

It will never pester you again. And from the look of things,
someone has already done this before, otherwise line 673
wouldn't even ask. So there is likely others who make this
one of their favorite first hacks when they get new code.
As a matter of fact,

    if (ctx->recursive_result < RECURSIVE_ALWAYS) {
        ... show dialog ...
    }

goes back to at least 4.6 in 2005. I don't have any mc source
code left from before that date.

--
Peace and Cheer


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