Skip to content

Commit 5585cf9

Browse files
tarsiusbrotzeit
authored andcommitted
rust-mode: Cosmetics
1 parent 09b4320 commit 5585cf9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

rust-mode.el

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,32 +257,35 @@ Use idomenu (imenu with `ido-mode') for best mileage.")
257257
:group 'rust-mode
258258
:syntax-table rust-mode-syntax-table
259259

260-
;; Syntax.
260+
;; Syntax
261261
(setq-local syntax-propertize-function #'rust-syntax-propertize)
262262

263263
;; Indentation
264264
(setq-local indent-line-function 'rust-mode-indent-line)
265265

266266
;; Fonts
267-
(setq-local font-lock-defaults '(rust-font-lock-keywords
268-
nil nil nil nil
269-
(font-lock-syntactic-face-function
270-
. rust-mode-syntactic-face-function)))
267+
(setq-local font-lock-defaults
268+
'(rust-font-lock-keywords
269+
nil nil nil nil
270+
(font-lock-syntactic-face-function
271+
. rust-mode-syntactic-face-function)))
271272

272273
;; Misc
273274
(setq-local comment-start "// ")
274275
(setq-local comment-end "")
275276
(setq-local open-paren-in-column-0-is-defun-start nil)
276277

277278
;; Auto indent on }
278-
(setq-local
279-
electric-indent-chars (cons ?} (and (boundp 'electric-indent-chars)
280-
electric-indent-chars)))
279+
(setq-local electric-indent-chars
280+
(cons ?} (and (boundp 'electric-indent-chars)
281+
electric-indent-chars)))
281282

282283
;; Allow paragraph fills for comments
283284
(setq-local comment-start-skip "\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
284285
(setq-local paragraph-start
285-
(concat "[[:space:]]*\\(?:" comment-start-skip "\\|\\*/?[[:space:]]*\\|\\)$"))
286+
(concat "[[:space:]]*\\(?:"
287+
comment-start-skip
288+
"\\|\\*/?[[:space:]]*\\|\\)$"))
286289
(setq-local paragraph-separate paragraph-start)
287290
(setq-local normal-auto-fill-function 'rust-do-auto-fill)
288291
(setq-local fill-paragraph-function 'rust-fill-paragraph)
@@ -296,7 +299,8 @@ Use idomenu (imenu with `ido-mode') for best mileage.")
296299
(setq-local beginning-of-defun-function 'rust-beginning-of-defun)
297300
(setq-local end-of-defun-function 'rust-end-of-defun)
298301
(setq-local parse-sexp-lookup-properties t)
299-
(setq-local electric-pair-inhibit-predicate 'rust-electric-pair-inhibit-predicate-wrap)
302+
(setq-local electric-pair-inhibit-predicate
303+
'rust-electric-pair-inhibit-predicate-wrap)
300304
(setq-local electric-pair-skip-self 'rust-electric-pair-skip-self-wrap)
301305

302306
(add-hook 'before-save-hook 'rust-before-save-hook nil t)

0 commit comments

Comments
 (0)