feat(fortran): SPC m f o
opens project config
This commit is contained in:
parent
56187fc35a
commit
3a01faed49
2 changed files with 13 additions and 2 deletions
|
@ -63,7 +63,7 @@ or gfortran, depending on what feature flags are set."
|
||||||
(_ "")))
|
(_ "")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +fortran-compilation-buffer-name-fn (mode)
|
(defun +fortran-compilation-buffer-name-fn (_mode)
|
||||||
"The name of the buffer produced by `compile'."
|
"The name of the buffer produced by `compile'."
|
||||||
"*fortran-compilation*")
|
"*fortran-compilation*")
|
||||||
|
|
||||||
|
@ -115,3 +115,13 @@ or gfortran, depending on what feature flags are set."
|
||||||
"Test the current project using fpm."
|
"Test the current project using fpm."
|
||||||
(interactive)
|
(interactive)
|
||||||
(compile "fpm test"))
|
(compile "fpm test"))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +fortran/fpm-open-project-toml (project-root)
|
||||||
|
"Open fpm.toml at PROJECT-ROOT (defaults to the open project)."
|
||||||
|
(interactive (list (doom-project-root)))
|
||||||
|
(let ((file (file-name-concat project-root "fpm.toml")))
|
||||||
|
(cond ((file-exists-p file) (find-file file))
|
||||||
|
((null project-root) (user-error "Not in a project"))
|
||||||
|
(t (user-error "No fpm.toml found at project root (%s)"
|
||||||
|
(abbreviate-file-name project-root))))))
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
(:prefix ("f" . "fpm")
|
(:prefix ("f" . "fpm")
|
||||||
:desc "fpm build" "b" #'+fortran/fpm-build
|
:desc "fpm build" "b" #'+fortran/fpm-build
|
||||||
:desc "fpm run" "r" #'+fortran/fpm-run
|
:desc "fpm run" "r" #'+fortran/fpm-run
|
||||||
:desc "fpm test" "t" #'+fortran/fpm-test)
|
:desc "fpm test" "t" #'+fortran/fpm-test
|
||||||
|
:desc "Open project config" "o" #'+fortran/fpm-open-project-toml)
|
||||||
(:prefix ("g" . "gfortran")
|
(:prefix ("g" . "gfortran")
|
||||||
:desc "compile" "c" #'+fortran/gfortran-compile
|
:desc "compile" "c" #'+fortran/gfortran-compile
|
||||||
:desc "run" "r" #'+fortran/gfortran-run)
|
:desc "run" "r" #'+fortran/gfortran-run)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue