I have the following in my init file
(defun message-buffer-file-name-or-nothing () "Mode line proxy." (if buffer-file-name (message "[%s] %s" (format-time-string "%H:%M:%S") (buffer-file-name))) ) (add-hook 'focus-in-hook 'message-buffer-file-name-or-nothing)
and it worked great, until recently when it started echoing NOT the file-name of the buffer I was switching to but instead the file-name of the bufer I was switching FROM. I have no idea what happened since I didn't tamper with anything and I can't recall updating emacs recently either (25.3.1).
C-h v focus-in-hook is
message-buffer-file-name-or-nothing, nothing else hooks it. I guess this gets executed before buffer-file-name gets updated? But this is weird since it didn't work like this previously. Anyone have any ideas on how to troubleshoot this?