Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e538610

Browse filesBrowse files
committed
Remove unnecessary code.
1 parent d68698e commit e538610
Copy full SHA for e538610

File tree

1 file changed

+1
-44
lines changed
Filter options

1 file changed

+1
-44
lines changed

‎psci.el

Copy file name to clipboardExpand all lines: psci.el
+1-44Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@
7171
(defvar psci/prompt "> "
7272
"The psci prompt.")
7373

74-
(defvar psci/project-module-file ".psci"
75-
"The default file referencing the purescript modules to load at psci startup.")
76-
77-
(defvar psci/--modules-folder ".psci_modules"
78-
"The modules folder psci uses as cache.")
79-
8074
;; private functions
8175

8276
(defun psci/log (msg)
@@ -102,28 +96,6 @@ When FILENAME is nil or not a real file, returns nil."
10296
(insert-file-contents filename)
10397
(buffer-substring-no-properties (point-min) (point-max)))))
10498

105-
(defun psci/--project-psci-file (project-root-folder)
106-
"Compute the project's psci file from the PROJECT-ROOT-FOLDER.
107-
Returns nil if no .psci file is found."
108-
(let ((psci-module-file (expand-file-name psci/project-module-file project-root-folder)))
109-
(when (file-exists-p psci-module-file)
110-
psci-module-file)))
111-
112-
(defun psci/--project-module-files! ()
113-
"Compulse the list of modules for the current project.
114-
Assumes the location of the modules is the project root folder."
115-
(let* ((parent-root-folder (psci/--project-root!))
116-
(psci-module-file (psci/--project-psci-file parent-root-folder)))
117-
(when psci-module-file
118-
(->> psci-module-file
119-
psci/--file-content
120-
(s-split "\n")
121-
nreverse))))
122-
123-
(defun psci/--compute-modules-folder (project-root-folder)
124-
"Compute the psci modules folder from PROJECT-ROOT-FOLDER."
125-
(concat project-root-folder psci/--modules-folder))
126-
12799
(defun psci/--run-psci-command! (command)
128100
"Run psci COMMAND as string."
129101
(-when-let (process (get-buffer-process (psci/--process-name psci/buffer-name)))
@@ -203,20 +175,6 @@ Relies on .psci file for determining the project's root folder."
203175
(-when-let (module-name (psci/--compute-module-name!))
204176
(psci/--run-psci-command! (format "import %s" module-name))))
205177

206-
;;;###autoload
207-
(defun psci/load-project-modules! ()
208-
"Load the modules needed for the repl session.
209-
We chose to load the .psci file's content (the purescript doc proposes its use)."
210-
(interactive)
211-
(lexical-let ((archive-folder (psci/--compute-modules-folder (psci/--project-root!))))
212-
(deferred:$
213-
(deferred:process-shell "rm -rf " (shell-quote-argument (format "%s/node_modules/*" archive-folder))) ;; clean compiled version
214-
(deferred:nextc it (lambda () (call-interactively 'psci/reset!))) ;; flush in-memory version
215-
(deferred:nextc it ;; at last reload all files
216-
(lambda ()
217-
(-when-let (commands (psci/--project-module-files!))
218-
(mapc #'psci/--run-psci-command! commands)))))))
219-
220178
;;;###autoload
221179
(defun psci/reset! ()
222180
"Reset the current status of the repl session."
@@ -232,14 +190,13 @@ We chose to load the .psci file's content (the purescript doc proposes its use).
232190
(defvar inferior-psci-mode-map
233191
(let ((map (make-sparse-keymap)))
234192
(define-key map (kbd "C-c C-l") 'psci/load-current-file!)
235-
(define-key map (kbd "C-c C-r") 'psci/load-project-modules!)
236193
(define-key map (kbd "C-c M-n") 'psci/load-module!)
237194
map)
238195
"Basic mode map for `inferior-psci-mode'.")
239196

240197
(defgroup psci nil "psci customisation group."
241198
:tag "psci"
242-
:version "0.0.4"
199+
:version "0.0.9"
243200
:group 'purescript
244201
:prefix "psci/")
245202

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.