Skip to content

Commit f40c24a

Browse files
committed
Add a couple of tips about eradicating tabs
1 parent ccd32f2 commit f40c24a

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ hit `<tab>`.
6363

6464
* Use **spaces** for indentation. No hard tabs.
6565

66+
In practical terms this means you should add the following to your
67+
Emacs config:
68+
69+
``` el
70+
(setq indent-tabs-mode nil)
71+
```
72+
73+
An even better idea would be to force the use of spaces using
74+
`.dir-locals.el` in each of your Emacs Lisp projects.
75+
76+
``` el
77+
((emacs-lisp-mode
78+
(indent-tabs-mode nil)))
79+
```
80+
6681
* For regular functions, vertically align function arguments.
6782

6883
```el
@@ -81,13 +96,13 @@ hit `<tab>`.
8196
8297
```el
8398
;; good
84-
(format
99+
(format
85100
"%s %d"
86101
something
87102
something-else)
88103
89104
;; bad
90-
(format
105+
(format
91106
"%s %d"
92107
something
93108
something-else)
@@ -108,9 +123,9 @@ hit `<tab>`.
108123
;; bad - four spaces on the body
109124
(when something
110125
(something-else))
111-
126+
112127
;; bad - aligned like a regular function
113-
(when
128+
(when
114129
something
115130
(something-else))
116131
```
@@ -432,7 +447,7 @@ name clashes.
432447
(global-set-key (kbd "C-l C-l") #'redraw-display)
433448
(cl-labels ((butterfly () (message "42")))
434449
(funcall #'butterfly))
435-
450+
436451
;; bad
437452
(cl-remove-if-not 'evenp numbers)
438453
(global-set-key (kbd "C-l C-l") 'redraw-display)

0 commit comments

Comments
 (0)