From 34b393d512c67857f664e6e7f7cc09bb72019a8a Mon Sep 17 00:00:00 2001 From: torstein Date: Fri, 19 Oct 2018 21:03:25 +0200 Subject: [PATCH 1/3] Add lookup (in Emacs) from local Hoogle server --- haskell-hoogle.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/haskell-hoogle.el b/haskell-hoogle.el index 62aaaaad7..44c716e76 100644 --- a/haskell-hoogle.el +++ b/haskell-hoogle.el @@ -2,6 +2,7 @@ ;; Copyright © 2015 Steve Purcell ;; 2016 Arthur Fayzrakhmanov +;; 2018 Torstein Sørnes ;; Author: Steve Purcell ;; Keywords: docs @@ -46,6 +47,7 @@ If nil, use the Hoogle web-site." (const :tag "haskell-org" "http://haskell.org/hoogle/?q=%s") (const :tag "fp-complete" "https://www.stackage.org/lts/hoogle?q=%s") (const :tag "hayoo" "http://hayoo.fh-wedel.de/?query=%s") + (const :tag "local" (format "http://localhost:%i/?hoogle=%s" haskell-hoogle-port-number)) string)) ;;;###autoload From 9ab4a51b6934423dd54a0bdc57d9c5eeae957cd5 Mon Sep 17 00:00:00 2001 From: torstein Date: Fri, 19 Oct 2018 21:05:58 +0200 Subject: [PATCH 2/3] Add option to start Hoogle server via local stack configuration --- haskell-hoogle.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/haskell-hoogle.el b/haskell-hoogle.el index 44c716e76..90d431c8f 100644 --- a/haskell-hoogle.el +++ b/haskell-hoogle.el @@ -96,6 +96,18 @@ is asked to show extra info for the items matching QUERY.." "hoogle" "server" "-p" (number-to-string haskell-hoogle-port-number)))) (error "\"hoogle\" executable not found"))) +(defun haskell-hoogle-start-stack-server () + "Start hoogle local server using the local Stack configuration." + (interactive) + (if (executable-find "stack") + (unless (haskell-hoogle-server-live-p) + (set 'haskell-hoogle-server-process + (start-process + haskell-hoogle-server-process-name + (get-buffer-create haskell-hoogle-server-buffer-name) + "stack" "hoogle" "--setup" "--" "server" "-p" (number-to-string haskell-hoogle-port-number)))) + (error "\"stack\" executable not found"))) + (defun haskell-hoogle-server-live-p () "Whether the hoogle server process is live." (condition-case _err From 3d91886f9f709c5cf5efa4622a2a4275eab907d3 Mon Sep 17 00:00:00 2001 From: torstein Date: Mon, 22 Oct 2018 17:55:43 +0200 Subject: [PATCH 3/3] Remove unnecessary check --- haskell-hoogle.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/haskell-hoogle.el b/haskell-hoogle.el index 90d431c8f..433020fca 100644 --- a/haskell-hoogle.el +++ b/haskell-hoogle.el @@ -99,14 +99,13 @@ is asked to show extra info for the items matching QUERY.." (defun haskell-hoogle-start-stack-server () "Start hoogle local server using the local Stack configuration." (interactive) - (if (executable-find "stack") - (unless (haskell-hoogle-server-live-p) + (unless (haskell-hoogle-server-live-p) (set 'haskell-hoogle-server-process (start-process haskell-hoogle-server-process-name (get-buffer-create haskell-hoogle-server-buffer-name) "stack" "hoogle" "--setup" "--" "server" "-p" (number-to-string haskell-hoogle-port-number)))) - (error "\"stack\" executable not found"))) + ) (defun haskell-hoogle-server-live-p () "Whether the hoogle server process is live."