Skip to content

Commit b6848f5

Browse files
committed
rust-mode.el: use tab-width instead of default-tab-width
Fix rust-lang#6222.
1 parent f0fc9c9 commit b6848f5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/etc/emacs/rust-mode.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
(let ((level (rust-paren-level)))
5050
(cond
5151
;; A function return type is 1 level indented
52-
((looking-at "->") (* default-tab-width (+ level 1)))
52+
((looking-at "->") (* tab-width (+ level 1)))
5353

5454
;; A closing brace is 1 level unindended
55-
((looking-at "}") (* default-tab-width (- level 1)))
55+
((looking-at "}") (* tab-width (- level 1)))
5656

5757
;; If we're in any other token-tree / sexp, then:
5858
;; - [ or ( means line up with the opening token
@@ -70,18 +70,18 @@
7070
(goto-char pt)
7171
(back-to-indentation)
7272
(if (looking-at "\\<else\\>")
73-
(* default-tab-width (+ 1 level))
73+
(* tab-width (+ 1 level))
7474
(progn
7575
(goto-char pt)
7676
(beginning-of-line)
7777
(rust-rewind-irrelevant)
7878
(end-of-line)
7979
(if (looking-back "[{};,]")
80-
(* default-tab-width level)
80+
(* tab-width level)
8181
(back-to-indentation)
8282
(if (looking-at "#")
83-
(* default-tab-width level)
84-
(* default-tab-width (+ 1 level))))))))))
83+
(* tab-width level)
84+
(* tab-width (+ 1 level))))))))))
8585

8686
;; Otherwise we're in a column-zero definition
8787
(t 0))))))

0 commit comments

Comments
 (0)