Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Indenting is used to organize code by indicating blocks, closures, conditionals, and other constructs. It makes code easier to read, and in some languages is used to handle control flow.
2
votes
How to make a code more legible
It looks like a problem of extra white space and bad indentation.
Select the region
Fix white space (replace multiple spaces with single space): C-M-% \s-+ RET SPACE RET ! … Fix indentation (indent-region): C-M-\
You can even checkout the aggressive-indent-mode package (also available on Melpa) and activate it only for the emacs-lisp-mode. …
6
votes
How to indent keywords aligned?
Emacs has provided the variable lisp-indent-function for the user to choose what function to use for indentation in lisp modes. … This function returns either the indentation to use, or nil if the
Lisp function does not specify a special indentation." …
4
votes
Accepted
Fixing forced indentation in shell-script-mode for tcsh
That function caused the extra indentation by 4 spaces.
There is an outdated csh-mode.el (last updated in 1999) which does the indentation well but has outdated keyword highlighting info. …
16
votes
Accepted
How to pretty-format code (auto-insert newlines, indent, etc)?
It looks like you need the fill-region function more than the indentation.
Select that line and do M-x fill-region.
Select the same, now split across multiple lines, and do M-x indent-region. …
1
vote
Accepted
Delete 4-spaces as a single tab
I have tested in emacs -Q that C-u <backspace> will delete 4 spaces backwards.
Equivalent bindings would be:
M-4 <backspace>
C-4 <backspace>
Before
int main () {
▮int a = 0;
(▮ represents …
25
votes
Accepted
How prettify (newlines and indentation) an optimized HTML/JS file?
You can use the built-in sgml-mode for this.
M-x sgml-mode - Enable the sgml-mode major mode so that sgml-pretty-print command auto-loads.
C-x h - Select the whole buffer.
M-x sgml-pretty-print
To …