Fix style and indentation
Add a separate function to check for temp buffers
Use `file-remote-p` instead of custom Tramp logic