;ELC
;;; Compiled by haakon@haakon-laptop on Thu Aug 22 10:20:07 2013
;;; from file /home/haakon/.emacs.d/elpa/haskell-mode-13.7/haskell-session.el
;;; in Emacs version 24.2.1
;;; with all optimizations.

;;; This file contains utf-8 non-ASCII characters,
;;; and so cannot be loaded into Emacs 22 or earlier.
(and (boundp 'emacs-version)
     (< (aref emacs-version (1- (length emacs-version))) ?A)
     (string-lessp emacs-version "23")
     (error "`%s' was compiled for Emacs 23 or later" load-file-name))

;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\300\303!\207" [require haskell-cabal haskell-string cl] 2)
#@44 All Haskell sessions in the Emacs session.
(defvar haskell-sessions nil (#$ . 638))
#@37 Get the filename for the TAGS file.
(defalias 'haskell-session-tags-filename #[(session) "\301!\302P\207" [session haskell-session-cabal-dir "/TAGS"] 2 (#$ . 728)])
#@110 Get all modules -- installed or in the current project.
If DONTCREATE is non-nil don't create a new session.
(defalias 'haskell-session-all-modules #[(&optional dontcreate) "\301\302!\303!\"\207" [dontcreate append haskell-session-installed-modules haskell-session-project-modules] 4 (#$ . 901)])
#@108 Get the modules installed in the current package set.
If DONTCREATE is non-nil don't create a new session.
(defalias 'haskell-session-installed-modules #[(&optional dontcreate) "\303\304!\210\305\306\307\310=\203$	\203\311 \203 \306\312\313\314 !\"\202%\315\202%\316\317\320$!\321\n!)\207" [haskell-process-type dontcreate modules require haskell-process shell-command-to-string format "%s | %s | %s" cabal-dev haskell-session-maybe "cabal-dev -s %s/cabal-dev ghc-pkg dump" haskell-session-cabal-dir haskell-session "echo ''" "ghc-pkg dump" "egrep '^(exposed-modules: |                 )[A-Z]'" "cut -c18-" split-string] 7 (#$ . 1207)])
#@94 Get the modules of the current project.
If DONTCREATE is non-nil don't create a new session.
(defalias 'haskell-session-project-modules #[(&optional dontcreate) "\203	\303 \205\304 \305\306\307\306\310\311	!\"\312#!\313\n!*\207" [dontcreate session modules haskell-session-maybe haskell-session shell-command-to-string format "%s && %s" "cd %s" haskell-session-cabal-dir "egrep '^module[	
 ]+[^(	
 ]+' . -r -I --include='*.*hs' --include='*.hsc' -s -o -h | sed 's/^module[	
 ]*//' | sort | uniq" split-string] 7 (#$ . 1858)])
#@277 Kill the session process and buffer, delete the session.
0. Prompt to kill all associated buffers.
1. Kill the process.
2. Kill the interactive buffer.
3. Walk through all the related buffers and set their haskell-session to nil.
4. Remove the session from the sessions list.
(defalias 'haskell-session-kill #[(&optional leave-interactive-buffer) "\306 \307!\310\311\312	\"!\313!\210\204\314\315!!\210\316 \317\f:\203N\f@r
q\210\320\306!\203F\307!	\230\203F\317\n\203F\314 \210)\fA\211\202\"*\321\322\"\211+\207" [session name also-kill-buffers leave-interactive-buffer #1=#:--cl-var-- buffer haskell-session haskell-session-name y-or-n-p format "Killing `%s'. Also kill all associated buffers?" haskell-kill-session-process kill-buffer haskell-session-interactive-buffer buffer-list nil boundp remove-if #[(session) "\302!	\230\207" [session name haskell-session-name] 2] haskell-sessions] 5 (#$ . 2397) nil])
#@63 Maybe get the Haskell session, return nil if there isn't one.
(defalias 'haskell-session-maybe #[nil "\301\300!\203\207\302\211\207" [haskell-session default-boundp nil] 2 (#$ . 3341)])
#@61 Get the Haskell session, prompt if there isn't one or fail.
(defalias 'haskell-session #[nil "\300 \206\301\302 \206\303 \206\304 \206\305 !\207" [haskell-session-maybe haskell-session-assign haskell-session-from-buffer haskell-session-new-assume-from-cabal haskell-session-choose haskell-session-new] 2 (#$ . 3537)])
#@78 Prompt to create a new project based on a guess from the nearest Cabal file.
(defalias 'haskell-session-new-assume-from-cabal #[nil "\300\301\302\303 \"!\205\304\303 !\207" [y-or-n-p format "Start a new project named â€œ%sâ€�? " haskell-session-default-name haskell-session-make] 4 (#$ . 3869)])
#@38 Get the session based on the buffer.
(defalias 'haskell-session-from-buffer #[nil "\301 \205:\205\302\303\304\305$\207" [haskell-sessions buffer-file-name reduce #[(acc a) "\302\303!\304\305 !\"\203\"	\203 \303!G\303	!GV\203\207	\207\207	\207" [a acc haskell-is-prefix-of haskell-session-cabal-dir file-name-directory buffer-file-name] 4] :initial-value nil] 5 (#$ . 4173)])
#@21 Make a new session.
(defalias 'haskell-session-new #[nil "\301\302\303 \"\211\304\230?\205\305!)\207" [name read-from-minibuffer "Project name: " haskell-session-default-name "" haskell-session-make] 4 (#$ . 4568)])
#@61 Generate a default project name for the new project prompt.
(defalias 'haskell-session-default-name #[nil "\301 \211\203\302\303!!\227\206\304)\207" [file haskell-cabal-find-file file-name-sans-extension file-name-nondirectory "haskell"] 4 (#$ . 4794)])
#@26 Set the current session.
(defalias 'haskell-session-assign #[(session) "\302\301!\210\211\207" [session haskell-session make-local-variable] 2 (#$ . 5060)])
#@65 Find a session by choosing from a list of the current sessions.
(defalias 'haskell-session-choose #[nil "\205\302\303\304\305\"\"\306\307\")\207" [haskell-sessions session-name ido-completing-read "Choose Haskell session: " mapcar haskell-session-name find-if #[(session) "\302!	\230\207" [session session-name haskell-session-name] 2]] 6 (#$ . 5225)])
#@49 Clear the buffer of any Haskell session choice.
(defalias 'haskell-session-clear #[nil "\301\300!\210\302\211\207" [haskell-session make-local-variable nil] 2 (#$ . 5591)])
#@44 Change the session for the current buffer.
(defalias 'haskell-session-change #[nil "\300 \210\301\302 \206\303 \206\304 !\207" [haskell-session-clear haskell-session-assign haskell-session-new-assume-from-cabal haskell-session-choose haskell-session-new] 2 (#$ . 5771) nil])
#@40 Strip the load dir from the file path.
(defalias 'haskell-session-strip-dir #[(session file) "\303!\nG	GV\203&\n\304	GO	\230\203\"\305\306\307\n	G\310O#\202'\n\202'\n)\207" [session cur-dir file haskell-session-current-dir 0 replace-regexp-in-string "^[/\\]" "" nil] 6 (#$ . 6056)])
#@25 Make a Haskell session.
(defalias 'haskell-session-make #[(name) "\303\301!\210\300BC\211\304\305\n\"\210\306\n!\210\n)\207" [name haskell-session session make-local-variable add-to-list haskell-sessions haskell-process-start] 3 (#$ . 6351)])
#@23 Get the session name.
(defalias 'haskell-session-name #[(s) "\301\302\"\207" [s haskell-session-get name] 3 (#$ . 6603)])
#@37 Get the session interactive buffer.
(defalias 'haskell-session-interactive-buffer #[(s) "\302\303\"\211\203\304	!\203	\2023\305\306\307\310!\"!\311	\"\210r	q\210\312 \210\313!\210)\314	!\210	))\207" [s buffer haskell-session-get interactive-buffer buffer-live-p get-buffer-create format "*%s*" haskell-session-name haskell-session-set-interactive-buffer haskell-interactive-mode haskell-session-assign switch-to-buffer-other-window] 6 (#$ . 6732)])
#@37 Set the session interactive buffer.
(defalias 'haskell-session-set-interactive-buffer #[(s v) "\302\303	#\207" [s v haskell-session-set interactive-buffer] 4 (#$ . 7198)])
#@26 Set the session process.
(defalias 'haskell-session-set-process #[(s v) "\302\303	#\207" [s v haskell-session-set process] 4 (#$ . 7377)])
#@26 Get the session process.
(defalias 'haskell-session-process #[(s) "\301\302\"\207" [s haskell-session-get process] 3 (#$ . 7523)])
#@28 Set the session cabal-dir.
(defalias 'haskell-session-set-cabal-dir #[(s v) "\303!\304\n\305	#\210\306\n	\")\207" [v true-path s file-truename haskell-session-set cabal-dir haskell-session-set-cabal-checksum] 4 (#$ . 7661)])
#@36 Set the session current directory.
(defalias 'haskell-session-set-current-dir #[(s v) "\303!\304\n\305	#)\207" [v true-path s file-truename haskell-session-set current-dir] 4 (#$ . 7894)])
#@42 Set the session checksum of .cabal files
(defalias 'haskell-session-set-cabal-checksum #[(s cabal-dir) "\302\303\304	!#\207" [s cabal-dir haskell-session-set cabal-checksum haskell-cabal-compute-checksum] 5 (#$ . 8091)])
#@36 Get the session current directory.
(defalias 'haskell-session-current-dir #[(s) "\302\303\"\211\206\f\304\305!)\207" [s dir haskell-session-get current-dir haskell-process-cd t] 4 (#$ . 8319)])
#@28 Get the session cabal-dir.
(defalias 'haskell-session-cabal-dir #[(s) "\303\304\"\211\203
	\202!\305 \211\203\306\n\"\210\n\202 \307!))\207" [s dir set-dir haskell-session-get cabal-dir haskell-cabal-get-dir haskell-session-set-cabal-dir haskell-session-cabal-dir] 4 (#$ . 8522)])
#@58 Get the SESSION's KEY value.
Returns nil if KEY not set.
(defalias 'haskell-session-get #[(session key) "	\236A\207" [key session] 2 (#$ . 8819)])
#@58 Set the SESSION's KEY to VALUE.
Returns newly set VALUE.
(defalias 'haskell-session-set #[(session key value) "	\236\211\203\n\241\202	B	AB\241\210)\207" [key session cell value] 4 (#$ . 8973)])
(provide 'haskell-session)
