More cider buck stuff

This commit is contained in:
doty 2020-07-07 06:51:26 -07:00
parent 3a3dda26ac
commit 91528d8ee8

View file

@ -20,13 +20,16 @@
;;; Commentary: ;;; Commentary:
;; This is just a bunch of funcitons to make cider work well with a buck ;; This is just a bunch of functions to make cider work well with a buck
;; project. ;; project.
;;; Code: ;;; Code:
(require 'cider)
(defun cider-buck--nrepl-target (src-file) (defun cider-buck--nrepl-target (src-file)
"Get the nrepl buck target of SRC-FILE." "Get the nrepl buck target of SRC-FILE."
(message "Searching for the nrepl target for %s" src-file)
(with-temp-buffer (with-temp-buffer
(let ((stdout-buffer (current-buffer))) (let ((stdout-buffer (current-buffer)))
(with-temp-buffer (with-temp-buffer
@ -69,6 +72,22 @@
(lambda (server-buffer) (lambda (server-buffer)
(cider-connect-sibling-clj () server-buffer)))) (cider-connect-sibling-clj () server-buffer))))
(defun cider-fix-docs ()
"Run commands in the cider session that will allow us to fix the documentation."
(interactive)
(let ((form "
(let [props {\"http.proxyHost\" \"fwdproxy\"
\"http.proxyPort\" \"8080\"
\"https.proxyHost\" \"fwdproxy\"
\"https.proxyPort\" \"8080\"}
old-vals (zipmap (keys props) (map (fn [p] (System/getProperty p)) (keys props)))]
(require 'cider.nrepl.inlined_deps.orchard.v0v5v1.orchard.clojuredocs)
(map (fn [p] (System/setProperty (first p) (second p))) props)
(cider.nrepl.inlined_deps.orchard.v0v5v1.orchard.clojuredocs/load-cache!)
(map (fn [p] (System/setProperty (first p) (second p))) old-vals))
"))
(cider-interactive-eval form)))
(provide 'cider-buck) (provide 'cider-buck)
;;; cider-buck.el ends here ;;; cider-buck.el ends here