@@ -319,8 +319,7 @@ fully initialized."
319
319
((pred identity) (pop-to-buffer buffer)))
320
320
(with-current-buffer buffer
321
321
(cider-repl--insert-banner)
322
- (cider-repl--insert-param-values `((:cljs-repl-type " cljs repl type" ,#'symbol-name )
323
- (:repl-init-form " cljs repl startup command" )))
322
+ (cider-repl--insert-startup-commands)
324
323
(when-let* ((window (get-buffer-window buffer t )))
325
324
(with-selected-window window
326
325
(recenter (- -1 scroll-margin))))
@@ -335,7 +334,7 @@ fully initialized."
335
334
(insert-before-markers
336
335
(propertize (cider-repl--help-banner) 'font-lock-face 'font-lock-comment-face ))))
337
336
338
- (defun cider-repl--insert-param-values ( param-tuples )
337
+ (defun cider-repl--insert-startup-commands ( )
339
338
" Insert the values from params specified in PARAM-TUPLES.
340
339
PARAM-TUPLES are tuples of (param-key description) or (param-key
341
340
description transform) where transform is called with the param-value if
@@ -347,18 +346,18 @@ present."
347
346
(propertize
348
347
(if (string-blank-p contents) " ;;\n " (concat " ;; " contents " \n " ))
349
348
'font-lock-face 'font-lock-comment-face ))))
350
- (let ((present-values ( thread-last param-tuples
351
- ( seq-map ( lambda ( tuple )
352
- ( cl-destructuring-bind (param-key desc &optional transform) tuple
353
- (when-let ((value ( plist-get cider-saved-params param-key)))
354
- ( list desc ( funcall ( or transform # 'identity ) value))))))
355
- ( seq-filter # 'identity ) )))
356
- (when present-values
349
+ (let ((jack-in-command ( plist-get cider-saved-params :jack-in-cmd ))
350
+ (cljs-repl-type ( plist-get cider-saved-params :cljs-repl-type ) )
351
+ (cljs-init-form ( plist-get cider-saved-params :repl-init-form )))
352
+ (when jack-in-command
353
+ ; ; spaces to align with the banner
354
+ (emit-comment ( concat " Startup: " jack-in-command )))
355
+ (when ( or cljs-repl-type cljs-init-form)
357
356
(emit-comment " " )
358
- (mapc ( lambda ( desc-and-value )
359
- ( cl-destructuring-bind (desc value) desc-and-value
360
- (emit-comment ( concat desc " : " value))))
361
- present-values )
357
+ (when cljs-repl-type
358
+ (emit-comment ( concat " cljs repl type: " ( symbol-name cljs-repl-type))))
359
+ ( when cljs-init-form
360
+ (emit-comment ( concat " cljs repl startup command: " cljs-init-form)) )
362
361
(emit-comment " " )))))
363
362
364
363
(defun cider-repl--banner ()
@@ -372,15 +371,13 @@ present."
372
371
;; Javadoc: (javadoc java-object-or-class)
373
372
;; Exit: <C-c C-q>
374
373
;; Results: Stored in vars *1, *2, *3, an exception in *e;
375
- ;; Startup: %s
376
374
"
377
375
(plist-get nrepl-endpoint :host )
378
376
(plist-get nrepl-endpoint :port )
379
377
(cider--version)
380
378
(cider--nrepl-version)
381
379
(cider--clojure-version)
382
- (cider--java-version)
383
- (plist-get cider-saved-params :jack-in-cmd )))
380
+ (cider--java-version)))
384
381
385
382
(defun cider-repl--help-banner ()
386
383
" Generate the help banner."
0 commit comments