setting : add restore to user state
Posted: 29 Nov 2008 21:13
I think a little addition to setting could be welcome. Right now it supports "0" or "1" of course, but also "r" to restore to previous state. There should also be an option "u" for restore to user setting.
Here's an example where it might be required : Imagine a script that needs to hide folders during its execution, then needs to restore that setting to user value before it makes a selection of items and ends the whole stack execution (end 1;) It's important to restore the user setting because otherwise the possible hiding or showing of folders would have the selection lost !
But, if this script was called by another script, which may have changed this setting as well before, then doing a setting "r" might not restore to the user value, and so our script has no way to ensure selection isn't lost, because it can't restore to user value, only previous in stack.
Here's an example where it might be required : Imagine a script that needs to hide folders during its execution, then needs to restore that setting to user value before it makes a selection of items and ends the whole stack execution (end 1;) It's important to restore the user setting because otherwise the possible hiding or showing of folders would have the selection lost !
But, if this script was called by another script, which may have changed this setting as well before, then doing a setting "r" might not restore to the user value, and so our script has no way to ensure selection isn't lost, because it can't restore to user value, only previous in stack.