Skip to content

Commit 3a37596

Browse files
authored
Merge pull request #54 from emacs-php/fix/default-directory
Set default-directory every time inslead of let form
2 parents 705790f + 7a85102 commit 3a37596

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)