;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\207" [require cl-lib json url-util haskell-session haskell-customize haskell-string] 2) #@64 Used for delimiting command replies. 4 is End of Transmission. (defconst haskell-process-prompt-regex "" (#$ . 262)) #@48 Used internally for `haskell-process-loadish'. (defvar haskell-reload-p nil (#$ . 386)) #@51 Greetings for when the Haskell process starts up. (defconst haskell-process-greetings (list "Hello, Haskell!" "The lambdas must flow." "Hours of hacking await!" "The next big Haskell project is about to start!" "Your wish is my IO ().") (#$ . 480)) #@33 Haskell logo for notifications. (defconst haskell-process-logo (expand-file-name "logo.svg" haskell-mode-pkg-base-dir) (#$ . 735)) #@74 compiler-macro for inlining `haskell-command-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'haskell-command-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block haskell-command-p (and (memq (type-of cl-x) cl-struct-haskell-command-tags) t)) nil] 9 (#$ . 872)]) (put 'haskell-command-p 'compiler-macro 'haskell-command-p--cmacro) #@13 (fn CL-X) (defalias 'haskell-command-p #[257 "\301!>\205 \302\207" [cl-struct-haskell-command-tags type-of t] 3 (#$ . 1235)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put haskell-command-p side-effect-free error-free put haskell-command cl-deftype-satisfies] 5) #@78 compiler-macro for inlining `haskell-command-state'. (fn CL-WHOLE-ARG CL-X) (defalias 'haskell-command-state--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block haskell-command-state (progn (aref cl-x 1))) nil] 9 (#$ . 1529)]) (put 'haskell-command-state 'compiler-macro 'haskell-command-state--cmacro) #@66 Access slot "state" of `haskell-command' struct CL-X. (fn CL-X) (defalias 'haskell-command-state #[257 "\211\300H\207" [1] 3 (#$ . 1874)]) (byte-code "\300\301\302\303#\300\207" [function-put haskell-command-state side-effect-free t] 4) #@75 compiler-macro for inlining `haskell-command-go'. (fn CL-WHOLE-ARG CL-X) (defalias 'haskell-command-go--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block haskell-command-go (progn (aref cl-x 2))) nil] 9 (#$ . 2118)]) (put 'haskell-command-go 'compiler-macro 'haskell-command-go--cmacro) #@63 Access slot "go" of `haskell-command' struct CL-X. (fn CL-X) (defalias 'haskell-command-go #[257 "\211\300H\207" [2] 3 (#$ . 2448)]) (byte-code "\300\301\302\303#\300\207" [function-put haskell-command-go side-effect-free t] 4) #@77 compiler-macro for inlining `haskell-command-live'. (fn CL-WHOLE-ARG CL-X) (defalias 'haskell-command-live--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block haskell-command-live (progn (aref cl-x 3))) nil] 9 (#$ . 2683)]) (put 'haskell-command-live 'compiler-macro 'haskell-command-live--cmacro) #@65 Access slot "live" of `haskell-command' struct CL-X. (fn CL-X) (defalias 'haskell-command-live #[257 "\211\300H\207" [3] 3 (#$ . 3023)]) (byte-code "\300\301\302\303#\300\207" [function-put haskell-command-live side-effect-free t] 4) #@81 compiler-macro for inlining `haskell-command-complete'. (fn CL-WHOLE-ARG CL-X) (defalias 'haskell-command-complete--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block haskell-command-complete (progn (aref cl-x 4))) nil] 9 (#$ . 3264)]) (put 'haskell-command-complete 'compiler-macro 'haskell-command-complete--cmacro) #@69 Access slot "complete" of `haskell-command' struct CL-X. (fn CL-X) (defalias 'haskell-command-complete #[257 "\211\300H\207" [4] 3 (#$ . 3624)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put haskell-command-complete side-effect-free t defalias copy-haskell-command copy-sequence] 4) #@106 compiler-macro for inlining `make-haskell-command'. (fn CL-WHOLE &cl-quote &key STATE GO LIVE COMPLETE) (defalias 'make-haskell-command--cmacro #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\305\306\307\310 \310    & \207" [plist-member :state :go :live :complete cl--defsubst-expand (state go live complete) (cl-block make-haskell-command (record 'haskell-command state go live complete)) nil] 16 (#$ . 3932)]) (put 'make-haskell-command 'compiler-macro 'make-haskell-command--cmacro) #@86 Constructor for objects of type `haskell-command'. (fn &key STATE GO LIVE COMPLETE) (defalias 'make-haskell-command #[128 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\305\306%\207" [plist-member :state :go :live :complete record haskell-command] 11 (#$ . 4443)]) (byte-code "\300\301\302\303#\304\305\306\307\310\311\312\313\305\303& \207" [function-put make-haskell-command side-effect-free t cl-struct-define haskell-command "Data structure representing a command to be executed when with\n a custom state and three callback." cl-structure-object record nil ((cl-tag-slot) (state) (go) (live) (complete)) cl-struct-haskell-command-tags] 11) #@202 Compute the log and process to start command for the SESSION from the HPTYPE. Do not actually start any process. HPTYPE is the result of calling `'haskell-process-type`' function. (fn SESSION HPTYPE) (defalias 'haskell-process-compute-process-log-and-command #[514 "\306!\307\267\202b\310\311\312\"\313E\314 \310\315!\n\"C\"\"\207\310\311\316 \"\313E\314 \310\315 !\317C\f\320 !\211\2058\211C\262$C\"\"\207\310\311\321 \"\313E\314 \310\315 !\322C\320\n!\211\205Y\211C\262$C\"\"\207\323\324\325#\205k\313\207" [haskell-process-path-ghci haskell-process-wrapper-function haskell-process-args-ghci haskell-process-path-cabal haskell-process-args-cabal-repl haskell-process-path-stack haskell-session-name #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (quote 9 ghci 9 cabal-repl 29 stack-ghci 63)) append format "Starting inferior GHCi process %s ..." nil apply haskell-process-path-to-list "Starting inferior `cabal repl' process using %s ..." "repl" haskell-session-target "Starting inferior stack GHCi process using %s" "ghci" error "cl-ecase failed: %s, %s" (ghci quote cabal-repl quote stack-ghci quote) haskell-process-args-stack-ghci] 13 (#$ . 5108)]) #@72 Convert a path (which may be a string or a list) to a list. (fn PATH) (defalias 'haskell-process-path-to-list #[257 "\211;\203\211C\207\207" [] 2 (#$ . 6327)]) #@46 Make an inferior Haskell process. (fn NAME) (defalias 'haskell-process-make #[257 "\300BC\207" [name] 3 (#$ . 6496)]) #@53 The sentinel for the process pipe. (fn PROC EVENT) (defalias 'haskell-process-sentinel #[514 "\300!\211\205+\301!\302!?\205)\303\304\305\306\"\307\310#!\210\303\304\311\307\312#!\210\313\314\"\262\207" [haskell-process-project-by-proc haskell-session-process haskell-process-restarting haskell-process-log propertize format "Event: %S\n" face ((:weight bold)) "Process reset.\n" font-lock-comment-face run-hook-with-args haskell-process-ended-functions] 9 (#$ . 6622)]) #@54 The filter for the process pipe. (fn PROC RESPONSE) (defalias 'haskell-process-filter #[514 "\300\301\302\"\303:\2032@\262\304\300U\203\305\306\307\310#\202\311\305\307\312#P!\210T\262A\262\202\266\313!\211\205J\314\315!!\205J\316\315!#\207" [0 split-string "\n" nil haskell-process-log propertize "<- " face font-lock-comment-face " " haskell-interactive-face-compile-warning haskell-process-project-by-proc haskell-process-cmd haskell-session-process haskell-process-collect] 11 (#$ . 7108)]) #@65 Effective append MSG to the process log (if enabled). (fn MSG) (defalias 'haskell-process-log #[257 "\205\303\304!r\211q\210\305\301!\210\306\307\310\261*\262\207" [haskell-process-log window-point-insertion-type buffer-read-only get-buffer-create "*haskell-process-log*" make-local-variable t nil "\n"] 4 (#$ . 7637)]) #@37 Find project by process. (fn PROC) (defalias 'haskell-process-project-by-proc #[257 "\301\302\303\"\"\207" [haskell-sessions cl-find-if make-closure #[257 "\301!\302\300!\230\207" [V0 haskell-session-name process-name] 4 "\n\n(fn PROJECT)"]] 5 (#$ . 7972)]) #@88 Collect input for the response until receives a prompt. (fn SESSION RESPONSE PROCESS) (defalias 'haskell-process-collect #[771 "\301\302!P\"\210\303!\204 \304\302!\"\205-\305\306!\307\310\302!#\"\210\311!\210\312!\207" [haskell-process-prompt-regex haskell-process-set-response haskell-process-response haskell-process-live-updates string-match haskell-command-exec-complete haskell-process-cmd replace-regexp-in-string "" haskell-process-reset haskell-process-trigger-queue] 10 (#$ . 8240)]) #@73 Reset the process's state, ready for the next send/reply. (fn PROCESS) (defalias 'haskell-process-reset #[257 "\300\301\"\210\302\303\"\210\304\305\"\207" [haskell-process-set-response-cursor 0 haskell-process-set-response "" haskell-process-set-cmd nil] 4 (#$ . 8754)]) #@93 Consume a regex from the response and move the cursor along if succeed. (fn PROCESS REGEX) (defalias 'haskell-process-consume #[514 "\300\301!\302!#\205\303\304\225\"\210\305\207" [string-match haskell-process-response haskell-process-response-cursor haskell-process-set-response-cursor 0 t] 7 (#$ . 9035)]) #@105 Try to send a string to the process's process. Ask to restart if it's not running. (fn PROCESS STRING) (defalias 'haskell-process-send-string #[514 "\300!\301!\302=\203M\303P\304\305\303\"\306:\203F@\262\211\307\230\204;\310\304U\2032\311\312\313\314#\2023\315\311\313\316#P!\210T\262A\262\202\266\317\"\207\320!?\205X\321\322\"\207" [haskell-process-process process-status run "\n" 0 split-string nil "" haskell-process-log propertize "-> " face font-lock-comment-face " " font-lock-string-face process-send-string haskell-process-restarting run-hook-with-args haskell-process-ended-functions] 13 (#$ . 9357)]) #@37 Process live updates. (fn PROCESS) (defalias 'haskell-process-live-updates #[257 "\300\301!\302!\"\207" [haskell-command-exec-live haskell-process-cmd haskell-process-response] 5 (#$ . 10004)]) #@96 Queue LINE to be sent to PROCESS without bothering to look at the response. (fn PROCESS LINE) (defalias 'haskell-process-queue-without-filters #[514 "\300\301\302B\303\304\211%\"\207" [haskell-process-queue-command record haskell-command #[257 "\300@A\"\207" [haskell-process-send-string] 4 "\n\n(fn STATE)"] nil] 10 (#$ . 10207)]) #@67 Add a command to the process command queue. (fn PROCESS COMMAND) (defalias 'haskell-process-queue-command #[514 "\300\"\210\301!\207" [haskell-process-cmd-queue-add haskell-process-trigger-queue] 5 (#$ . 10551)]) #@95 Trigger the next command in the queue to be ran if there is no current command. (fn PROCESS) (defalias 'haskell-process-trigger-queue #[257 "\300!\203%\301\300!!\203%\302!?\2053\303!\211\205$\304\"\210\305!\207\306!\210\307\310\311#\210\312\313\"\207" [haskell-process-process process-live-p haskell-process-cmd haskell-process-cmd-queue-pop haskell-process-set-cmd haskell-command-exec-go haskell-process-reset haskell-process-set command-queue nil run-hook-with-args haskell-process-ended-functions] 5 (#$ . 10774)]) #@72 Return t if command queue has been completely processed. (fn PROCESS) (defalias 'haskell-process-queue-flushed-p #[257 "\300!\206 \301!?\207" [haskell-process-cmd-queue haskell-process-cmd] 3 (#$ . 11314)]) #@126 Block till PROCESS' command queue has been completely processed. This uses `accept-process-output' internally. (fn PROCESS) (defalias 'haskell-process-queue-flush #[257 "\300!?\205\301!\210\302\303!\304\"\210\202\207" [haskell-process-queue-flushed-p haskell-process-trigger-queue accept-process-output haskell-process-process 1] 4 (#$ . 11532)]) #@89 Queue submitting REQSTR to PROCESS and return response blockingly. (fn PROCESS REQSTR) (defalias 'haskell-process-queue-sync-request #[514 "\300\301\302B\303\304\305\306EE\302\307%\310\"\210\311!\210\211\312H\242\207" [record haskell-command nil lambda (s) haskell-process-send-string (cdr s) setcar haskell-process-queue-command haskell-process-queue-flush 1] 10 (#$ . 11893)]) #@258 Query PROCESS with `:complete repl ...' for INPUTSTR. Give optional LIMIT arg to limit completion candidates count, zero, negative values, and nil means all possible completions. Returns NIL when no completions found. (fn PROCESS INPUTSTR &optional LIMIT) (defalias 'haskell-process-get-repl-completions #[770 "\211\203\211\300V\203\301\302!\301Q\202\301\303\304!Q\305\"\306!\211\307=\203+\310\311!\207\205b\312\313\314#\315\316A\"@\317\320\"\204F\310\321!\210\322\323\"\316\322\324\"!\325!GU\204]\310\326!\210\211B\266\205\207" [0 " " number-to-string ":complete repl" haskell-string-literal-encode haskell-process-queue-sync-request haskell-utils-repl-response-error-status unknown-command error "GHCi lacks `:complete' support (try installing GHC 7.8+ or ghci-ng)" split-string " ?\n" t mapcar haskell-string-literal-decode string-match "\\`\\([0-9]+\\) \\([0-9]+\\) \\(\".*\"\\)\\'" "Invalid `:complete' response" match-string 1 3 string-to-number "Lengths inconsistent in `:complete' response"] 15 (#$ . 12286)]) #@76 Get the PROCESS's KEY value. Returns nil if KEY not set. (fn PROCESS KEY) (defalias 'haskell-process-get #[514 "\211\236A\207" [] 4 (#$ . 13337)]) #@82 Set the PROCESS's KEY to VALUE. Returns newly set VALUE. (fn PROCESS KEY VALUE) (defalias 'haskell-process-set #[771 "\203\236\211\203\211\241\207BAB\241\210\207\300\301\302\"\207" [display-warning haskell-interactive "`haskell-process-set' called with nil process"] 7 (#$ . 13492)]) #@71 We've sent stdin, so let's not clear the output at the end. (fn P V) (defalias 'haskell-process-set-sent-stdin #[514 "\300\301#\207" [haskell-process-set sent-stdin] 6 (#$ . 13796)]) #@65 Did we send any stdin to the process during evaluation? (fn P) (defalias 'haskell-process-sent-stdin-p #[257 "\300\301\"\207" [haskell-process-get sent-stdin] 4 (#$ . 13988)]) #@97 Remember what imports have been suggested, to avoid re-asking about the same imports. (fn P V) (defalias 'haskell-process-set-suggested-imports #[514 "\300\301#\207" [haskell-process-set suggested-imported] 6 (#$ . 14172)]) #@68 Get what modules have already been suggested and accepted. (fn P) (defalias 'haskell-process-suggested-imports #[257 "\300\301\"\207" [haskell-process-get suggested-imported] 4 (#$ . 14405)]) #@50 Set status of evaluating to be on/off. (fn P V) (defalias 'haskell-process-set-evaluating #[514 "\300\301#\207" [haskell-process-set evaluating] 6 (#$ . 14605)]) #@44 Get status of evaluating (on/off). (fn P) (defalias 'haskell-process-evaluating-p #[257 "\300\301\"\207" [haskell-process-get evaluating] 4 (#$ . 14776)]) #@47 Set the process's inferior process. (fn P V) (defalias 'haskell-process-set-process #[514 "\300\301#\207" [haskell-process-set inferior-process] 6 (#$ . 14939)]) #@32 Get the process child. (fn P) (defalias 'haskell-process-process #[257 "\300\301\"\207" [haskell-process-get inferior-process] 4 (#$ . 15110)]) #@31 Get the process name. (fn P) (defalias 'haskell-process-name #[257 "\300\301\"\207" [haskell-process-get name] 4 (#$ . 15262)]) #@78 Get the process's current command. Return nil if no current command. (fn P) (defalias 'haskell-process-cmd #[257 "\300\301\"\207" [haskell-process-get current-command] 4 (#$ . 15398)]) #@46 Set the process's current command. (fn P V) (defalias 'haskell-process-set-cmd #[514 "\300\301\"\210\302\301\"\210\303\301\"\210\304\305#\207" [haskell-process-set-evaluating nil haskell-process-set-sent-stdin haskell-process-set-suggested-imports haskell-process-set current-command] 6 (#$ . 15591)]) #@45 Get the process's current response. (fn P) (defalias 'haskell-process-response #[257 "\300\301\"\207" [haskell-process-get current-response] 4 (#$ . 15905)]) #@44 Get the process's current session. (fn P) (defalias 'haskell-process-session #[257 "\300\301\"\207" [haskell-process-get session] 4 (#$ . 16071)]) #@47 Set the process's current response. (fn P V) (defalias 'haskell-process-set-response #[514 "\300\301#\207" [haskell-process-set current-response] 6 (#$ . 16226)]) #@46 Set the process's current session. (fn P V) (defalias 'haskell-process-set-session #[514 "\300\301#\207" [haskell-process-set session] 6 (#$ . 16398)]) #@52 Get the process's current response cursor. (fn P) (defalias 'haskell-process-response-cursor #[257 "\300\301\"\207" [haskell-process-get current-response-cursor] 4 (#$ . 16559)]) #@46 Set the process's response cursor. (fn P V) (defalias 'haskell-process-set-response-cursor #[514 "\300\301#\207" [haskell-process-set current-response-cursor] 6 (#$ . 16746)]) #@42 Is the PROCESS restarting? (fn PROCESS) (defalias 'haskell-process-restarting #[257 "\300\301\"\207" [haskell-process-get is-restarting] 4 (#$ . 16931)]) #@194 Get the PROCESS' command queue. New entries get added to the end of the list. Use `haskell-process-cmd-queue-add' and `haskell-process-cmd-queue-pop' to modify the command queue. (fn PROCESS) (defalias 'haskell-process-cmd-queue #[257 "\300\301\"\207" [haskell-process-get command-queue] 4 (#$ . 17094)]) #@62 Add CMD to end of PROCESS's command queue. (fn PROCESS CMD) (defalias 'haskell-process-cmd-queue-add #[514 "\300\301\302\303!C\"#\207" [haskell-process-set command-queue append haskell-process-cmd-queue] 8 (#$ . 17407)]) #@94 Pop the PROCESS' next entry from command queue. Returns nil if queue is empty. (fn PROCESS) (defalias 'haskell-process-cmd-queue-pop #[257 "\300!\211\205\301\302A#\210\211@\207" [haskell-process-cmd-queue haskell-process-set command-queue] 6 (#$ . 17639)]) #@376 Note to Windows Emacs hackers: chmod is how to change the mode of files in POSIX systems. This will not work on your operating system. There is a command a bit like chmod called "Calcs" that you can try using here: http://technet.microsoft.com/en-us/library/bb490872.aspx If it works, you can submit a patch to this function and remove this comment. (fn SESSION FILE) (defalias 'haskell-process-unignore-file #[514 "\300\301\302\303P\"!\210\304\305\306\307\"#\207" [shell-command read-from-minibuffer "Permissions command: " "chmod 700 " haskell-session-modify ignored-files make-closure #[257 "\301\302\303\300\"\"\207" [V0 cl-remove-if make-closure #[257 "\211\300\230\207" [V0] 3 "\n\n(fn PATH)"]] 5 "\n\n(fn FILES)"]] 8 (#$ . 17909)]) #@47 Call the command's go function. (fn COMMAND) (defalias 'haskell-command-exec-go #[257 "\211\300H\211\205\f\211\301H!\207" [2 1] 5 (#$ . 18665)]) #@62 Call the command's complete function. (fn COMMAND RESPONSE) (defalias 'haskell-command-exec-complete #[514 "\300H\211\205#\3011\3021\211\303H\"00\2070\304\305!\207\304\306\"\262\207" [4 (debug error) (debug quit) 1 message "Quit" "Haskell process command errored with: %S"] 7 (#$ . 18819)]) #@69 Trigger the command's live updates callback. (fn COMMAND RESPONSE) (defalias 'haskell-command-exec-live #[514 "\300H\211\205 \211\301H\"\207" [3 1] 6 (#$ . 19127)]) (provide 'haskell-process)