Address omissions from fa26dd5 refactor.

This commit is contained in:
Franco Eusébio Garcia
2020-03-30 12:42:02 -03:00
parent 86577f81dc
commit e30e890d62
4 changed files with 27 additions and 29 deletions

View File

@@ -2,6 +2,13 @@
This document lists new features, improvements, changes, and bug fixes in each release of the package.
## GDScript mode 1.1.1
### Bug fixes
- Fixed loading the `gdscript-godot` module at initialization.
- Fixed function calls in the mode map.
## GDScript mode 1.1.0
Emacs GDScript mode is now available on the [MELPA](https://melpa.org/) package archive!

View File

@@ -38,19 +38,10 @@
;;;###autoload
(defun gdscript-run-command (cmd &optional show)
"Run a Godot process.
Input and output via buffer named after `*godot*'. If there is a process
already running in that buffer, just switch to it.
With argument, allows you to define CMD so you can edit the
command used to call the interpreter.
When numeric prefix arg is other than 0 or 4 do not SHOW."
(interactive
(if current-prefix-arg
(list
(read-string "Run Godot: " (gdscript-godot--build-shell-command))
(y-or-n-p "Make dedicated process? ")
(= (prefix-numeric-value current-prefix-arg) 4))
(list (gdscript-godot--build-shell-command) nil t)))
CMD is the command to be invoked by the shell. If SHOW, the
output of the process will be provided in a buffer named
`*godot*'."
(start-process-shell-command "Godot Process" (if show
"*godot*" nil) cmd))
@@ -71,16 +62,14 @@ file's directory as starting point."
(defun gdscript-godot-run-project ()
"Run the current project in Godot Engine."
(interactive)
(let* ()
(gdscript-run-command
(gdscript-godot--build-shell-command))))
(gdscript-run-command
(gdscript-godot--build-shell-command)))
(defun gdscript-godot-run-project-debug ()
"Run the current project in Godot Engine."
(interactive)
(let* ()
(gdscript-run-command
(concat (gdscript-godot--build-shell-command) " -d"))))
(gdscript-run-command
(concat (gdscript-godot--build-shell-command) " -d") t))
(defun gdscript-godot-run-current-scene ()
"Run the current script file in Godot Engine."
@@ -94,7 +83,8 @@ file's directory as starting point."
(interactive)
(gdscript-run-command
(concat (gdscript-godot--build-shell-command) " -d "
(gdscript-util--get-godot-project-file-path-relative buffer-file-name) ".tscn")))
(gdscript-util--get-godot-project-file-path-relative buffer-file-name) ".tscn")
t))
(defun gdscript-godot-edit-current-scene ()
"Run the current script file in Godot Engine."
@@ -110,7 +100,8 @@ For this to work, the script must inherit either from
\"SceneTree\" or \"MainLoop\"."
(interactive)
(gdscript-run-command
(concat (gdscript-godot--build-shell-command) " -s " (file-relative-name buffer-file-name))))
(concat (gdscript-godot--build-shell-command) " -s " (file-relative-name buffer-file-name))
t))
(provide 'gdscript-godot)
;;; gdscript-godot.el ends here

View File

@@ -38,6 +38,7 @@
(require 'gdscript-completion)
(require 'gdscript-format)
(require 'gdscript-rx)
(require 'gdscript-godot)
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.gd\\'" . gdscript-mode))
@@ -58,13 +59,13 @@
(define-key map (kbd "<backtab>") 'gdscript-indent-dedent-line)
(define-key map (kbd "\t") 'company-complete)
;; Run in Godot.
(define-key map "\C-c\C-g" 'gdscript--run-godot-editor)
(define-key map "\C-c\C-p" 'gdscript--run-project-in-godot)
(define-key map "\C-c\C-s" 'gdscript--run-current-scene-in-godot)
(define-key map "\C-c\C-e" 'gdscript-godot-edit-current-scene)
(define-key map "\C-c\C-r" 'gdscript--run-current-script-in-godot)
(define-key map "\C-c\C-dp" 'gdscript--run-project-in-godot-debug-mode)
(define-key map "\C-c\C-ds" 'gdscript--run-current-scene-in-godot-debug-mode)
(define-key map "\C-c\C-r\C-p" 'gdscript-godot-open-project-in-editor)
(define-key map "\C-c\C-r\C-r" 'gdscript-godot-run-project)
(define-key map "\C-c\C-r\C-d" 'gdscript-godot-run-project-debug)
(define-key map "\C-c\C-r\C-s" 'gdscript-godot-run-current-scene)
(define-key map "\C-c\C-r\C-q" 'gdscript-godot-run-current-scene-debug)
(define-key map "\C-c\C-r\C-e" 'gdscript-godot-edit-current-scene)
(define-key map "\C-c\C-r\C-x" 'gdscript-godot-run-current-script)
map)
"Keymap for `gdscript-mode'.")

View File

@@ -115,8 +115,7 @@ WARNING: the Godot project must exist for this function to work."
(defun gdscript-util--get-godot-project-file-path-relative (file-path)
"Return the relative path of `FILE-PATH' to Godot's configuration file."
(concat (gdscript-godot--build-shell-command) " -d "
(file-name-sans-extension
(concat (file-name-sans-extension
(file-relative-name file-path
(gdscript-util--find-project-configuration-file)))))