Question
saving within the save callback and bypassing the system's save
Hi,
I am considering deploying some code that will save a document within the
save callback during the first pass and return a do not proceed code so the
rest of the callback is not executed but also (and this is the key) avoiding
the actual save.
Huh? Yeah, me too.
My understanding of the save and save callback program flow is this:
1) A save is initiated.
2) The function assigned to the save callback is called with op=1. If the
function returns -1, the save is aborted. Otherwise, the flow proceeds to
step 3.
3) The function assigned to the save callback is called again. This is where
code to be executed prior to the save is placed.
4) Once the function is complete and returns, Editor performs a save.
Am I missing anything important? Is my understanding correct?
My plan is to perform the save during step 2 above ... the first call to the
function assigned to the save callback and abort further processing.
What do I need to consider in order to fully evaluate the risk of deploying
this strategy relative to my goals? In other words, what can "go wrong" or
what "goodness" will I be missing by circumventing Editor performing the
actual save (and anything else Editor does that I am not aware of)?
Is anyone doing this already for some reason? Have you run into any gotchas?
--
Paul Nagai
I am considering deploying some code that will save a document within the
save callback during the first pass and return a do not proceed code so the
rest of the callback is not executed but also (and this is the key) avoiding
the actual save.
Huh? Yeah, me too.
My understanding of the save and save callback program flow is this:
1) A save is initiated.
2) The function assigned to the save callback is called with op=1. If the
function returns -1, the save is aborted. Otherwise, the flow proceeds to
step 3.
3) The function assigned to the save callback is called again. This is where
code to be executed prior to the save is placed.
4) Once the function is complete and returns, Editor performs a save.
Am I missing anything important? Is my understanding correct?
My plan is to perform the save during step 2 above ... the first call to the
function assigned to the save callback and abort further processing.
What do I need to consider in order to fully evaluate the risk of deploying
this strategy relative to my goals? In other words, what can "go wrong" or
what "goodness" will I be missing by circumventing Editor performing the
actual save (and anything else Editor does that I am not aware of)?
Is anyone doing this already for some reason? Have you run into any gotchas?
--
Paul Nagai

