Skip to content

Commit

Permalink
Merge pull request #329 from brotzeit/rust-mode-format-hooks
Browse files Browse the repository at this point in the history
set rust-mode format hook funtions
  • Loading branch information
brotzeit authored Nov 26, 2021
2 parents d3b5b87 + d35636c commit a91b3d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cask
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(package-file "rustic.el")

(development
(depends-on "rust-mode")
(depends-on "rust-mode" "1.0.2")
(depends-on "spinner")
(depends-on "ert-runner")
(depends-on "lsp-mode")
Expand Down
16 changes: 5 additions & 11 deletions rustic.el
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
;;; rustic.el --- Rust development environment -*-lexical-binding: t-*-

;; Version: 2.1
;; Version: 2.2
;; Author: Mozilla
;;
;; Keywords: languages
;; Package-Requires: ((emacs "26.1") (rust-mode "0.5.0") (dash "2.13.0") (f "0.18.2") (let-alist "1.0.4") (markdown-mode "2.3") (project "0.3.0") (s "1.10.0") (seq "2.3") (spinner "1.7.3") (xterm-color "1.6"))
;; Package-Requires: ((emacs "26.1") (rust-mode "1.0.2") (dash "2.13.0") (f "0.18.2") (let-alist "1.0.4") (markdown-mode "2.3") (project "0.3.0") (s "1.10.0") (seq "2.3") (spinner "1.7.3") (xterm-color "1.6"))

;; This file is distributed under the terms of both the MIT license and the
;; Apache License (version 2.0).
Expand Down Expand Up @@ -36,7 +36,8 @@
(require 'dash)

(setq rust-load-optional-libraries nil)

(setq rust-before-save-hook #'rustic-before-save-hook)
(setq rust-after-save-hook #'rustic-after-save-hook)
(require 'rust-mode)

;;; Customization
Expand Down Expand Up @@ -124,14 +125,7 @@ this variable."
"Major mode for Rust code.
\\{rustic-mode-map}"
:group 'rustic

(remove-hook 'before-save-hook 'rust-before-save-hook t)
(remove-hook 'after-save-hook 'rust-after-save-hook t)

(when (fboundp 'rustic-before-save-hook)
(add-hook 'before-save-hook 'rustic-before-save-hook nil t)
(add-hook 'after-save-hook 'rustic-after-save-hook nil t)))
:group 'rustic)

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rustic-mode))
Expand Down

0 comments on commit a91b3d9

Please sign in to comment.