File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 114114 (setq phpactor-history-ring (make-ring phpactor-history-size)))
115115 (ring-insert phpactor-history-ring (cons name entry)))
116116
117+ (defun phpactor-config:dump ()
118+ " Execute Phpactor `config:dump' sub command."
119+ (interactive )
120+ (let ((default-directory (phpactor-get-working-dir)))
121+ (funcall
122+ (if (called-interactively-p 'interactive )
123+ #'shell-command
124+ #'shell-command-to-string )
125+ (phpactor--make-command-string " config:dump" ))))
117126
118127; ; Phpactor RPC
119128(defun phpactor--rpc (action arguments )
124133 (json-object-type 'plist )
125134 (json-array-type 'list )
126135 (output (get-buffer-create " *Phpactor Output*" ))
127- (cwd (phpactor-get-working-dir))
128- (phpactor-executable (phpactor-find-executable)))
136+ (phpactor-executable (phpactor-find-executable))
137+ ; ; `default-directory' is a *special variable*
138+ (default-directory (phpactor-get-working-dir)))
129139 (with-current-buffer output (erase-buffer ))
130140 (with-current-buffer (get-buffer-create " *Phpactor Input*" )
131141 (erase-buffer )
132142 (insert json)
133- (call-process-region (point-min ) (point-max ) phpactor-executable nil output nil " rpc" (format " --working-dir=%s " cwd ))
143+ (call-process-region (point-min ) (point-max ) phpactor-executable nil output nil " rpc" (format " --working-dir=%s " default-directory ))
134144 (with-current-buffer output
135145 (goto-char (point-min ))
136146 (json-read-object )))))
You can’t perform that action at this time.
0 commit comments