From 91528d8ee8b521f498cf5b46fb55fd24ff2bf6f3 Mon Sep 17 00:00:00 2001 From: doty Date: Tue, 7 Jul 2020 06:51:26 -0700 Subject: [PATCH] More cider buck stuff --- site-lisp/cider-buck.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/site-lisp/cider-buck.el b/site-lisp/cider-buck.el index 8ee56d3..5879918 100644 --- a/site-lisp/cider-buck.el +++ b/site-lisp/cider-buck.el @@ -20,13 +20,16 @@ ;;; 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. ;;; Code: +(require 'cider) + (defun cider-buck--nrepl-target (src-file) "Get the nrepl buck target of SRC-FILE." + (message "Searching for the nrepl target for %s" src-file) (with-temp-buffer (let ((stdout-buffer (current-buffer))) (with-temp-buffer @@ -69,6 +72,22 @@ (lambda (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) ;;; cider-buck.el ends here