<commit_before>;; -*- Mode: Emacs-Lisp -*-

;; jv-cider
;;

(when (boundp 'jv-cider-directory)
  (add-to-list 'load-path jv-cider-directory))

(require 'cider)

(setq nrepl-repl-buffer-name-template "*repl-cider%s*")

;; cider-repl-wrap-history
(setq cider-repl-history-size 5000)
(setq cider-repl-history-file
      (format "%s/.emacs.d/repl-history.txt" homedir))
(setq cider-repl-scroll-on-output nil)

;; copy of original function, with different name
(defun cider--switch-to-repl-buffer-orig (repl-buffer &optional set-namespace)
  "Select the REPL-BUFFER, when possible in an existing window.

Hint: You can use `display-buffer-reuse-frames' and
`special-display-buffer-names' to customize the frame in which
the buffer should appear.

When SET-NAMESPACE is t, sets the namespace in the REPL buffer to
that of the namespace in the Clojure source buffer."
  (cider-ensure-connected)
  (let ((buffer (current-buffer)))
    (delete-other-windows)
    (split-window-below)
    (other-window 1)
    ;; first we switch to the REPL buffer
    (if cider-repl-display-in-current-window
        (pop-to-buffer-same-window repl-buffer)
      (pop-to-buffer repl-buffer))
    ;; then if necessary we update its namespace
    (when set-namespace
      (cider-repl-set-ns (with-current-buffer buffer (cider-current-ns))))
    (cider-remember-clojure-buffer buffer)
    (goto-char (point-max))))

;; TODO: see special-display-buffer-names, maybe it provides a simpler way to customize
;; override
(defun cider--switch-to-repl-buffer (repl-buffer &optional set-namespace)
  "Select the REPL-BUFFER, in the top window, with the current buffer in the bottom."
  (cider-ensure-connected)
  (let ((buffer (current-buffer)))
    (delete-other-windows)
    (split-window-below)
    (other-window 1)
    (cider--switch-to-repl-buffer-orig repl-buffer set-namespace)))

(defun jv-cider-mode ()<commit_msg>Remove call to undefined function<commit_after>;; -*- Mode: Emacs-Lisp -*-

;; jv-cider
;;

(when (boundp 'jv-cider-directory)
  (add-to-list 'load-path jv-cider-directory))

(require 'cider)

(setq nrepl-repl-buffer-name-template "*repl-cider%s*")

;; cider-repl-wrap-history
(setq cider-repl-history-size 5000)
(setq cider-repl-history-file
      (format "%s/.emacs.d/repl-history.txt" homedir))
(setq cider-repl-scroll-on-output nil)

;; copy of original function, with different name
(defun cider--switch-to-repl-buffer-orig (repl-buffer &optional set-namespace)
  "Select the REPL-BUFFER, when possible in an existing window.

Hint: You can use `display-buffer-reuse-frames' and
`special-display-buffer-names' to customize the frame in which
the buffer should appear.

When SET-NAMESPACE is t, sets the namespace in the REPL buffer to
that of the namespace in the Clojure source buffer."
  (cider-ensure-connected)
  (let ((buffer (current-buffer)))
    (delete-other-windows)
    (split-window-below)
    (other-window 1)
    ;; first we switch to the REPL buffer
    (if cider-repl-display-in-current-window
        (pop-to-buffer-same-window repl-buffer)
      (pop-to-buffer repl-buffer))
    ;; then if necessary we update its namespace
    (when set-namespace
      (cider-repl-set-ns (with-current-buffer buffer (cider-current-ns))))
    ;; (cider-remember-clojure-buffer buffer)
    (goto-char (point-max))))

;; TODO: see special-display-buffer-names, maybe it provides a simpler way to customize
;; override
(defun cider--switch-to-repl-buffer (repl-buffer &optional set-namespace)
  "Select the REPL-BUFFER, in the top window, with the current buffer in the bottom."
  (cider-ensure-connected)
  (let ((buffer (current-buffer)))
    (delete-other-windows)
    (split-window-below)
    (other-window 1)
    (cider--switch-to-repl-buffer-orig repl-buffer set-namespace)))

(defun jv-cider-mode ()
{'fraction_non_alphanumeric': 0.13537002897023967, 'fraction_numerical': 0.0031603897814063736, 'mean_word_length': 3.7121588089330024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3345940', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1281, 'n_words': 340}