absent-minded
so lost in thought that one does not realize what one is doing, what is happening, etc.; preoccupied to the extent of being unaware of one's immediate surroundings.
I tried to call out to him but he didn't hear me. He wasn't paying attention. He is absent-minded
absent-minded professor
The very intelligent are sometimes preoccupied with weighty matters (as they suppose) insomuch that they forget about more prosaic matters -- such as remembering keys, wallet, phone, appointments, etc.
The teacher showed up in class, on time -- but forgot it was Tuesday, not Wednesday -- and was halfway through the lecture before the absent-minded professor realized he was teaching the wrong subject matter. On the plus side, I understand Einstein's Theory of Relativity a lot better than I did. I hope it shows up on our Physical Science 101 exams...