[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode c23453d 463/486: rearrange I: Move options and f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode c23453d 463/486: rearrange I: Move options and faces to beginning of file |
Date: |
Sat, 7 Aug 2021 09:26:15 -0400 (EDT) |
branch: elpa/rust-mode
commit c23453df6d89c2b3151f8dd912398e563f232ffd
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Nathan Moreau <nathan.moreau@m4x.org>
rearrange I: Move options and faces to beginning of file
---
rust-mode.el | 214 ++++++++++++++++++++++++++++++-----------------------------
1 file changed, 109 insertions(+), 105 deletions(-)
diff --git a/rust-mode.el b/rust-mode.el
index 42fd4ee..d7a03ba 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -28,6 +28,115 @@
(defvar rust-buffer-project nil)
(make-variable-buffer-local 'rust-buffer-project)
+;;; Customization
+
+(defgroup rust-mode nil
+ "Support for Rust code."
+ :link '(url-link "https://www.rust-lang.org/")
+ :group 'languages)
+
+(defcustom rust-indent-offset 4
+ "Indent Rust code by this number of spaces."
+ :type 'integer
+ :group 'rust-mode
+ :safe #'integerp)
+
+(defcustom rust-indent-method-chain nil
+ "Indent Rust method chains, aligned by the `.' operators."
+ :type 'boolean
+ :group 'rust-mode
+ :safe #'booleanp)
+
+(defcustom rust-indent-where-clause nil
+ "Indent lines starting with the `where' keyword following a function or
trait.
+When nil, `where' will be aligned with `fn' or `trait'."
+ :type 'boolean
+ :group 'rust-mode
+ :safe #'booleanp)
+
+(defcustom rust-playpen-url-format "https://play.rust-lang.org/?code=%s"
+ "Format string to use when submitting code to the playpen."
+ :type 'string
+ :group 'rust-mode)
+
+(defcustom rust-shortener-url-format
"https://is.gd/create.php?format=simple&url=%s"
+ "Format string to use for creating the shortened link of a playpen
submission."
+ :type 'string
+ :group 'rust-mode)
+
+(defcustom rust-match-angle-brackets t
+ "Whether to enable angle bracket (`<' and `>') matching where appropriate."
+ :type 'boolean
+ :safe #'booleanp
+ :group 'rust-mode)
+
+(defcustom rust-format-on-save nil
+ "Format future rust buffers before saving using rustfmt."
+ :type 'boolean
+ :safe #'booleanp
+ :group 'rust-mode)
+
+(defcustom rust-format-show-buffer t
+ "Show *rustfmt* buffer if formatting detected problems."
+ :type 'boolean
+ :safe #'booleanp
+ :group 'rust-mode)
+
+(defcustom rust-format-goto-problem t
+ "Jump to location of first detected problem when formatting buffer."
+ :type 'boolean
+ :safe #'booleanp
+ :group 'rust-mode)
+
+(defcustom rust-rustfmt-bin "rustfmt"
+ "Path to rustfmt executable."
+ :type 'string
+ :group 'rust-mode)
+
+(defcustom rust-rustfmt-switches '("--edition" "2018")
+ "Arguments to pass when invoking the `rustfmt' executable."
+ :type '(repeat string)
+ :group 'rust-mode)
+
+(defcustom rust-cargo-bin "cargo"
+ "Path to cargo executable."
+ :type 'string
+ :group 'rust-mode)
+
+(defcustom rust-always-locate-project-on-open nil
+ "Whether to run `cargo locate-project' every time `rust-mode' is activated."
+ :type 'boolean
+ :group 'rust-mode)
+
+(defcustom rust-indent-return-type-to-arguments t
+ "Indent a line starting with the `->' (RArrow) following a function, aligning
+to the function arguments. When nil, `->' will be indented one level."
+ :type 'boolean
+ :group 'rust-mode
+ :safe #'booleanp)
+
+;;; Faces
+
+(defface rust-unsafe-face
+ '((t :inherit font-lock-warning-face))
+ "Face for the `unsafe' keyword."
+ :group 'rust-mode)
+
+(defface rust-question-mark-face
+ '((t :weight bold :inherit font-lock-builtin-face))
+ "Face for the question mark operator."
+ :group 'rust-mode)
+
+(defface rust-builtin-formatting-macro-face
+ '((t :inherit font-lock-builtin-face))
+ "Face for builtin formatting macros (print! &c.)."
+ :group 'rust-mode)
+
+(defface rust-string-interpolation-face
+ '((t :slant italic :inherit font-lock-string-face))
+ "Face for interpolating braces in builtin formatting macro strings."
+ :group 'rust-mode)
+
(defun rust-re-word (inner) (concat "\\<" inner "\\>"))
(defun rust-re-grab (inner) (concat "\\(" inner "\\)"))
(defun rust-re-shy (inner) (concat "\\(?:" inner "\\)"))
@@ -145,111 +254,6 @@ seen as a macro."
table)
"Syntax definitions and helpers.")
-(defgroup rust-mode nil
- "Support for Rust code."
- :link '(url-link "https://www.rust-lang.org/")
- :group 'languages)
-
-(defcustom rust-indent-offset 4
- "Indent Rust code by this number of spaces."
- :type 'integer
- :group 'rust-mode
- :safe #'integerp)
-
-(defcustom rust-indent-method-chain nil
- "Indent Rust method chains, aligned by the `.' operators."
- :type 'boolean
- :group 'rust-mode
- :safe #'booleanp)
-
-(defcustom rust-indent-where-clause nil
- "Indent lines starting with the `where' keyword following a function or
trait.
-When nil, `where' will be aligned with `fn' or `trait'."
- :type 'boolean
- :group 'rust-mode
- :safe #'booleanp)
-
-(defcustom rust-indent-return-type-to-arguments t
- "Indent a line starting with the `->' (RArrow) following a function, aligning
-to the function arguments. When nil, `->' will be indented one level."
- :type 'boolean
- :group 'rust-mode
- :safe #'booleanp)
-
-(defcustom rust-playpen-url-format "https://play.rust-lang.org/?code=%s"
- "Format string to use when submitting code to the playpen."
- :type 'string
- :group 'rust-mode)
-
-(defcustom rust-shortener-url-format
"https://is.gd/create.php?format=simple&url=%s"
- "Format string to use for creating the shortened link of a playpen
submission."
- :type 'string
- :group 'rust-mode)
-
-(defcustom rust-match-angle-brackets t
- "Whether to enable angle bracket (`<' and `>') matching where appropriate."
- :type 'boolean
- :safe #'booleanp
- :group 'rust-mode)
-
-(defcustom rust-format-on-save nil
- "Format future rust buffers before saving using rustfmt."
- :type 'boolean
- :safe #'booleanp
- :group 'rust-mode)
-
-(defcustom rust-format-show-buffer t
- "Show *rustfmt* buffer if formatting detected problems."
- :type 'boolean
- :safe #'booleanp
- :group 'rust-mode)
-
-(defcustom rust-format-goto-problem t
- "Jump to location of first detected problem when formatting buffer."
- :type 'boolean
- :safe #'booleanp
- :group 'rust-mode)
-
-(defcustom rust-rustfmt-bin "rustfmt"
- "Path to rustfmt executable."
- :type 'string
- :group 'rust-mode)
-
-(defcustom rust-rustfmt-switches '("--edition" "2018")
- "Arguments to pass when invoking the `rustfmt' executable."
- :type '(repeat string)
- :group 'rust-mode)
-
-(defcustom rust-cargo-bin "cargo"
- "Path to cargo executable."
- :type 'string
- :group 'rust-mode)
-
-(defcustom rust-always-locate-project-on-open nil
- "Whether to run `cargo locate-project' every time `rust-mode' is activated."
- :type 'boolean
- :group 'rust-mode)
-
-(defface rust-unsafe-face
- '((t :inherit font-lock-warning-face))
- "Face for the `unsafe' keyword."
- :group 'rust-mode)
-
-(defface rust-question-mark-face
- '((t :weight bold :inherit font-lock-builtin-face))
- "Face for the question mark operator."
- :group 'rust-mode)
-
-(defface rust-builtin-formatting-macro-face
- '((t :inherit font-lock-builtin-face))
- "Face for builtin formatting macros (print! &c.)."
- :group 'rust-mode)
-
-(defface rust-string-interpolation-face
- '((t :slant italic :inherit font-lock-string-face))
- "Face for interpolating braces in builtin formatting macro strings."
- :group 'rust-mode)
-
(defun rust-paren-level () (nth 0 (syntax-ppss)))
(defun rust-in-str () (nth 3 (syntax-ppss)))
(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))
- [nongnu] elpa/rust-mode 4a7a860 480/486: Properly markup two additional section headings, (continued)
- [nongnu] elpa/rust-mode 4a7a860 480/486: Properly markup two additional section headings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a789a25 266/486: Fix #168: use while in rust-rewind-irrelevant, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 936a187 276/486: handle indirect buffers and multiple windows in rust-format-buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 09efc45 320/486: Merge pull request #219 from Aankhen/highlight-question-mark, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b10ad41 326/486: Merge pull request #220 from Aankhen/highlight-string-interpolation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d71fe94 307/486: restore points when an error occurs too, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1b3db88 422/486: Add a function wrap and unwrap with the dbg! macro., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 8733792 448/486: Drop Emacs-24, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9eb2c63 460/486: Fix README internal link (#389), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 13c4335 462/486: Improve doc-strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c23453d 463/486: rearrange I: Move options and faces to beginning of file,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 649f492 484/486: Create rust-cargo.el from existing code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 198c777 386/486: Replaced font-lock-fontify-buffer with font-lock-ensure, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a871d10 390/486: Merge pull request #298 from jjwest/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0a94268 396/486: Merge pull request #307 from Bunogi/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 86bc286 401/486: Add specific distribution for EVM, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 06b3b60 412/486: update readme (#327), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c0cc6dc 420/486: Allow pass custom flags to rustfmt. (#338), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 888f3de 442/486: rust--format-fix-rustfmt-buffer: replace "stdin:" as well as "<stdin>:"., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ef152ad 459/486: Minor fixes (#388), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0797e7b 017/486: add Url, ELPA Syncer, 2021/08/07