I use a decision tree and good planning to try and solve the problem in the OP.
I grow a good portion of the fruits and vegetables we eat. We don't have a local farmers market here but we do have a little fruit and vegetable stand near town. His stuff generally is more local than the grocery store's so for those things we don't grow, we buy there if available.
I have spent some time talking to folks and searching on the Interent for local farmers and producers that sell direct and have developed a nice day trip to stop at all of them. We have the mileage down as low as possible and drive a well-maintained vehicle that gets good gas mileage. Local chickens and lamb, local wine, local milk and eggs, local cheese and whatever non-food we need from the city. We do this trip about every 2 to 3 months. Beef we buy by the 1/4 side from a local producer. Most of the local producers are not certified organic but I've obviously visited them, asked questions and know a fair amount about their operations and philosophy. We also have several local producers of field peas and corn that we may visit once a year if we need to replenish our preserved stocks since we only grow enough each year to eat fresh.
If we buy in the grocery store (one trip about every 3 to 4 weeks) we look for location in the following order: our state, adjoining state, southeast, east of the Mississippi, U.S. The only non-U.S. food we still buy are some spices, coffee, tea and cocoa and those we generally buy fair trade over organic but both if available and some over the Internet because they aren't available here as either fair trade or organic. While it would be great to find a lot of locally produced, organic foods, the transition to a different form of agriculture is still too young. Each family needs to establish its own way of addressing while being mindful of fossil fuel consumption.
It is a bit time consuming but I likely don't spend as much time as my grandparents did providing food for the household. My gas bill averages about $25 a month plus the electricity for the freezer and for food preservation activities. I believe that would compare nicely to trucked food that is processed and I am much more familiar with where my food has been.