Skip to content

Move haskell-interactive-prompt-state related definitions to haskell-utils.el #1226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion haskell-cabal.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

(require 'cl-lib)
(require 'haskell-utils)
(require 'haskell-mode)

(defconst haskell-cabal-general-fields
;; Extracted with (haskell-cabal-extract-fields-from-doc "general-fields")
Expand Down
1 change: 1 addition & 0 deletions haskell-debug.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
(require 'haskell-process)
(require 'haskell-interactive-mode)
(require 'haskell-font-lock)
(require 'haskell-utils)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Configuration
Expand Down
1 change: 1 addition & 0 deletions haskell-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
(require 'haskell-mode)
(require 'haskell-process)
(require 'haskell)
(require 'haskell-utils)
(require 'inf-haskell)
(require 'imenu)
(require 'eldoc)
Expand Down
1 change: 1 addition & 0 deletions haskell-hoogle.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

(require 'ansi-color)
(require 'haskell-mode)
(require 'haskell-utils)


(defcustom haskell-hoogle-command
Expand Down
1 change: 1 addition & 0 deletions haskell-interactive-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
(require 'haskell-session)
(require 'haskell-font-lock)
(require 'haskell-presentation-mode)
(require 'haskell-utils)

(require 'ansi-color)
(require 'cl-lib)
Expand Down
1 change: 1 addition & 0 deletions haskell-load.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
(require 'haskell-modules)
(require 'haskell-commands)
(require 'haskell-session)
(require 'haskell-utils)

(defun haskell-process-look-config-changes (session)
"Check whether a cabal configuration file has changed.
Expand Down
10 changes: 0 additions & 10 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,6 @@ May return a qualified name."

(defvar eldoc-print-current-symbol-info-function)

(defvar haskell-mode-interactive-prompt-state nil
"Special variable indicating a state of user input waiting.")


;; The main mode functions
;;;###autoload
(define-derived-mode haskell-mode prog-mode "Haskell"
Expand Down Expand Up @@ -1073,12 +1069,6 @@ successful, nil otherwise."
(goto-char (point-min))
(end-of-line)))

(defun haskell-mode-toggle-interactive-prompt-state (&optional disabled)
"Set `haskell-mode-interactive-prompt-state' to t.
If given DISABLED argument sets variable value to nil, otherwise to t."
(setq haskell-mode-interactive-prompt-state (not disabled)))


;; Provide ourselves:

(provide 'haskell-mode)
Expand Down
20 changes: 15 additions & 5 deletions haskell-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@

;;; Code:

;; NOTE: This module is supposed to be a leaf-module and shall not
;; require/depend-on any other haskell-mode modules in order to
;; stay at the bottom of the module dependency graph.
;; =============================================================================
;; NOTE:
;; THIS MODULE IS SUPPOSED TO BE A LEAF-MODULE AND SHALL NOT REQUIRE/DEPEND-ON
;; ANY OTHER HASKELL-MODE MODULES IN ORDER TO STAY AT THE BOTTOM OF THE MODULE
;; DEPENDENCY GRAPH.
;; =============================================================================

(eval-when-compile (require 'cl-lib))

(require 'haskell-customize)

(defvar haskell-utils-async-post-command-flag nil
"Non-nil means some commands were triggered during async function execution.")
(make-variable-buffer-local 'haskell-utils-async-post-command-flag)

(defvar haskell-mode-interactive-prompt-state nil
"Special variable indicating a state of user input waiting.")

(defun haskell-utils-read-directory-name (prompt default)
"Read directory name and normalize to true absolute path.
Refer to `read-directory-name' for the meaning of PROMPT and
Expand Down Expand Up @@ -180,5 +184,11 @@ expression bounds."
end-c
value)))))


(defun haskell-mode-toggle-interactive-prompt-state (&optional disabled)
"Set `haskell-mode-interactive-prompt-state' to t.
If given DISABLED argument sets variable value to nil, otherwise to t."
(setq haskell-mode-interactive-prompt-state (not disabled)))

(provide 'haskell-utils)
;;; haskell-utils.el ends here
1 change: 1 addition & 0 deletions tests/haskell-doc-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
(require 'haskell-mode)
(require 'haskell-doc)
(require 'haskell-test-utils)
(require 'haskell-utils)


(ert-deftest interactive-prompt-state ()
Expand Down