Re: auto save panels setup broken

2016-10-07 Thread Mike
Here's the patch for {setup.[ch], main.c, midnight.c} to fix the 
restoring of the directory contents of the active panel on startup when 
"Auto Save Panel Setup" option is enabled.


See attached 1341 byte gzip:

patch01-setup.ch-main.c-midnight.c-auto-save-restore-panel.161007.diff.gz

It works for me. With no command line directories and no auto save 
panels option it still uses current directory for active panel like always.



--
Peace and Cheer


patch01-setup.ch-main.c-midnight.c-auto-save-restore-panel.161007.diff.gz
Description: application/gzip
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: auto save panels setup broken

2016-10-07 Thread Mike
On closer inspection, saving and retrieving this_dir is a simple hack to 
setup.c, setup.h, and main.c. The real issue is what to do at startup.


In midnight.c:create_panels() around line 600, if command line arguments 
run_param0 and run_param1 are both NULL we assume this_panel (active 
panel) is the current directory, and that's the way it works. There is 
no check for auto_save_panels, and if so, restore the active saved 
directory.


This works to fix the issue:

[code]

if (boot_current_is_left)
{
/* left panel is active */
current_index = 0;
other_index = 1;
current_mode = startup_left_mode;
other_mode = startup_right_mode;

if (mc_run_param0 == NULL && mc_run_param1 == NULL)
{
/* no arguments */
if (panels_options.auto_save_setup) { /* check if we should 
restore active panel */

current_dir = saved_this_dir;
} else {
current_dir = NULL; /* assume current dir */
}
other_dir = saved_other_dir;/* from ini */
}
else if (mc_run_param0 != NULL && mc_run_param1 != NULL)
{
/* two arguments */
current_dir = (char *) mc_run_param0;
other_dir = mc_run_param1;
}
else/* mc_run_param0 != NULL && 
mc_run_param1 == NULL */

{
/* one argument */
current_dir = (char *) mc_run_param0;
other_dir = saved_other_dir;/* from ini */
}
}
else
{
/* right panel is active */
current_index = 1;
other_index = 0;
current_mode = startup_right_mode;
other_mode = startup_left_mode;

if (mc_run_param0 == NULL && mc_run_param1 == NULL)
{
/* no arguments */
if (panels_options.auto_save_setup) {
current_dir = saved_this_dir;
} else {
current_dir = NULL; /* assume current dir */
}
other_dir = saved_other_dir;/* from ini */
}
else if (mc_run_param0 != NULL && mc_run_param1 != NULL)
{
/* two arguments */
current_dir = (char *) mc_run_param0;
other_dir = mc_run_param1;
}
else/* mc_run_param0 != NULL && 
mc_run_param1 == NULL */

{
/* one argument */
current_dir = (char *) mc_run_param0;
other_dir = saved_other_dir;/* from ini */
}
}
[/code]

I can put it all together as a patch and post it if you like. Minor 
modifications to 4 files.



On 2016-10-07 07:03, Mike wrote:


Isn't that what F9 -> Options -> panel options -> auto save panels 
setup is for?


I believe OP is correct: mc forgets the active directory if you do 
have "auto save panels setup" selected.


$HOME/.config/mc/panels.ini:

[Dirs]
other_dir=/some/dir/somewhere
current_is_left=false

I think this file should be saved with:

this_dir=/some/dir

?

Whichever panel is active on shutdown, gets set back to $HOME on 
restart. This is not correct.


From a cursory look, it's a simple hack to setup.c. I guess it got 
overlooked because few people use that option.



On 2016-10-07 05:39, chris glur wrote:

  Also it doesn't remember the active panel on last
close was the right panel.

When, as usual, I've got several mc running: they all initially start with
the latest  conditions.

If I rarely, change the format-order of a mc, I don't want that new specail
setting to be remembered and REPLACE my chosen default settings.

You seems to write as if you had onlu one mc running?
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


--
Peace and Cheer


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


auto save panels setup broken

2016-10-07 Thread Mike
Isn't that what F9 -> Options -> panel options -> auto save panels setup 
is for?


I believe OP is correct: mc forgets the active directory if you do have 
"auto save panels setup" selected.


$HOME/.config/mc/panels.ini:

[Dirs]
other_dir=/some/dir/somewhere
current_is_left=false

I think this file should be saved with:

this_dir=/some/dir

?

Whichever panel is active on shutdown, gets set back to $HOME on 
restart. This is not correct.


From a cursory look, it's a simple hack to setup.c. I guess it got 
overlooked because few people use that option.



On 2016-10-07 05:39, chris glur wrote:

  Also it doesn't remember the active panel on last
close was the right panel.

When, as usual, I've got several mc running: they all initially start with
the latest  conditions.

If I rarely, change the format-order of a mc, I don't want that new specail
setting to be remembered and REPLACE my chosen default settings.

You seems to write as if you had onlu one mc running?
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: mc Digest, Vol 146, Issue 5

2016-10-07 Thread chris glur
>  Also it doesn't remember the active panel on last
> close was the right panel.

When, as usual, I've got several mc running: they all initially start with
the latest  conditions.

If I rarely, change the format-order of a mc, I don't want that new specail
setting to be remembered and REPLACE my chosen default settings.

You seems to write as if you had onlu one mc running?
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Midnight Commander 4.8.18 broken full listing

2016-10-07 Thread solarflow99
About mc not remembering the active panel on last close, I (as well as
others) have complained about this before and they just ignored it.

https://mail.gnome.org/archives/mc-devel/2016-April/msg00010.html


On Thu, Oct 6, 2016 at 2:23 AM, Felix Miata  wrote:

> I've been setting right panel to full for years. It still works, but it's
> necessary to select it on each startup. And what it does remember on
> startup is that it should be long, but only shows on the right side the
> left half of the full screen it should be showing, cutting off the whole of
> the right half of the full listing, whether on vtty or xterm. Saving after
> reselecting doesn't help. Also it doesn't remember the active panel on last
> close was the right panel.
> http://fm.no-ip.com/SS/mc4818longBroken.png
> --
> "The wise are known for their understanding, and pleasant
> words are persuasive." Proverbs 16:21 (New Living Translation)
>
>  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!
>
> Felix Miata  ***  http://fm.no-ip.com/
> ___
> mc mailing list
> https://mail.gnome.org/mailman/listinfo/mc
>
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc