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 114
114
(setq phpactor-history-ring (make-ring phpactor-history-size)))
115
115
(ring-insert phpactor-history-ring (cons name entry)))
116
116
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" ))))
117
126
118
127
; ; Phpactor RPC
119
128
(defun phpactor--rpc (action arguments )
124
133
(json-object-type 'plist )
125
134
(json-array-type 'list )
126
135
(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)))
129
139
(with-current-buffer output (erase-buffer ))
130
140
(with-current-buffer (get-buffer-create " *Phpactor Input*" )
131
141
(erase-buffer )
132
142
(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 ))
134
144
(with-current-buffer output
135
145
(goto-char (point-min ))
136
146
(json-read-object )))))
You can’t perform that action at this time.
0 commit comments