How to format code in Xcode? 

Select first the text you want to format and then press Ctrl+I. Use Cmd+A first if you wish to format all text in the selected file. Note: this procedure only re-indents the lines, it does not do any advanced formatting. In XCode 12 beta: The new key binding to re-indent is control+I.

How to copy/select a whole file or buffer in Emacs?

C-x h will select the entire buffer. You can search for help within Emacs using the built-in help system. C-h f will look for help for specific functions. In this case, you could have searched for whole-buffer to find mark-whole-buffer. Other help commands of interest would be: C-h m to show available commands for the current modes C-h v for help related … Read more