aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-12-28 17:14:30 +0100
committerOscar Najera <hi@oscarnajera.com>2024-01-13 02:27:42 +0100
commitcfc0e4b5cd738b0f8b64061381ea55d3e935a6dd (patch)
tree6f7effe83889a405c6bca07e01896617f0de9eda
parent97d4f907f670b4a16edf972a9339c194822eb476 (diff)
downloaddotfiles-cfc0e4b5cd738b0f8b64061381ea55d3e935a6dd.tar.gz
dotfiles-cfc0e4b5cd738b0f8b64061381ea55d3e935a6dd.tar.bz2
dotfiles-cfc0e4b5cd738b0f8b64061381ea55d3e935a6dd.zip
semgrep user config
-rw-r--r--config/doom/config.org7
-rw-r--r--scratch/semgrep/semgrep.el7
2 files changed, 13 insertions, 1 deletions
diff --git a/config/doom/config.org b/config/doom/config.org
index c387f0e..2117188 100644
--- a/config/doom/config.org
+++ b/config/doom/config.org
@@ -139,6 +139,13 @@ Invited: %^t
"#+title: ${title}")
:unnarrowed t))
org-roam-capture-ref-templates org-roam-capture-templates))
+
+(use-package! semgrep
+ :after org
+ :load-path "~/dev/dotfiles/scratch/semgrep"
+ :commands (semgrep-search)
+ :config
+ (setq semgrep-server-url "http://localhost:8080"))
#+end_src
** Alerts
This is to set the reminders of calendar events.
diff --git a/scratch/semgrep/semgrep.el b/scratch/semgrep/semgrep.el
index a93803b..fdfcfdb 100644
--- a/scratch/semgrep/semgrep.el
+++ b/scratch/semgrep/semgrep.el
@@ -26,6 +26,11 @@
;; Silence byte-compiler.
(defvar url-http-end-of-headers)
+(defcustom semgrep-server-url "http://localhost:8080"
+ "Address where the Python server with the chromadb is listening."
+ :type 'url
+ :group 'semgrep)
+
(defun semgrep--connect (method data)
(let ((url-request-method "POST")
(url-request-extra-headers '(("Content-Type" . "application/json")))
@@ -33,7 +38,7 @@
(json-serialize `(,method ,data))
'utf-8)))
(with-current-buffer
- (url-retrieve-synchronously "http://localhost:8080")
+ (url-retrieve-synchronously semgrep-server-url)
(goto-char url-http-end-of-headers)
(json-read))))