summary refs log tree commit diff
path: root/emacs/elisp
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-25 11:04:40 -0700
committerFranck Cuny <franck@fcuny.net>2022-03-25 11:04:40 -0700
commitb4ce0367b4bd36c2f0fd6dffe4b1a24a11f165f9 (patch)
treeab0d901bd3263face69965b15ff23ed5841d9580 /emacs/elisp
parentmac: ensure exec-path-from-shell is installed (diff)
downloademacs.d-b4ce0367b4bd36c2f0fd6dffe4b1a24a11f165f9.tar.gz
work: add function to search on sourcegraph
Diffstat (limited to 'emacs/elisp')
-rw-r--r--emacs/elisp/my-work.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/emacs/elisp/my-work.el b/emacs/elisp/my-work.el
index bdd917c..f0c59d8 100644
--- a/emacs/elisp/my-work.el
+++ b/emacs/elisp/my-work.el
@@ -6,5 +6,16 @@
   "Return t if this is a work machine."
   (string-match "HQ\\.*" (system-name)))
 
+(defun my/work-code-search ()
+  "Search code on sourcegraph for a given language."
+  (interactive)
+  (let ((language (completing-read
+                   "Language: "
+                   '("Ruby" "Python"  "Go")))
+        (code (read-string "Code: ")))
+    (browse-url
+     (concat "https://sourcegraph.rbx.com/search?q=context:global+lang:" language
+             "+" code))))
+
 (provide 'my-work)
 ;;; my-work.el ends here