Pain is awful! I have fibromyalgia, which is chronic widespread pain. When I get a flare I also want to eat. I gained weight right before I came back here cuz I was in an awful month long flare.
Anyhow, I have gotten back to tracking, and I usually track for most or all of the day in the morning and then I am very strict with not eating anything not already tracked. I know if I eat it, I'm going to track it and I REALLY don't want to see the cals on my tracker move up because I know in a day or two the weight on my ticker will move up too!
I am trying very hard this time to separate food for nourishment and food for 'eating my feelings' as it were.
It's difficult! It also takes a lot of thinking, thinking about what you're thinking, ha, feeling, why you're eating, why you have a craving, why you want to eat. Panic is an emotion like any other that drives us to eat, just try and be VERY MINDFUL.