Skip to content

Commit 7a85102

Browse files
committed
Set default-directory every time inslead of let form.
GitHub-Issue: #48 Contrary to the intention, the directory where Phpactor was first used was saved as `default-directory`. In other words, problems occurred when using Phpactor for multiple PHP projects. #48
1 parent 705790f commit 7a85102

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

phpactor.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@
134134
(json-array-type 'list)
135135
(output (get-buffer-create "*Phpactor Output*"))
136136
(phpactor-executable (phpactor-find-executable))
137-
;; `default-directory' is a *special variable*
138-
(default-directory (phpactor-get-working-dir)))
137+
(cwd (phpactor-get-working-dir)))
139138
(with-current-buffer output (erase-buffer))
140139
(with-current-buffer (get-buffer-create "*Phpactor Input*")
140+
;; `default-directory' is a *special variable* and buffer-local.
141+
(setq default-directory cwd)
141142
(erase-buffer)
142143
(insert json)
143144
(call-process-region (point-min) (point-max) phpactor-executable nil output nil "rpc" (format "--working-dir=%s" default-directory))

0 commit comments

Comments
 (0)