4242(require 'term )
4343(require 'subr-x )
4444(require 'cl-lib )
45+ (require 'compile )
46+ (require 'seq )
4547
46-
48+ ; ;
4749; ; customizations
50+ ; ;
4851
4952(defgroup julia-repl nil
5053 " A minor mode for a Julia REPL"
@@ -74,8 +77,9 @@ Note that this affects all buffers using the ‘ansi-term’ map."
7477 :type 'boolean
7578 :group 'julia-repl )
7679
77-
80+ ; ;
7881; ; global variables
82+ ; ;
7983
8084(defvar julia-repl--compilation-regexp-alist
8185 '(; ; matches "while loading /tmp/Foo.jl, in expression starting on line 2"
@@ -140,8 +144,9 @@ generate a buffer name.")
140144Valid values are NIL or a string. These take effect the next time
141145a new Julia process is started." )
142146
143-
147+ ; ;
144148; ; REPL buffer creation and setup
149+ ; ;
145150
146151(cl-defun julia-repl--inferior-buffer-name
147152 (&optional (executable-key (julia-repl--get-executable-key))
@@ -192,7 +197,7 @@ Queries and appends missing information if necessary.
192197Note: when cannot capture the base dir, it is set to NIL to
193198prevent further attempts."
194199 (unless (plist-member (cddr executable-record) :basedir )
195- (let* ((executable-path (second executable-record))
200+ (let* ((executable-path (cl- second executable-record))
196201 (basedir (julia-repl--capture-basedir executable-path)))
197202 (nconc executable-record `(:basedir ,basedir ))
198203 (unless basedir
@@ -273,7 +278,7 @@ Return the buffer. Buffer is not raised."
273278 (let ((executable-record (julia-repl--executable-record executable-key))
274279 (inferior-buffer-name (julia-repl--inferior-buffer-name executable-key suffix)))
275280 (julia-repl--complete-executable-record! executable-record)
276- (let* ((executable-path (second executable-record))
281+ (let* ((executable-path (cl- second executable-record))
277282 (basedir (plist-get (cddr executable-record) :basedir ))
278283 (inferior-buffer (julia-repl--start-inferior inferior-buffer-name
279284 executable-path)))
@@ -300,8 +305,9 @@ raised if not found."
300305 (when (term-check-proc inferior-buffer)
301306 inferior-buffer)))
302307
303-
308+ ; ;
304309; ; prompting for executable-key and suffix
310+ ; ;
305311
306312(defun julia-repl--matching-inferior-buffers (executable-key )
307313 " A list of macthing inferior buffers for the current source buffer.
@@ -333,12 +339,12 @@ See ‘julia-repl--inferior-buffer-name’."
333339 buffer)
334340 buffer))
335341 matching-inferior-buffers))
336- (suffix-buffer-alist (stable-sort suffix-buffer-alist
337- (lambda (x y )
338- (or (not x)
339- (string< (prin1-to-string x)
340- (prin1-to-string y))))
341- :key #'car ))
342+ (suffix-buffer-alist (cl- stable-sort suffix-buffer-alist
343+ (lambda (x y )
344+ (or (not x)
345+ (string< (prin1-to-string x)
346+ (prin1-to-string y))))
347+ :key #'car ))
342348 (suffix (completing-read " julia-repl inferior buffer name suffix: "
343349 suffix-buffer-alist)))
344350 (message " suffix buffer alist %s " suffix)
@@ -352,7 +358,7 @@ See ‘julia-repl--inferior-buffer-name’."
352358 (while (get-buffer (julia-repl--add-earmuffs
353359 (julia-repl--inferior-buffer-name executable-key
354360 index)))
355- (incf index))
361+ (cl- incf index))
356362 index))
357363
358364(defun julia-repl-prompt-set-inferior-buffer-name-suffix (arg )
@@ -375,7 +381,7 @@ Both of these happen without prompting."
375381 ((integerp arg)
376382 arg)
377383 ((listp arg)
378- (first arg)))))
384+ (cl- first arg)))))
379385 (setq julia-repl-inferior-buffer-name-suffix suffix)
380386 (message " julia-repl-inferior-buffer-name-suffix set to %s " suffix)))
381387
@@ -404,8 +410,9 @@ Valid keys are the first items in ‘julia-repl-executable-records’."
404410 (message " julia-repl-executable-key set to %s "
405411 (propertize (symbol-name key) 'face 'font-lock-constant-face ))))
406412
407-
413+ ; ;
408414; ; high-level functions
415+ ; ;
409416
410417(defun julia-repl-inferior-buffer ()
411418 " Return the Julia REPL inferior buffer, creating one if it does not exist."
@@ -422,8 +429,9 @@ This is the standard entry point for using this package."
422429 (interactive )
423430 (switch-to-buffer-other-window (julia-repl-inferior-buffer)))
424431
425-
432+ ; ;
426433; ; sending to the REPL
434+ ; ;
427435
428436(defun julia-repl--send-string (string &optional no-newline no-bracketed-paste )
429437 " Send STRING to the Julia REPL term buffer.
0 commit comments