Hacker News new | past | comments | ask | show | jobs | submit login

C-M-u-q is one I use a lot: it auto-indents code (useful after you've made changes to a function or macro definition).



This doesn't seem to work for me. Could you mention the name of the command? How does it differ from C-M-\ ?


C-M-\ auto-indents the entire buffer, but C-M-u-q works just inside the function or macro you're in when you type the command (it does nothing outside a code block).

Emacs help actually defines these as two separate commands (C-M-u is "backward-up-list", C-M-q is "indent-sexp"), but I find that I can just hold down C-M, and then type "u", "q" in succession for the same effect.


C-M-\ actually only indents the 'region', which is the text between the point (your cursor) and the mark (C-Space). The neat thing about this is that yank (C-y) automatically sets the point and the mark at opposite sides of the yanked text. After copying an expression written in the slime repl to a buffer, C-M-\ works without having to move your cursor to the beginning of the expression.


Thanks for that clarification.

Actually, I don't use C-M-\ much, since I prefer to work in individual blocks and C-M-u-q does that nicely, without my worrying where I last set the mark.


Got it. Thanks! There's so much in Emacs/Slime that I don't know. I find my fingers can only absorb so much at a time :)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: