aboutsummaryrefslogtreecommitdiff
path: root/hcel-client.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-21 15:14:50 +1000
committerYuchen Pei <hi@ypei.me>2022-09-21 15:14:50 +1000
commitdae8c96bfdcf81ff6e39890de2d3d1be788e552f (patch)
treec7879510ed692b02f45575ed16bd1e3673d0ea83 /hcel-client.el
parent0d47d10cfe4ed7fb8ea7b8013b6593c868be8391 (diff)
Fixing some compile warnings
Diffstat (limited to 'hcel-client.el')
-rw-r--r--hcel-client.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/hcel-client.el b/hcel-client.el
index 775d878..eb43dc9 100644
--- a/hcel-client.el
+++ b/hcel-client.el
@@ -17,12 +17,13 @@
;; You should have received a copy of the GNU Affero General Public
;; License along with hcel. If not, see <https://www.gnu.org/licenses/>.
+(require 'hcel-utils)
(defcustom hcel-host "localhost:8080"
"hcel server host"
- :group 'hcel)
+ :group 'hcel :type '(string))
(defcustom hcel-indexed-dir "/.haskell-code-explorer"
"hcel indexed dir"
- :group 'hcel)
+ :group 'hcel :type '(string))
(defvar hcel-client-buffer-name "*hcel-client*")
@@ -140,7 +141,8 @@
(insert "[" (current-time-string) "] Request: " url "\n"))
(with-current-buffer (url-retrieve-synchronously url t)
(let ((header) (status) (fields))
- (delete-http-header)
+ (hcel-delete-http-header)
+ (goto-char (point-min))
(setq header (hcel-parse-http-header (car kill-ring))
status (alist-get 'status header)
fields (alist-get 'fields header))
@@ -159,4 +161,10 @@
(json-read)))
(error "HTTP error: %s" (buffer-substring (point) (point-max)))))))
+(defun hcel-delete-http-header ()
+ (save-excursion
+ (goto-char (point-min))
+ (kill-region (point) (progn (re-search-forward "\r?\n\r?\n")
+ (point)))))
+
(provide 'hcel-client)