Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to open project documentation using cargo. #33

Merged
merged 1 commit into from
Jan 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cargo-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
;; * cargo-process-build - Compile the current project.
;; * cargo-process-clean - Remove the target directory.
;; * cargo-process-doc - Build this project's and its dependencies' documentation.
;; * cargo-process-doc-open - Open this project's documentation.
;; * cargo-process-new - Create a new cargo project.
;; * cargo-process-init - Create a new cargo project inside an existing directory.
;; * cargo-process-run - Build and execute src/main.rs.
Expand Down Expand Up @@ -242,6 +243,14 @@ Cargo: Build this project's and its dependencies' documentation."
(interactive)
(cargo-process--start "Doc" "cargo doc"))

;;;###autoload
(defun cargo-process-doc-open ()
"Run the Cargo doc command with the --open switch.
With the prefix argument, modify the command's invocation.
Cargo: Open this project's documentation."
(interactive)
(cargo-process--start "Doc" "cargo doc --open"))

;;;###autoload
(defun cargo-process-new (name &optional bin)
"Run the Cargo new command.
Expand Down
2 changes: 2 additions & 0 deletions cargo.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
;; * C-c C-c C-b - cargo-process-build
;; * C-c C-c C-l - cargo-process-clean
;; * C-c C-c C-d - cargo-process-doc
;; * C-c C-c C-h - cargo-process-doc-open
;; * C-c C-c C-n - cargo-process-new
;; * C-c C-c C-i - cargo-process-init
;; * C-c C-c C-r - cargo-process-run
Expand Down Expand Up @@ -65,6 +66,7 @@
(define-key cargo-minor-mode-map (kbd "C-c C-c C-b") 'cargo-process-build)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-l") 'cargo-process-clean)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-d") 'cargo-process-doc)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-h") 'cargo-process-doc-open)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-n") 'cargo-process-new)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-i") 'cargo-process-init)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-r") 'cargo-process-run)
Expand Down