From c102f6496948f5ea810a7ccdce4dc95c163d3de1 Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Sun, 29 Jul 2018 10:32:51 +0300 Subject: [PATCH] Implement phpactor-action-collection and phpactor-action-close-file resolves #36 (class renaming now works) --- phpactor.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpactor.el b/phpactor.el index c311653..4d39e0f 100644 --- a/phpactor.el +++ b/phpactor.el @@ -177,6 +177,7 @@ (let ((use-dialog-box nil) (type (if type (intern type) value-type))) (cl-case type + (confirm (yes-or-no-p label)) (file (read-file-name label nil default)) (text (read-string label default)) (choice (completing-read label @@ -257,6 +258,13 @@ (view-mode 1)) (pop-to-buffer buffer))) +(cl-defun phpactor-action-collection (&key actions) + "Executes a collection of actions." + (mapc + (lambda (action) + (apply #'phpactor-action-dispatch (list :action (plist-get action :name) :parameters (plist-get action :parameters)))) + actions)) + (cl-defun phpactor-action-open-file (&key path offset) "Open file from Phpactor." (unless (and path offset) @@ -270,6 +278,10 @@ (find-file path) (goto-char (1+ offset))) +(cl-defun phpactor-action-close-file (&key path) + "Close file from Phpactor." + (kill-buffer (find-file-noselect path t))) + ;; this function was adapted from go-mode (defun phpactor--goto-line (line) "Goto line LINE."