From c2da055da3ee679e38d51b9945a4801145dc06f4 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Wed, 25 Feb 2015 18:00:03 +0100 Subject: [PATCH 1/2] Remove all mentions of cabal-dev. --- haskell-customize.el | 8 +------- haskell-load.el | 6 ++---- haskell-modules.el | 5 ----- haskell-package.el | 17 ----------------- haskell-process.el | 10 +--------- 5 files changed, 4 insertions(+), 42 deletions(-) diff --git a/haskell-customize.el b/haskell-customize.el index ef334cfd5..e7aff9c99 100644 --- a/haskell-customize.el +++ b/haskell-customize.el @@ -44,7 +44,7 @@ Used for locating additional package data files.") (defcustom haskell-process-type 'auto "The inferior Haskell process type to use." - :type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-dev) (const cabal-ghci)) + :type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-ghci)) :group 'haskell-interactive) (defcustom haskell-process-wrapper-function @@ -103,12 +103,6 @@ a per-project basis." :group 'haskell-interactive :type '(choice string (repeat string))) -(defcustom haskell-process-path-cabal-dev - "cabal-dev" - "The path for starting cabal-dev." - :group 'haskell-interactive - :type '(choice string (repeat string))) - (defcustom haskell-process-args-ghci '("-ferror-spans") "Any arguments for starting ghci." diff --git a/haskell-load.el b/haskell-load.el index 0c3cc2b66..3deb5832d 100644 --- a/haskell-load.el +++ b/haskell-load.el @@ -204,8 +204,7 @@ actual Emacs buffer of the module being loaded." (cl-ecase (haskell-process-type) ('ghci haskell-process-path-cabal) ('cabal-repl haskell-process-path-cabal) - ('cabal-ghci haskell-process-path-cabal) - ('cabal-dev haskell-process-path-cabal-dev)) + ('cabal-ghci haskell-process-path-cabal)) (cl-caddr state))))) :live @@ -247,8 +246,7 @@ actual Emacs buffer of the module being loaded." :app-name (cl-ecase (haskell-process-type) ('ghci haskell-process-path-cabal) ('cabal-repl haskell-process-path-cabal) - ('cabal-ghci haskell-process-path-cabal) - ('cabal-dev haskell-process-path-cabal-dev)) + ('cabal-ghci haskell-process-path-cabal)) :app-icon haskell-process-logo))))))))) (defun haskell-process-echo-load-message (process buffer echo-in-repl th) diff --git a/haskell-modules.el b/haskell-modules.el index 0f1dd1055..6a5aa3829 100644 --- a/haskell-modules.el +++ b/haskell-modules.el @@ -71,11 +71,6 @@ If DONTCREATE is non-nil don't create a new session." (let ((modules (shell-command-to-string (format "%s | %s | %s" (cond - ((eq 'cabal-dev (haskell-process-type)) - (if (or (not dontcreate) session) - (format "cabal-dev -s %s/cabal-dev ghc-pkg dump" - (haskell-session-cabal-dir session)) - "echo ''")) ((haskell-sandbox-exists-p session) (concat "ghc-pkg dump -f " (shell-quote-argument (haskell-sandbox-pkgdb session)))) diff --git a/haskell-package.el b/haskell-package.el index 65b403dc3..a7a36265b 100644 --- a/haskell-package.el +++ b/haskell-package.el @@ -29,23 +29,6 @@ (require 'cl-lib) -;; Dynamically scoped variables. -;; TODO What actually sets this? -(defvar haskell-config-use-cabal-dev) - -;; (defun haskell-package-conf-path-get (&optional project) -;; "Gets the user conf or the cabal-dev conf. Get the global conf elsewhere." -;; (if haskell-config-use-cabal-dev -;; (if project -;; (let* ((cabal-path (haskell-project-cabal-dir project))) -;; (format "%scabal-dev/packages-%s.conf/" -;; (if (string-match "/$" cabal-path) -;; cabal-path -;; (concat cabal-path "/")) -;; (haskell-ghc-version))) -;; (haskell-package-conf-user-path-get)) -;; (haskell-package-conf-user-path-get))) - (defun haskell-package-conf-user-path-get () "Get the user conf path." (let ((out (shell-command-to-string "ghc-pkg --user list no-results-please"))) diff --git a/haskell-process.el b/haskell-process.el index ecf890082..a4471ee06 100644 --- a/haskell-process.el +++ b/haskell-process.el @@ -102,15 +102,7 @@ HPTYPE is the result of calling `'haskell-process-type`' function." session-name nil) (apply haskell-process-wrapper-function - (list (list haskell-process-path-cabal-ghci))))) - ('cabal-dev - (let ((dir (concat (haskell-session-cabal-dir session) "/cabal-dev"))) - (append (list (format "Starting inferior cabal-dev process %s -s %s ..." - haskell-process-path-cabal-dev dir) - session-name - nil) - (apply haskell-process-wrapper-function - (list (cons haskell-process-path-cabal-dev (list "ghci" "-s" dir)))))))))) + (list (list haskell-process-path-cabal-ghci)))))))) (defun haskell-process-make (name) "Make an inferior Haskell process." From 20f8c7cf161856bb8219b6b46682549b00b1dae4 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Fri, 13 Mar 2015 13:55:46 +0100 Subject: [PATCH 2/2] Remove cabal-dev and cabal-ghci from tests. --- tests/haskell-process-tests.el | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/tests/haskell-process-tests.el b/tests/haskell-process-tests.el index 1eaf69174..1c18b039a 100644 --- a/tests/haskell-process-tests.el +++ b/tests/haskell-process-tests.el @@ -61,38 +61,5 @@ ((haskell-session-target "dummy-session2") => "dumdum-session")) (haskell-process-compute-process-log-and-command "dummy-session2" 'cabal-repl)))))) -(ert-deftest test-haskell-process--compute-process-log-and-command-cabal-ghci () - (should (equal '("Starting inferior cabal-ghci process using cabal-ghci ..." "dumses3" nil "cabal-ghci") - (let ((haskell-process-path-ghci "ghci")) - (custom-set-variables '(haskell-process-wrapper-function #'identity)) - (mocklet (((haskell-session-name "dummy-session3") => "dumses3")) - (haskell-process-compute-process-log-and-command "dummy-session3" 'cabal-ghci)))))) - -(ert-deftest test-haskell-process--with-wrapper-compute-process-log-and-command-cabal-ghci () - (should (equal '("Starting inferior cabal-ghci process using cabal-ghci ..." "dumses3" nil "nix-shell" "default.nix" "--command" "cabal-ghci") - (let ((haskell-process-path-ghci "ghci")) - (custom-set-variables '(haskell-process-wrapper-function - (lambda (argv) (append (list "nix-shell" "default.nix" "--command" ) - (list (shell-quote-argument (mapconcat 'identity argv " "))))))) - (mocklet (((haskell-session-name "dummy-session3") => "dumses3")) - (haskell-process-compute-process-log-and-command "dummy-session3" 'cabal-ghci)))))) - -(ert-deftest test-haskell-process--compute-process-log-and-command-cabal-dev () - (should (equal '("Starting inferior cabal-dev process cabal-dev -s directory/cabal-dev ..." "dumses4" nil "cabal-dev" "ghci" "-s" "directory/cabal-dev") - (let ((haskell-process-path-cabal-dev "cabal-dev")) - (custom-set-variables '(haskell-process-wrapper-function #'identity)) - (mocklet (((haskell-session-name "dummy-session4") => "dumses4") - ((haskell-session-cabal-dir "dummy-session4") => "directory")) - (haskell-process-compute-process-log-and-command "dummy-session4" 'cabal-dev)))))) - -(ert-deftest test-haskell-process--with-wrapper-compute-process-log-and-command-cabal-dev () - (should (equal '("Starting inferior cabal-dev process cabal-dev -s directory/cabal-dev ..." "dumses4" nil "run-with-docker" "cabal-dev\\ ghci\\ -s\\ directory/cabal-dev") - (let ((haskell-process-path-cabal-dev "cabal-dev")) - (custom-set-variables '(haskell-process-wrapper-function - (lambda (argv) (append (list "run-with-docker") - (list (shell-quote-argument (mapconcat 'identity argv " "))))))) - (mocklet (((haskell-session-name "dummy-session4") => "dumses4") - ((haskell-session-cabal-dir "dummy-session4") => "directory")) - (haskell-process-compute-process-log-and-command "dummy-session4" 'cabal-dev)))))) ;;; haskell-process-tests.el ends here