Skip to content

Commit 1c975b8

Browse files
committed
Rename variables to match package.
1 parent dc3f137 commit 1c975b8

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

ts-comint.el

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@
6464

6565
(require 'comint)
6666

67-
(defgroup inferior-ts nil
67+
(defgroup ts-comint nil
6868
"Run a Typescript process in a buffer."
69-
:group 'inferior-ts)
69+
:group 'languages)
7070

71-
(defcustom inferior-ts-program-command "tsun"
71+
(defcustom ts-comint-program-command "tsun"
7272
"Typescript interpreter."
73-
:group 'inferior-ts)
73+
:group 'ts-comint)
7474

75-
(defcustom inferior-ts-program-arguments nil
75+
(defcustom ts-comint-program-arguments nil
7676
"List of command line arguments to pass to the Typescript interpreter."
77-
:group 'inferior-ts)
77+
:group 'ts-comint)
7878

79-
(defcustom inferior-ts-mode-hook nil
79+
(defcustom ts-comint-mode-hook nil
8080
"*Hook for customizing inferior-ts mode."
8181
:type 'hook
82-
:group 'inferior-ts)
82+
:group 'ts-comint)
8383

84-
(defcustom inferior-ts-mode-ansi-color t
84+
(defcustom ts-comint-mode-ansi-color t
8585
"Use ansi-colors for inferior Typescript mode."
86-
:group 'inferior-ts)
86+
:group 'ts-comint)
8787

88-
(defvar inferior-ts-buffer nil
88+
(defvar ts-comint-buffer nil
8989
"Name of the inferior Typescript buffer.")
9090

9191
(defvar ts-prompt-regexp "^\\(?:> \\)"
@@ -94,7 +94,7 @@
9494

9595
(defun ts--is-nodejs ()
9696
(string= "node"
97-
(substring-no-properties inferior-ts-program-command -4 nil)))
97+
(substring-no-properties ts-comint-program-command -4 nil)))
9898

9999
(defun ts--guess-load-file-cmd (filename)
100100
(let ((cmd (concat "require(\"" filename "\")\n")))
@@ -108,8 +108,8 @@
108108
"Run an inferior Typescript process, input and output via buffer `*ts*'.
109109
If there is a process already running in `*ts*', switch to that buffer.
110110
With argument, allows you to edit the command line (default is value
111-
of `inferior-ts-program-command').
112-
Runs the hook `inferior-ts-mode-hook' \(after the `comint-mode-hook'
111+
of `ts-comint-program-command').
112+
Runs the hook `ts-comint-mode-hook' \(after the `comint-mode-hook'
113113
is run).
114114
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
115115
(interactive
@@ -120,23 +120,23 @@ is run).
120120
(mapconcat
121121
'identity
122122
(cons
123-
inferior-ts-program-command
124-
inferior-ts-program-arguments)
123+
ts-comint-program-command
124+
ts-comint-program-arguments)
125125
" ")))
126-
(setq inferior-ts-program-arguments (split-string cmd))
127-
(setq inferior-ts-program-command (pop inferior-ts-program-arguments)))))
126+
(setq ts-comint-program-arguments (split-string cmd))
127+
(setq ts-comint-program-command (pop ts-comint-program-arguments)))))
128128

129129
(if (not (comint-check-proc "*ts*"))
130130
(with-current-buffer
131-
(apply 'make-comint "ts" inferior-ts-program-command
132-
nil inferior-ts-program-arguments)
133-
(inferior-ts-mode)))
134-
(setq inferior-ts-buffer "*ts*")
131+
(apply 'make-comint "ts" ts-comint-program-command
132+
nil ts-comint-program-arguments)
133+
(ts-comint-mode)))
134+
(setq ts-comint-buffer "*ts*")
135135
(if (not dont-switch-p)
136136
(pop-to-buffer "*ts*"))
137137

138138
;; apply terminal preferences
139-
(if inferior-ts-mode-ansi-color
139+
(if ts-comint-mode-ansi-color
140140
(progn
141141
;; based on
142142
;; http://stackoverflow.com/questions/13862471/using-node-ts-with-ts-comint-in-emacs
@@ -154,18 +154,18 @@ is run).
154154
(defun ts-send-region (start end)
155155
"Send the current region to the inferior Typescript process."
156156
(interactive "r")
157-
(run-ts inferior-ts-program-command t)
158-
(comint-send-region inferior-ts-buffer start end)
159-
(comint-send-string inferior-ts-buffer "\n"))
157+
(run-ts ts-comint-program-command t)
158+
(comint-send-region ts-comint-buffer start end)
159+
(comint-send-string ts-comint-buffer "\n"))
160160

161161
;;;###autoload
162162
(defun ts-send-region-and-go (start end)
163163
"Send the current region to the inferior Typescript process."
164164
(interactive "r")
165-
(run-ts inferior-ts-program-command t)
166-
(comint-send-region inferior-ts-buffer start end)
167-
;; (comint-send-string inferior-ts-buffer "\n")
168-
(switch-to-ts inferior-ts-buffer))
165+
(run-ts ts-comint-program-command t)
166+
(comint-send-region ts-comint-buffer start end)
167+
;; (comint-send-string ts-comint-buffer "\n")
168+
(switch-to-ts ts-comint-buffer))
169169

170170
;;;###autoload
171171
(defun ts-send-last-sexp-and-go ()
@@ -207,55 +207,55 @@ is run).
207207
"Load a file in the Typescript interpreter."
208208
(interactive "f")
209209
(let ((filename (expand-file-name filename)))
210-
(run-ts inferior-ts-program-command t)
211-
(comint-send-string inferior-ts-buffer (ts--guess-load-file-cmd filename))))
210+
(run-ts ts-comint-program-command t)
211+
(comint-send-string ts-comint-buffer (ts--guess-load-file-cmd filename))))
212212

213213
;;;###autoload
214214
(defun ts-load-file-and-go (filename)
215215
"Load a file in the Typescript interpreter."
216216
(interactive "f")
217217
(let ((filename (expand-file-name filename)))
218-
(run-ts inferior-ts-program-command t)
219-
(comint-send-string inferior-ts-buffer (ts--guess-load-file-cmd filename))
220-
(switch-to-ts inferior-ts-buffer)))
218+
(run-ts ts-comint-program-command t)
219+
(comint-send-string ts-comint-buffer (ts--guess-load-file-cmd filename))
220+
(switch-to-ts ts-comint-buffer)))
221221

222222
;;;###autoload
223223
(defun switch-to-ts (eob-p)
224224
"Switch to the Typescript process buffer.
225225
With argument, position cursor at end of buffer."
226226
(interactive "P")
227-
(if (and inferior-ts-buffer (get-buffer inferior-ts-buffer))
228-
(pop-to-buffer inferior-ts-buffer)
229-
(error "No current process buffer. See variable `inferior-ts-buffer'"))
227+
(if (and ts-comint-buffer (get-buffer ts-comint-buffer))
228+
(pop-to-buffer ts-comint-buffer)
229+
(error "No current process buffer. See variable `ts-comint-buffer'"))
230230
(when eob-p
231231
(push-mark)
232232
(goto-char (point-max))))
233233

234-
(defvar inferior-ts-mode-map
234+
(defvar ts-comint-mode-map
235235
(let ((m (make-sparse-keymap)))
236236
(define-key m "\C-x\C-e" 'ts-send-last-sexp)
237237
(define-key m "\C-cl" 'ts-load-file)
238238
m))
239239

240240
;;;###autoload
241-
(define-derived-mode inferior-ts-mode comint-mode "Inferior Typescript"
241+
(define-derived-mode ts-comint-mode comint-mode "Inferior Typescript"
242242
"Major mode for interacting with an inferior Typescript process.
243243
244244
The following commands are available:
245-
\\{inferior-ts-mode-map}
245+
\\{ts-comint-mode-map}
246246
247247
A typescript process can be fired up with M-x run-ts.
248248
249249
Customization: Entry to this mode runs the hooks on comint-mode-hook and
250-
inferior-ts-mode-hook (in that order).
250+
ts-comint-mode-hook (in that order).
251251
252252
You can send text to the inferior Typescript process from other buffers containing
253253
Typescript source.
254254
switch-to-ts switches the current buffer to the Typescript process buffer.
255255
ts-send-region sends the current region to the Typescript process.
256256
"
257257
:group 'inferior-ts
258-
(use-local-map inferior-ts-mode-map))
258+
(use-local-map ts-comint-mode-map))
259259

260260
(provide 'ts-comint)
261261
;;; ts-comint.el ends here

0 commit comments

Comments
 (0)