Skip to content

Commit 35f156d

Browse files
committed
Rename private functions to use a well-formed symbol prefix
1 parent 869e731 commit 35f156d

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

psci.el

+17-17
Original file line numberDiff line numberDiff line change
@@ -83,47 +83,47 @@
8383

8484
;; private functions
8585

86-
(defun psci/--project-root! ()
86+
(defun psci--project-root! ()
8787
"Determine the project's root folder.
8888
Beware, can return nil if no .psci file is found."
8989
(if (and (fboundp 'projectile-project-root) (projectile-project-p))
9090
(projectile-project-root)
9191
default-directory))
9292

93-
(defun psci/--process-name (buffer-name)
93+
(defun psci--process-name (buffer-name)
9494
"Compute the buffer's process name based on BUFFER-NAME."
9595
(format "*%s*" buffer-name))
9696

97-
(defun psci/--file-content (filename)
97+
(defun psci--file-content (filename)
9898
"Load FILENAME's content as a string.
9999
When FILENAME is nil or not a real file, returns nil."
100100
(when (and filename (file-exists-p filename))
101101
(with-temp-buffer
102102
(insert-file-contents filename)
103103
(buffer-substring-no-properties (point-min) (point-max)))))
104104

105-
(defun psci/--run-psci-command! (command)
105+
(defun psci--run-psci-command! (command)
106106
"Run psci COMMAND as string."
107-
(-when-let (process (get-buffer-process (psci/--process-name psci/buffer-name)))
107+
(-when-let (process (get-buffer-process (psci--process-name psci/buffer-name)))
108108
(comint-simple-send process command)))
109109

110-
(defun psci/--compute-module-name! ()
110+
(defun psci--compute-module-name! ()
111111
"Compute the current file's module name."
112112
(save-excursion
113113
(goto-char (point-min))
114114
(let ((regexp "^module\\s-+\\\([a-zA-Z0-9\\\.]+\\\)\\b"))
115115
(search-forward-regexp regexp)
116116
(match-string 1))))
117117

118-
(defun psci/--get-psc-package-sources! ()
118+
(defun psci--get-psc-package-sources! ()
119119
"Find extra source path globs using purescript package tools,if they appear to be used."
120120
(cond
121121
((file-exists-p "psc-package.json")
122-
(process-lines (psci/--executable-find-relative psci/psc-package-path) "sources"))
122+
(process-lines (psci--executable-find-relative psci/psc-package-path) "sources"))
123123
((file-exists-p "spago.dhall")
124-
(process-lines (psci/--executable-find-relative psci/spago-path) "sources"))))
124+
(process-lines (psci--executable-find-relative psci/spago-path) "sources"))))
125125

126-
(defun psci/--executable-find-relative (path)
126+
(defun psci--executable-find-relative (path)
127127
"If PATH is a relative path to an executable, return its full path.
128128
Otherwise, just return PATH."
129129
(let ((relative (expand-file-name path)))
@@ -140,17 +140,17 @@ If not supplied, the root folder will be guessed using
140140
`projectile-project-root' (if available), otherwise it will
141141
default to the current buffer's directory."
142142
(interactive (list (read-directory-name "Project root? "
143-
(psci/--project-root!))))
143+
(psci--project-root!))))
144144
(let* ((default-directory project-root-folder)
145145
(psci-program psci/purs-path)
146-
(extra-sources (psci/--get-psc-package-sources!))
146+
(extra-sources (psci--get-psc-package-sources!))
147147
(buffer (comint-check-proc psci/buffer-name)))
148148
;; pop to the "*psci*" buffer if the process is dead, the
149149
;; buffer is missing or it's got the wrong mode.
150150
(pop-to-buffer
151151
(if (or buffer (not (derived-mode-p 'psci-mode))
152152
(comint-check-proc (current-buffer)))
153-
(get-buffer-create (or buffer (psci/--process-name psci/buffer-name)))
153+
(get-buffer-create (or buffer (psci--process-name psci/buffer-name)))
154154
(current-buffer)))
155155
;; create the comint process if there is no buffer.
156156
(unless buffer
@@ -197,20 +197,20 @@ default to the current buffer's directory."
197197
(defun psci/load-module! ()
198198
"Load the module inside the repl session."
199199
(interactive)
200-
(-when-let (module-name (psci/--compute-module-name!))
201-
(psci/--run-psci-command! (format "import %s" module-name))))
200+
(-when-let (module-name (psci--compute-module-name!))
201+
(psci--run-psci-command! (format "import %s" module-name))))
202202

203203
;;;###autoload
204204
(defun psci/reset! ()
205205
"Reset the current status of the repl session."
206206
(interactive)
207-
(psci/--run-psci-command! ":reset"))
207+
(psci--run-psci-command! ":reset"))
208208

209209
;;;###autoload
210210
(defun psci/quit! ()
211211
"Quit the psci session."
212212
(interactive)
213-
(psci/--run-psci-command! ":quit"))
213+
(psci--run-psci-command! ":quit"))
214214

215215
(defvar inferior-psci-mode-map
216216
(let ((map (make-sparse-keymap)))

0 commit comments

Comments
 (0)