From 3a024816989dabc229c314ca37ab7cb1c8e1151b Mon Sep 17 00:00:00 2001 From: Tony Day Date: Sat, 14 Mar 2015 12:53:09 +1000 Subject: [PATCH 1/2] Added haskell-hoogle-url --- haskell-mode.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/haskell-mode.el b/haskell-mode.el index 768c76baa..6f446aaa9 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -797,6 +797,12 @@ If nil, use the Hoogle web-site." :type '(choice (const :tag "Use Web-site" nil) string)) +(defcustom haskell-hoogle-url "http://haskell.org/hoogle/" + "Default value for hoogle web site. +" + :group 'haskell + :type '(choice (const :tag "haskell-org" "http://haskell.org/hoogle/") (const :tag "fp-complete" "https://www.fpcomplete.com/hoogle") string)) + ;;;###autoload (defun haskell-hoogle (query &optional info) "Do a Hoogle search for QUERY. @@ -814,7 +820,7 @@ is asked to show extra info for the items matching QUERY.." nil nil def) current-prefix-arg))) (if (null haskell-hoogle-command) - (browse-url (format "http://haskell.org/hoogle/?q=%s" query)) + (browse-url (format "%s?q=%s" haskell-hoogle-url query)) (let ((hoogle-args (append (when info '("-i")) (list "--color" (shell-quote-argument query))))) (with-help-window "*hoogle*" From a6c732ad7d7d6a3b0838715058206d3f5061a3af Mon Sep 17 00:00:00 2001 From: Tony Day Date: Sun, 15 Mar 2015 07:17:49 +1000 Subject: [PATCH 2/2] included query element in url, and hexified query --- haskell-mode.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/haskell-mode.el b/haskell-mode.el index 6f446aaa9..181bd89b5 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -797,11 +797,14 @@ If nil, use the Hoogle web-site." :type '(choice (const :tag "Use Web-site" nil) string)) -(defcustom haskell-hoogle-url "http://haskell.org/hoogle/" +(defcustom haskell-hoogle-url "http://haskell.org/hoogle/?q=%s" "Default value for hoogle web site. " :group 'haskell - :type '(choice (const :tag "haskell-org" "http://haskell.org/hoogle/") (const :tag "fp-complete" "https://www.fpcomplete.com/hoogle") string)) + :type '(choice + (const :tag "haskell-org" "http://haskell.org/hoogle/?q=%s") + (const :tag "fp-complete" "https://www.fpcomplete.com/hoogle?q=%s") + string)) ;;;###autoload (defun haskell-hoogle (query &optional info) @@ -820,7 +823,7 @@ is asked to show extra info for the items matching QUERY.." nil nil def) current-prefix-arg))) (if (null haskell-hoogle-command) - (browse-url (format "%s?q=%s" haskell-hoogle-url query)) + (browse-url (format haskell-hoogle-url (url-hexify-string query))) (let ((hoogle-args (append (when info '("-i")) (list "--color" (shell-quote-argument query))))) (with-help-window "*hoogle*"