First, a few observations about that change, and then I'll suggest a different change:
editorctl_wid.p_readonly_mode = VSPROTECTREADONLYMODE_OPTIONAL;
// p_readonly_mode is boolean, so the line above is no different than
// setting it to true.
readonly_wid.p_value=(int)VSPROTECTREADONLYMODE_OPTIONAL;
// readonly_wid.p_style is PSCH_AUTO2STATE, so the line above is no different
// than setting it to 1. As a quick hack, you may want to simply set it to 0
// so the file is not treated as readonly. A more involved change might make
// the checkbox PSCH_AUTO3STATEB when _default_option('Z') (the
// "Protect readonly mode" option) is true, and set the p_value to 2 (the
// solid/gray state for a tristate checkbox), and check everyplace that
// checks readonly_wid.p_value to recognize it as a tristate checkbox and
// treat both 2 and 0 as "not readonly".
editorctl_wid.p_ProtectReadOnlyMode= VSPROTECTREADONLYMODE_OPTIONAL;
// This line is the one that actually had an effect, but look at the
// _ctlfile1_readonly.lbutton_up() handler in diffedit.e. When you
// check/uncheck the ReadOnly checkbox it will go back to enforcing
// readonly mode again. Maybe that's what you're going for, but when
// I set "Protect readonly mode" to false, I mean that I want to be
// able to edit readonly files, and I just want to get prompted when
// I go to save them.
After having poked at this a bit, I've had more success with the following change to diffedit.e, instead. My goal was to make Diffzilla allow modifying readonly buffers when "Protect readonly mode" is false, and as far as I've been able to tell so far, it seems to accomplish that:
diffedit.e, circa line 2637 in the SE 2008 revision of the file:
static boolean DiffEditorIsReadOnly()
{
if ( _DiffGetReadOnlyCBMissing()==1 ) {
boolean isro=_DiffGetReadOnly()==1;
return(isro);
}
int readonly_cb_wid=p_name=='_ctlfile1'?_ctlfile1_readonly:_ctlfile2_readonly;
return(readonly_cb_wid.p_value!=0
// chrisant: Don't enforce readonly mode when the "Protect
// readonly mode" option is off.
&& _default_option('Z'));
}