42
42
(require 'term )
43
43
(require 'subr-x )
44
44
(require 'cl-lib )
45
+ (require 'compile )
46
+ (require 'seq )
45
47
46
-
48
+ ; ;
47
49
; ; customizations
50
+ ; ;
48
51
49
52
(defgroup julia-repl nil
50
53
" A minor mode for a Julia REPL"
@@ -74,8 +77,9 @@ Note that this affects all buffers using the ‘ansi-term’ map."
74
77
:type 'boolean
75
78
:group 'julia-repl )
76
79
77
-
80
+ ; ;
78
81
; ; global variables
82
+ ; ;
79
83
80
84
(defvar julia-repl--compilation-regexp-alist
81
85
'(; ; matches "while loading /tmp/Foo.jl, in expression starting on line 2"
@@ -140,8 +144,9 @@ generate a buffer name.")
140
144
Valid values are NIL or a string. These take effect the next time
141
145
a new Julia process is started." )
142
146
143
-
147
+ ; ;
144
148
; ; REPL buffer creation and setup
149
+ ; ;
145
150
146
151
(cl-defun julia-repl--inferior-buffer-name
147
152
(&optional (executable-key (julia-repl--get-executable-key))
@@ -192,7 +197,7 @@ Queries and appends missing information if necessary.
192
197
Note: when cannot capture the base dir, it is set to NIL to
193
198
prevent further attempts."
194
199
(unless (plist-member (cddr executable-record) :basedir )
195
- (let* ((executable-path (second executable-record))
200
+ (let* ((executable-path (cl- second executable-record))
196
201
(basedir (julia-repl--capture-basedir executable-path)))
197
202
(nconc executable-record `(:basedir , basedir ))
198
203
(unless basedir
@@ -273,7 +278,7 @@ Return the buffer. Buffer is not raised."
273
278
(let ((executable-record (julia-repl--executable-record executable-key))
274
279
(inferior-buffer-name (julia-repl--inferior-buffer-name executable-key suffix)))
275
280
(julia-repl--complete-executable-record! executable-record)
276
- (let* ((executable-path (second executable-record))
281
+ (let* ((executable-path (cl- second executable-record))
277
282
(basedir (plist-get (cddr executable-record) :basedir ))
278
283
(inferior-buffer (julia-repl--start-inferior inferior-buffer-name
279
284
executable-path)))
@@ -300,8 +305,9 @@ raised if not found."
300
305
(when (term-check-proc inferior-buffer)
301
306
inferior-buffer)))
302
307
303
-
308
+ ; ;
304
309
; ; prompting for executable-key and suffix
310
+ ; ;
305
311
306
312
(defun julia-repl--matching-inferior-buffers (executable-key )
307
313
" A list of macthing inferior buffers for the current source buffer.
@@ -333,12 +339,12 @@ See ‘julia-repl--inferior-buffer-name’."
333
339
buffer)
334
340
buffer))
335
341
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 ))
342
348
(suffix (completing-read " julia-repl inferior buffer name suffix: "
343
349
suffix-buffer-alist)))
344
350
(message " suffix buffer alist %s " suffix)
@@ -352,7 +358,7 @@ See ‘julia-repl--inferior-buffer-name’."
352
358
(while (get-buffer (julia-repl--add-earmuffs
353
359
(julia-repl--inferior-buffer-name executable-key
354
360
index)))
355
- (incf index))
361
+ (cl- incf index))
356
362
index))
357
363
358
364
(defun julia-repl-prompt-set-inferior-buffer-name-suffix (arg )
@@ -375,7 +381,7 @@ Both of these happen without prompting."
375
381
((integerp arg)
376
382
arg)
377
383
((listp arg)
378
- (first arg)))))
384
+ (cl- first arg)))))
379
385
(setq julia-repl-inferior-buffer-name-suffix suffix)
380
386
(message " julia-repl-inferior-buffer-name-suffix set to %s " suffix)))
381
387
@@ -404,8 +410,9 @@ Valid keys are the first items in ‘julia-repl-executable-records’."
404
410
(message " julia-repl-executable-key set to %s "
405
411
(propertize (symbol-name key) 'face 'font-lock-constant-face ))))
406
412
407
-
413
+ ; ;
408
414
; ; high-level functions
415
+ ; ;
409
416
410
417
(defun julia-repl-inferior-buffer ()
411
418
" 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."
422
429
(interactive )
423
430
(switch-to-buffer-other-window (julia-repl-inferior-buffer)))
424
431
425
-
432
+ ; ;
426
433
; ; sending to the REPL
434
+ ; ;
427
435
428
436
(defun julia-repl--send-string (string &optional no-newline no-bracketed-paste )
429
437
" Send STRING to the Julia REPL term buffer.
0 commit comments