Since I now had time to waste, I asked to see the customs lady's supervisor, and then berated the person who inspected my laptop for not having any idea how to do this sort of search properly. So, I ended up sitting both the customs lady and her supervisor there for another hour or so while I taught them how to use undelete and some basic free forensic tools.
I then handed them a bill for an hour of my time and left to wait for the next plane.
I like to think it took them a while to process just what the hell had happened. Mindless securistas like that need to be humiliated at every turn, or they'll never stop. Society - the segment of society with which they interact - must make it clear that their job is not wanted, not needed, and not welcome.
This was in Montreal in 2009, if anyone cares.