[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] browser: remove opendir() for KEY_WINCH
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] [PATCH] browser: remove opendir() for KEY_WINCH |
Date: |
Wed, 29 Jun 2016 21:38:43 +0200 |
On Wed, Jun 29, 2016, at 16:27, Rishabh Dave wrote:
> On Tue, Jun 28, 2016 at 3:38 PM, Benno Schulenberg
> <address@hidden> wrote:
> > First, the goal is to remove duplicated code, and what you do is
> > add other duplicated code. :|
>
> Stuff around "present_name" were mistakes, but do you hold same for
> the code "newpath = strdup(present_path); goto
> read_directory_contents;"?
Yes.
See attached first patch. That is what I expected to see.
And then the second patch as a refinement, getting rid
of that weird presetting of kbinput.
> implying do you mean to remove /only/
> opendir from KEY_WINCH and nothing else.
Right.
> > Sixth,
> > if ((path == NULL || dir == NULL) && kbinput != KEY_WINCH)
> > bwah, that is ugly -- an error message should not depend on
> > what "key" is pressed.
>
> Asking out of curiosity, why so?
Can't explain. Just seems silly -- hitting keys has nothing to
do with whether a directory is accessible or not. (But of course
key_winch is not a real key, but still... it looks silly.)
> > Also, try this:
> > src/nano, and then type ^R ^T M-G doc <Enter>
> > In another terminal do: chmod a-x doc
> > Change the size of the window of nano, then type ^L
> > or ^G ^G. For some reason you are now in the parent
> > dir, at its last file. ??
>
> That was side effect of my addition here - "if ((path == NULL || dir
> == NULL) && kbinput != KEY_WINCH)".
You see? It wasn't even correct, it was creating unwanted effects.
> Following is problem which I don't know how to tackle -
>
> Currently if you change window size (with patch applied) an error
> message appears saying - "Cannot open directory: Unknown error 1048"
Sorry, I haven't tried your patch, as it is the wrong approach,
in my opinion.
Now see if you can break my patches.
That is: find a case where they go wrong.
(I don't think there is, so if you find one, you will surprise me.)
Benno
--
http://www.fastmail.com - A no graphics, no pop-ups email service
0001-browser-elide-an-opendir.patch
Description: Text Data
0002-browser-move-stuff-to-the-end-of-the-loop.patch
Description: Text Data