


Neitherĭoes it alter C preprocessor lines when in C mode, but it does Though, and does not alter lines that start inside strings. Parenthetical grouping starting on the current line. Usual, then reindents by the same amount all the lines in the TAB with a numeric argument reindents the current line as Indentation of its first line, move point to that first line and typeĬ-u TAB. If you like the relative indentation within a grouping but not the To obtain custom indentation for compensate we register a new function, in the body of my-scheme-mode-hook: (put 'compensate 'scheme-indent-function 'my-scheme-indent-compensate) this means: whenever Emacs needs to indent a line inside the compensate sexp, invoke the function my-scheme-indent-compensate. To correct the overall indentation as well, type TAB

Indent-pp-sexp in Lisp mode, c-indent-exp in C mode,Įtc. The text in the marked block will now be reformatted. Move the cursor to the first line of the block, and indent this line however far you want all the lines in the block to be indented. The function thatĬ-M-q runs depends on the major mode it is Move to the end of the block you want to indent and set the mark by pressing C-SPC. Indentation of the line where the grouping starts). Grouping, without affecting its overall indentation (i.e., the This changes the relative indentation within the Position point before the beginning of the grouping and typeĬ-M-q. To reindent the contents of a single parenthetical grouping, Lines that start inside comments and strings. Shift all the lines in the region rigidly sideways, but do not alter Shift an entire parenthetical grouping rigidly sideways so that its Reindent all the lines within one parenthetical grouping. Press Esc three times when you are done with the required indentation. In addition, Emacs provides the following commands for indenting Use arrows ( and ) to indent interactively.
#EMACS FOR MAC INDENT LINES CODE#
It shouldn't be greatly surprising that it might not work in other contexts, and I'm not sure what you were expecting it to do when faced with SQL code I'm afraid the answer is simply: Don't do that. c-indent-line is a function designed for use with C and C++ code. Region is non-empty, TAB indents every line in the region.Īlternatively, the command C-M-\ ( indent-region) indentsĮvery line in the region, whether or not the mark is active Indentation in Emacs is generally intelligent, but it's not magic. One way to do this is to use the mark when the mark is active and the Sometimes, you may want to reindent several lines of code at a time. Next: Customizing Lisp Indentation, Previous: Basic Program Indentation Commands, Up: Indentation for Programs 26.3.2 Indenting Several Lines
