Do you say Baruch Dayan Ha-emet immediately, regardless of where you are when you learn the news?
Upon learning of someone's passing, I have been taught, we immediately say baruch dayan ha-emet. I have also been taught that we don't say blessings (or learn torah) in inappropriate locations. My question is about which of these principles takes priority. This situation can arise if you overhear a conversation in another room, or hear the incoming message on an answering machine while you are indisposed, or if (as some people do) you're reading email on your phone while sitting in the bathroom.
I can imagine arguments both ways. On the one hand, this phrase doesn't contain the divine name so maybe that's not a violation and we shouldn't delay. On the other hand, it's clearly a reference to God, it's prompted by something not under your control (unlike a mitzvah blessing tied to an action you take), and you can hold the thought for the few minutes it would take to get to an appropriate location.
I am curious about "reaction b'rachot" more broadly than just dayan ha-emet, for example if you see a rainbow in the morning before you are dressed, but I don't know if the presence or absence of the name affects the answer, so I've asked this question more narrowly. If there are broader principles I would welcome a broader answer.