;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!\210\300\307!\210\300\310!\210\300\311!\210\300\312!\210\300\313!\207" [require haskell-mode haskell-compile haskell-process haskell-session haskell-font-lock haskell-presentation-mode haskell-utils haskell-string ansi-color cl-lib etags] 2) (defvar haskell-interactive-mode-history-index 0 nil) (make-variable-buffer-local 'haskell-interactive-mode-history-index) (defvar haskell-interactive-mode-history nil nil) (make-variable-buffer-local 'haskell-interactive-mode-history) #@48 Mark used for the old beginning of the prompt. (defvar haskell-interactive-mode-old-prompt-start nil (#$ . 651)) (make-variable-buffer-local 'haskell-interactive-mode-old-prompt-start) #@181 Generate a regex for searching for any occurrence of the promptat the beginning of the line. This should prevent any interference with prompts that look like haskell expressions. (defalias 'haskell-interactive-prompt-regex #[0 "\301\302!P\207" [haskell-interactive-prompt "^" regexp-quote] 3 (#$ . 843)]) #@44 Keymap used in `haskell-interactive-mode'. (defvar haskell-interactive-mode-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\301\314\315#\210\301\316\317#\210\301\320\321#\210\301\322\323#\210\301\324\325#\210\301\326\327#\210\301\330\331#\210\301\332\333#\210\301\334\325#\210\301\335\327#\210\301\336\337#\210\301\340\341#\210\207" [make-sparse-keymap define-key " " haskell-interactive-mode-return " " haskell-interactive-mode-space "\n" haskell-interactive-mode-newline-indent [remap move-beginning-of-line] haskell-interactive-mode-bol [home] haskell-interactive-mode-beginning " " haskell-interactive-mode-clear "" haskell-process-interrupt "" next-error-follow-minor-mode "" haskell-interactive-switch-back [134217840] haskell-interactive-mode-history-previous [134217838] haskell-interactive-mode-history-next "" haskell-interactive-mode-prompt-previous "" haskell-interactive-mode-prompt-next [C-up] [C-down] " " haskell-interactive-mode-tab [C-S-backspace] haskell-interactive-mode-kill-whole-line] 5) (#$ . 1156)) (defvar haskell-interactive-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [haskell-interactive-mode-hook variable-documentation put "Hook run after entering Interactive-Haskell mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp haskell-interactive-mode-map definition-name haskell-interactive-mode] 4) (defvar haskell-interactive-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\300!\204#\303\300\307\310#\210\311\312\300\313\"\210!\210\300\302N\2041\303\300\302\304\314!#\210\303\310\315\313#\210\303\310\316\317#\207" [haskell-interactive-mode-abbrev-table haskell-interactive-mode-map variable-documentation put purecopy "Keymap for `haskell-interactive-mode'." boundp definition-name haskell-interactive-mode (lambda (#1=#:def-tmp-var) (defvar haskell-interactive-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `haskell-interactive-mode'." derived-mode-parent custom-mode-group haskell-interactive] 5) #@192 Interactive mode for Haskell. Key bindings: \{haskell-interactive-mode-map} This mode runs the hook `haskell-interactive-mode-hook', as the final or penultimate step during initialization. (defalias 'haskell-interactive-mode #[0 "\306\300!\210\307\310 \210\311\312\313 !\210\314\f!\210 \315\316\317\320\321\322\315\307$\210\320\323\324\315\307$\210\325 \210)\326\327!\207" [delay-mode-hooks major-mode mode-name haskell-interactive-mode-map haskell-mode-syntax-table haskell-interactive-mode-abbrev-table make-local-variable t kill-all-local-variables haskell-interactive-mode "Interactive-Haskell" use-local-map set-syntax-table nil 0 haskell-interactive-next-error-function add-hook completion-at-point-functions haskell-interactive-mode-completion-at-point-function kill-buffer-hook haskell-interactive-kill haskell-interactive-mode-prompt run-mode-hooks haskell-interactive-mode-hook local-abbrev-table haskell-interactive-mode-history haskell-interactive-mode-history-index next-error-function] 5 (#$ . 3396) nil]) #@44 Mark used for the beginning of the prompt. (defvar haskell-interactive-mode-prompt-start nil (#$ . 4435)) #@112 Mark used to figure out where the end of the current result output is. Used to distinguish between user input. (defvar haskell-interactive-mode-result-end nil (#$ . 4548)) #@150 Records the buffer to which `haskell-interactive-switch-back' should jump. This is set by `haskell-interactive-switch', and should otherwise be nil. (defvar haskell-interactive-previous-buffer nil (#$ . 4727)) (byte-code "\300\301!\210\302\303\304\305\306\307%\210\302\310\311\312\306\307%\210\313\314\315\310#\210\313\314\316\317\320!\206$\321#\210\302\322\323\324\306\307%\210\302\325\326\327\306\307%\210\302\330\331\332\306\307%\210\302\333\334\335\306\307%\207" [make-variable-buffer-local haskell-interactive-previous-buffer custom-declare-face haskell-interactive-face-prompt ((t :inherit font-lock-function-name-face)) "Face for the prompt." :group haskell-interactive haskell-interactive-face-prompt-cont ((t :inherit font-lock-keyword-face)) "Face for GHCi's prompt-cont in multi-line mode." put haskell-interactive-face-prompt2 face-alias obsolete-face purecopy "16.2" t haskell-interactive-face-compile-error ((t :inherit compilation-error)) "Face for compile errors." haskell-interactive-face-compile-warning ((t :inherit compilation-warning)) "Face for compiler warnings." haskell-interactive-face-result ((t :inherit font-lock-string-face)) "Face for the result." haskell-interactive-face-garbage ((t :inherit font-lock-string-face)) "Face for trailing garbage after a command has completed."] 6) #@26 Make newline and indent. (defalias 'haskell-interactive-mode-newline-indent #[0 "\301 \210Gj\210\302 \207" [haskell-interactive-prompt newline indent-relative] 1 (#$ . 6046) nil]) #@27 Kill the whole REPL line. (defalias 'haskell-interactive-mode-kill-whole-line #[0 "\301\302 \"\207" [haskell-interactive-mode-prompt-start kill-region line-end-position] 3 (#$ . 6233) nil]) #@75 Switch back to the buffer from which this interactive buffer was reached. (defalias 'haskell-interactive-switch-back #[0 "\203\301!\207\302\303!\207" [haskell-interactive-previous-buffer switch-to-buffer-other-window message "No previous buffer."] 2 (#$ . 6430) nil]) #@70 Copy the current line to the prompt, overwriting the current prompt. (defalias 'haskell-interactive-copy-to-prompt #[0 "\301\302 \303 \"\211GGY\203\211\304GO\230\203\211G\305O\262\306!\207" [haskell-interactive-prompt buffer-substring-no-properties line-beginning-position line-end-position 0 nil haskell-interactive-mode-set-prompt] 4 (#$ . 6708) nil]) #@31 Handle the space key. (fn N) (defalias 'haskell-interactive-mode-space #[257 "\301\300!\203\203\302\303!\203\304\303!\207\305 \203\306\307!\207\310!\207" [god-local-mode boundp fboundp god-mode-self-insert call-interactively haskell-interactive-at-compile-message next-error-no-select 0 self-insert-command] 3 (#$ . 7078) "p"]) #@182 If at prompt, return start position of user-input, otherwise return nil. If END-LINE is non-nil, then return non-nil when the end of line is at the prompt. (fn &optional END-LINE) (defalias 'haskell-interactive-at-prompt #[256 "\211\203 \301 \202\n`Y\205\207" [haskell-interactive-mode-prompt-start line-end-position] 3 (#$ . 7424)]) #@67 Go to beginning of current line, but after current prompt if any. (defalias 'haskell-interactive-mode-bol #[0 "\301 \302 \211Y\203Y\203\202b\207" [haskell-interactive-mode-prompt-start line-beginning-position line-end-position] 4 (#$ . 7771) nil]) (defvar haskell-error-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [haskell-error-mode-hook variable-documentation put "Hook run after entering Error mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp haskell-error-mode-map definition-name haskell-error-mode] 4) (defvar haskell-error-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [haskell-error-mode-abbrev-table haskell-error-mode-map variable-documentation put purecopy "Keymap for `haskell-error-mode'." boundp haskell-error-mode-syntax-table definition-name haskell-error-mode (lambda (#1=#:def-tmp-var) (defvar haskell-error-mode-syntax-table #1#)) make-syntax-table "Syntax table for `haskell-error-mode'." (lambda (#1#) (defvar haskell-error-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `haskell-error-mode'." derived-mode-parent special-mode] 5) #@255 Major mode for viewing Haskell compile errors. In addition to any hooks its parent mode `special-mode' might have run, this mode runs the hook `haskell-error-mode-hook', as the final or penultimate step during initialization. \{haskell-error-mode-map} (defalias 'haskell-error-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R =\204R\326 \325C#\210\327 !\210\330\f!\210 )\331\332!\207" [delay-mode-hooks major-mode mode-name haskell-error-mode-map haskell-error-mode-syntax-table haskell-error-mode-abbrev-table make-local-variable t special-mode haskell-error-mode "Error" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table run-mode-hooks haskell-error-mode-hook local-abbrev-table] 5 (#$ . 9275) nil]) #@22 Handle ^H in output. (defalias 'haskell-interactive-mode-handle-h #[0 "e\301\212\302\303\301\304$\2054\212\305u\210`\306\307\301\304$\203!\305u\210\202$eb\210``ZZe]|\266)\202*\207" [inhibit-read-only t search-backward "" 1 nil search-backward-regexp "[^]"] 7 (#$ . 10295)]) #@123 If a multi-line expression EXPR has been entered, then reformat it to be: :{ do the multi-liner expr :} (fn EXPR) (defalias 'haskell-interactive-mode-multi-line #[257 "\303\304\305\306#)\266\203\204\207\307\310\311 !\"\312\303\"\211A\211:\2032\211\313\314@#\240\210\211A\262\202\210\315\316\317\303#\320\307\321\n\"R\207" [inhibit-changing-match-data haskell-interactive-prompt haskell-interactive-prompt-cont "\n" nil t string-match format "^%s" regexp-quote split-string replace-regexp-in-string "" ":set prompt-cont \"\"\n:{\n" mapconcat identity "\n:}\n" ":set prompt-cont \"%s\""] 9 (#$ . 10590)]) #@41 Is LINE actually a :t/:k/:i? (fn LINE) (defalias 'haskell-interactive-mode-line-is-query #[257 "\300\301\"\205\302\207" [string-match "^:[itk] " t] 4 (#$ . 11222)]) #@30 Go to the start of the line. (defalias 'haskell-interactive-mode-beginning #[0 "\301 \203b\207\302\303!\207" [haskell-interactive-mode-prompt-start haskell-interactive-at-prompt move-beginning-of-line nil] 2 (#$ . 11397) nil]) #@45 Get the interactive mode input up to point. (defalias 'haskell-interactive-mode-input-partial #[0 "\300 \211\204\n\301\302!\210\303`\"\207" [haskell-interactive-at-prompt error "not at prompt" buffer-substring-no-properties] 4 (#$ . 11633)]) #@33 Get the interactive mode input. (defalias 'haskell-interactive-mode-input #[0 "\301d\"\207" [haskell-interactive-mode-prompt-start buffer-substring-no-properties] 3 (#$ . 11883)]) #@179 Show a prompt at the end of the REPL buffer. If SESSION is non-nil, use the REPL buffer associated with SESSION, otherwise operate on the current buffer. (fn &optional SESSION) (defalias 'haskell-interactive-mode-prompt #[256 "r\211\203 \303!\202\fpq\210\212db\210\304\305\306\307\310\311 \312\310& \211\313\314O\304\314\315O\316\310#\261\266\317\302!\210\320 \211\211`\315\223\266)\321\310!\205E\322 )\207" [haskell-interactive-prompt haskell-interactive-prompt-read-only haskell-interactive-mode-prompt-start haskell-session-interactive-buffer propertize font-lock-face haskell-interactive-face-prompt prompt t read-only rear-nonsticky 0 1 nil front-sticky make-local-variable make-marker haskell-interactive-at-prompt haskell-interactive-mode-scroll-to-bottom] 11 (#$ . 12071)]) #@64 Insert the result of an eval as plain text. (fn SESSION TEXT) (defalias 'haskell-interactive-mode-eval-result #[514 "r\304!q\210m\305\306\307\310\311\312\311\313\314\311\315\311& \212db\210 \230\203*\305\306\316\313\n%\262\317!c\210\320 \210\321\303!\210\322 \211\211`\323\223\266)\205G\324 \266\202)\207" [haskell-interactive-mode-read-only haskell-interactive-prompt-cont haskell-interactive-prompt-read-only haskell-interactive-mode-result-end haskell-session-interactive-buffer propertize font-lock-face haskell-interactive-face-result front-sticky t prompt read-only rear-nonsticky result haskell-interactive-face-prompt-cont ansi-color-apply haskell-interactive-mode-handle-h make-local-variable make-marker nil haskell-interactive-mode-scroll-to-bottom] 17 (#$ . 12870)]) #@19 Scroll to bottom. (defalias 'haskell-interactive-mode-scroll-to-bottom #[0 "\300p!\211\205db\210\301`\"\207" [get-buffer-window set-window-point] 4 (#$ . 13668)]) #@38 Echo an error. (fn SESSION MESSAGE) (defalias 'haskell-interactive-mode-compile-error #[514 "\300\301#\207" [haskell-interactive-mode-compile-message haskell-interactive-face-compile-error] 6 (#$ . 13840)]) #@40 Warning message. (fn SESSION MESSAGE) (defalias 'haskell-interactive-mode-compile-warning #[514 "\300\301#\207" [haskell-interactive-mode-compile-message haskell-interactive-face-compile-warning] 6 (#$ . 14056)]) #@53 Echo a compiler warning. (fn SESSION MESSAGE TYPE) (defalias 'haskell-interactive-mode-compile-message #[771 "r\303!q\210p\212\304 \210\305\306\"\211\203K\307\310\311\"\312P\313\314\315\316\314\317 \320\314& c\210\307\310\321\"\322P\323\314\315\316\314\324\n\325\310\321\"G\317 \320\314&c\202Z\307\322P\315\316\314\317 \320\314& c\262*\207" [next-error-last-buffer haskell-interactive-mode-read-only haskell-interactive-mode-hide-multi-line-errors haskell-session-interactive-buffer haskell-interactive-mode-goto-end-point string-match "^\\(.*\\)\n\\([[:unibyte:][:nonascii:]]+\\)" propertize match-string 1 " …\n" expandable t font-lock-face front-sticky read-only rear-nonsticky 2 "\n" collapsible invisible message-length] 20 (#$ . 14278)]) #@73 Echo a read only piece of text before the prompt. (fn SESSION MESSAGE) (defalias 'haskell-interactive-mode-insert #[514 "r\300!q\210\212\301 \210\302\303\304\305\304\306\304&c*\207" [haskell-session-interactive-buffer haskell-interactive-mode-goto-end-point propertize front-sticky t read-only rear-nonsticky] 10 (#$ . 15048)]) #@52 Go to the 'end' of the buffer (before the prompt). (defalias 'haskell-interactive-mode-goto-end-point #[0 "b\210\301 b\207" [haskell-interactive-mode-prompt-start line-beginning-position] 1 (#$ . 15386)]) #@39 Add INPUT to the history. (fn INPUT) (defalias 'haskell-interactive-mode-history-add #[257 "\302\303\304\305\"\"BB\306\211\207" [haskell-interactive-mode-history haskell-interactive-mode-history-index #1="" cl-remove-if make-closure #[257 "\211\300\230\206 \211\301\230\207" [V0 #1#] 3 "\n\n(fn I)"] 0] 7 (#$ . 15598)]) #@57 Do completion if at prompt or else try collapse/expand. (defalias 'haskell-interactive-mode-tab #[0 "\300 \203\301 \207\302`\303\"\203i\304\305!\210\306 \210\211\307 \\b\207\306 \207" [haskell-interactive-at-prompt completion-at-point get-text-property collapsible search-backward-regexp "^[^ ]" haskell-interactive-mode-tab-expand line-beginning-position] 3 (#$ . 15931) nil]) #@33 Expand the rest of the message. (defalias 'haskell-interactive-mode-tab-expand #[0 "\301`\302\"\205!\303 T\301\304\"\301\305\"T\306\307\211\\\304?$)\266\203\207" [inhibit-read-only get-text-property expandable line-end-position invisible message-length t put-text-property] 8 (#$ . 16319)]) (defconst haskell-interactive-mode-error-regexp "^\\(\\(?:[A-Z]:\\)?[^ \n:][^ \n:]*\\):\\([0-9()-:]+\\):?") #@28 Am I on a compile message? (defalias 'haskell-interactive-at-compile-message #[0 "\301 ?\205\212\302 b\210\303!)\207" [haskell-interactive-mode-error-regexp haskell-interactive-at-prompt line-beginning-position looking-at] 2 (#$ . 16732)]) #@58 Go backward to the previous error. (fn &optional COUNT) (defalias 'haskell-interactive-mode-error-backward #[256 "\301\302\303$\207" [haskell-interactive-mode-error-regexp search-backward-regexp nil t] 6 (#$ . 16981) nil]) #@76 Go forward to the next error, or return to the REPL. (fn &optional COUNT) (defalias 'haskell-interactive-mode-error-forward #[256 "\301 b\210\302\303\304$\203\305 b\210\304\207db\210\303\207" [haskell-interactive-mode-error-regexp line-end-position search-forward-regexp nil t line-beginning-position] 6 (#$ . 17213) nil]) #@157 Delete compile messages in REPL buffer. If FILE-NAME is non-nil, restrict to removing messages concerning FILE-NAME only. (fn SESSION &optional FILE-NAME) (defalias 'haskell-interactive-mode-delete-compile-messages #[513 "r\302!q\210\212eb\210\303\304\305\306\307$\203 \306\310 \311 T|\210)eb\210\312 \305\306#\205R\313\307!\310 \305y\210\314\315!\204-\203@\230\203M\306\316`\305#\210)\211`|\210\266\202 *\207" [inhibit-read-only haskell-interactive-mode-error-regexp haskell-session-interactive-buffer search-forward-regexp "^Compilation failed.$" nil t 1 line-beginning-position line-end-position re-search-forward match-string-no-properties looking-at "^[ ]+" set-text-properties] 8 (#$ . 17548)]) #@48 Reset the error cursor position. (fn SESSION) (defalias 'haskell-interactive-mode-reset-error #[257 "r\300!q\210\301 \210\302 \303\304\305#\210\303\306\307\310\"B#\266db)\207" [haskell-session-interactive-buffer haskell-interactive-mode-goto-end-point point-marker haskell-session-set next-error-locus nil next-error-region copy-marker t] 9 (#$ . 18270) nil]) #@45 Get the session interactive buffer. (fn S) (defalias 'haskell-session-interactive-buffer #[257 "\300\301\"\211\203\302!\203\207\303\304\305!\"\306\307!\203-\303\310\305!#\262\211T\262\202\311!\312\"\210r\211q\210\313 \210\314!\210)\315 \210\207" [haskell-session-get interactive-buffer buffer-live-p format "*%s*" haskell-session-name 0 get-buffer "*%s <%d>*" get-buffer-create haskell-session-set-interactive-buffer haskell-interactive-mode haskell-session-assign haskell-interactive-switch] 8 (#$ . 18643)]) #@44 Get the interactive buffer of the session. (defalias 'haskell-interactive-buffer #[0 "\300\301 !\207" [haskell-session-interactive-buffer haskell-session] 2 (#$ . 19180)]) #@57 Do live updates for Cabal processes. (fn STATE BUFFER) (defalias 'haskell-process-cabal-live #[514 "\301\302A@!\303\304AAA@\305O#\"\210AA\211GC\241\266\305\207" [haskell-process-prompt-regex haskell-interactive-mode-insert haskell-process-session replace-regexp-in-string "" nil] 10 (#$ . 19358)]) #@66 Parse the line number from the error string STRING. (fn STRING) (defalias 'haskell-process-parse-error #[257 "\301\301:\203U@\262\302@\"\203N\303\304\305\"\306\307\304\310 \"!\311\307\304\312 \"!\313\304\314\f\"\205:\307\304\314 \"!\315\304\316\"\205J\307\304\316\"!\257\n\262A\262\202\266\207" [haskell-compilation-error-regexp-alist nil string-match :file match-string 1 :line string-to-number 2 :col 4 :line2 3 :col2 5] 17 (#$ . 19671)]) #@141 Add the (matched) module to your cabal file. Cabal file is selected using SESSION's name, module matching is done in MSG. (fn SESSION MSG) (defalias 'haskell-process-suggest-add-package #[514 "\300\301\"\302\303\304#\305\306\"\210\300\301\"\307!\310P\311 \210\312\216\313\314\315#!\205A\316\317\320$\210\313\314\321\"!\205A\322\323!\314\324\"\")\207" [match-string 1 replace-regexp-in-string "-[^-]+$" "" string-match "\\([^-]+\\)$" haskell-session-name ".cabal" haskell-mode-toggle-interactive-prompt-state #[0 "\300\301!\207" [haskell-mode-toggle-interactive-prompt-state t] 2] y-or-n-p format "Add `%s' to %s? " haskell-cabal-add-dependency nil t "Enable -package %s in the GHCi session? " haskell-process-queue-without-filters haskell-session-process ":set -package %s"] 11 (#$ . 20146)]) #@208 Suggest removing or commenting out import statement. Asks user to handle redundant import statement using interactive SESSION in specified FILE to remove IMPORT on given LINE. (fn SESSION FILE IMPORT LINE) (defalias 'haskell-process-suggest-remove-import #[1028 "\300 \210\301\216\302\303\304\305\306#\307\310#!\211\311\267\202O\312\"\210\212eb\210Sy\210\313 b\210\313 \314 |)\202P\315\316\"\202P\312\"\210\212eb\210Sy\210\313 b\210\317c)\202P\320\262)\207" [haskell-mode-toggle-interactive-prompt-state #[0 "\300\301!\207" [haskell-mode-toggle-interactive-prompt-state t] 2] read-event propertize format "%sThe import line `%s' is redundant. Remove? (y, n, c: comment out) " "" face minibuffer-prompt #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (121 23 110 49 99 56)) haskell-process-find-file line-beginning-position line-end-position message "Ignoring redundant import %s" "-- " nil] 10 (#$ . 20963)]) #@56 Find the given file in the project. (fn SESSION FILE) (defalias 'haskell-process-find-file #[514 "\300\301\302!\303Q!\203\302!\303Q\202*\301\304!\303Q!\203)\304!\303Q\202*!\207" [find-file file-exists-p haskell-session-current-dir "/" haskell-session-cabal-dir] 7 (#$ . 21931)]) #@201 Suggest to add something to the top of the file. SESSION is used to search given file. Adds PRAGMA and EXTENSION wrapped in compiler directive at the top of FILE. (fn SESSION PRAGMA EXTENSION FILE) (defalias 'haskell-process-suggest-pragma #[1028 "\300\301#\302 \210\303\216\304\300\305\"!\205!\306\"\210\212eb\210\211\307Pc))\207" [format "{-# %s %s #-}" haskell-mode-toggle-interactive-prompt-state #[0 "\300\301!\207" [haskell-mode-toggle-interactive-prompt-state t] 2] y-or-n-p "Add %s to the top of the file? " haskell-process-find-file "\n"] 9 (#$ . 22232)]) #@41 Insert an error message. (fn RESPONSE) (defalias 'haskell-interactive-mode-insert-error #[257 "\300\301\302\"\261\210\303 \207" ["\n" haskell-fontify-as-mode haskell-mode haskell-interactive-mode-prompt] 5 (#$ . 22811)]) #@33 Pop up an error. (fn RESPONSE) (defalias 'haskell-interactive-popup-error #[257 "\203F\302\303!\304\305\306#\210r\211q\210\307 \210\306\310 \210\311\312\313#c\210eb\210\314 \210\311\315\312\316#\211\311\317\312\320#\261\210\212db\210\321\311\322\312\320#\261)\262*\207\323!\207" [haskell-interactive-popup-errors inhibit-read-only get-buffer-create "*HS-Error*" pop-to-buffer nil t haskell-error-mode erase-buffer propertize font-lock-face haskell-interactive-face-compile-error delete-blank-lines "-- " font-lock-comment-delimiter-face "Hit `q' to close this window.\n\n" font-lock-comment-face "\n" "To disable popups, customize `haskell-interactive-popup-errors'.\n\n" haskell-interactive-mode-insert-error] 9 (#$ . 23041)]) #@73 See `next-error-function' for more information. (fn &optional N RESET) (defalias 'haskell-interactive-next-error-function #[512 "\301 \302\303\"\302\304\"\305\2037\204\306U\2047\2047@b\210\307!\204*\310 \210\311\262\307!\2047\312\313!\210\211\204a\306V\203O\310!\204a\312\314!\210\202a\306W\203a\315[!\204a\312\314!\210\316\317 \320 \"\321\"\205\357\322 \317 \305\223\323!\324\325\"\324\326\"\324\327\"\324\330\"\331\332 !\"\331\333!\"\334!\203\237\202\246\334!\205\246\211\335\304 #\210\211\203\350\322 \322 r\336!q\210\212eb\210Sy\210`\\S\305\223\210\203\332\211`Z\305\223\210*\337 \340!\205\346#\207\312\341\"\266\211\207" [haskell-interactive-mode-error-regexp haskell-interactive-session haskell-session-get next-error-region next-error-locus nil 0 looking-at haskell-interactive-mode-error-forward t error "no errors found" "no more errors" haskell-interactive-mode-error-backward buffer-substring-no-properties line-beginning-position line-end-position string-match make-marker haskell-process-parse-error plist-get :file :line :col :col2 expand-file-name haskell-session-cabal-dir haskell-session-current-dir file-exists-p haskell-session-set find-file-noselect compilation-goto-locus marker-position "don't know where to find %S"] 23 (#$ . 23786)]) #@66 Get the `haskell-session', throw an error if it's not available. (defalias 'haskell-interactive-session #[0 "\300 \206\301\302 \206\303 \206\304\305!!\207" [haskell-session-maybe haskell-session-assign haskell-session-from-buffer haskell-session-choose error "No session associated with this buffer. Try M-x haskell-session-change or report this as a bug."] 3 (#$ . 25120)]) #@26 Get the Haskell session. (defalias 'haskell-interactive-process #[0 "\300\301 !\206\n\302\303!\207" [haskell-session-process haskell-interactive-session error "No Haskell session/process associated with this\n buffer. Maybe run M-x haskell-process-restart?"] 2 (#$ . 25507)]) #@146 Present the given expression EXPR. Requires the `present' package to be installed. Will automatically import it qualified as Present. (fn EXPR) (defalias 'haskell-interactive-mode-do-presentation #[257 "\300 \301\302\303\304\"\"\204\305!\210\303\306\307Q\"\211\310\230\204(\311\312 \313P\"\210\202H\314 \303\315\316#\"\210\317\320C\"\313c\210\321\"\210\311\312 \313\"\266\322\312 !\207" [haskell-interactive-process string-match "^Present" haskell-process-queue-sync-request ":t Present.encode" haskell-interactive-mode-setup-presentation "let it = Present.asData (" ")" "" haskell-interactive-mode-eval-result haskell-interactive-session "\n" haskell-interactive-mode-presentation-hash format "let %s = Present.asData (%s)" haskell-interactive-mode-present-id 0 haskell-interactive-mode-insert-presentation haskell-interactive-mode-prompt] 10 (#$ . 25796)]) #@73 Generate a presentation for the current expression at ID. (fn HASH ID) (defalias 'haskell-interactive-mode-present-id #[514 "\300 \301\302\"\210\303\304\305\306\307\310\311 \"\312##\"\313\314\"\203#\315\202&\316!\301\317\"\210\207" [haskell-interactive-process haskell-process-queue-without-filters "let _it = it" haskell-process-queue-sync-request format "Present.putStr (Present.encode (Present.fromJust (Present.present (Present.fromJust (Present.fromList [%s])) %s)))" mapconcat identity mapcar number-to-string "," string-prefix-p "*** " ((rep nil)) read "let it = _it"] 12 (#$ . 26679)]) #@88 The callback to evaluate the slot and present it in place of the button BTN. (fn BTN) (defalias 'haskell-presentation-present-slot #[257 "\300\301\"\300\302\"\300\303\"\300\304\"`\305\306\307#\210\310!\311!|\210\312\313\"$\210`V\2057\211Tb\207" [button-get presentation-id hash parent-rep continuation button-put invisible t button-start button-end haskell-interactive-mode-insert-presentation haskell-interactive-mode-present-id] 11 (#$ . 27290)]) #@89 Make a slot at point, pointing to ID. (fn HASH SLOT PARENT-REP &optional CONTINUATION) (defalias 'haskell-interactive-mode-presentation-slot #[1027 "@A@\300!\301>\203\302\303\"$\207\304 $\207" [intern (Integer Char Int Float Double) haskell-interactive-mode-insert-presentation haskell-interactive-mode-present-id haskell-interactive-mode-presentation-slot-button] 11 (#$ . 27765)]) #@42 (fn SLOT PARENT-REP CONTINUATION HASH) (defalias 'haskell-interactive-mode-presentation-slot-button #[1028 "`@A@\300\301\302#c\210\303`\304\305$\306\307\310#\210\306\311#\210\306\312 #\210\306\313#\210\306\314#\207" [propertize font-lock-face (:height 0.8 :underline t :inherit font-lock-comment-face) make-text-button :type haskell-presentation-slot-button button-put hide-on-click t presentation-id parent-rep continuation hash] 12 (#$ . 28173)]) #@118 Insert the presentation, hooking up buttons for each slot. (fn HASH PRESENTATION &optional PARENT-REP CONTINUATION) (defalias 'haskell-interactive-mode-insert-presentation #[1026 "\300\236A@\301\236A@\302\236A@\211?\303\230\203\304\305\306#c\207\307\230\203+\304\305\306#c\207\310\230\203H\304\311\230\203B\312\313\314#\202C\305\315#c\207\316\230\203{\317c\210\320\321:\203v@\262\204d\322c\210\323  #\210\321\262A\262\202T\266\324c\207\325\230\203\336\204\223\203\220\326\327!\210\330 \207\331c\207\332\204\233\333c\210i\321:\203\324@\262\323\f\n\nGSU$\210GSU\204\311\334c\210Sj\210\322c\210T\262A\262\202\236\266?\205\335\335c\207\311\230\203\311\230\204\361\304\336\305\315#c\210\321:\203 @\262\323\n#\210A\262\202\363\266\311\230?\205\314\304\336\305\315#c\207\337\230\203q\2032\211\2042\325\230\2042\317c\210i\304\305\340#c\210\321:\203\\@\262\334c\210\341\\j\210\323  #\210A\262\202<\266\205\314\211?\205\314\325\230?\205\314\324c\207\342\230\203\271i\304\305\340#\343\261\210\321:\203\256@\262\334c\210\341\\j\210\211@A@\344\261\210\323  #\266A\262\202\203\266\334c\210\211j\210\345c\207\321=\203\306\304\346\305\347#c\207\350c\210\351\350!\207" [rep text slots "integer" propertize font-lock-face font-lock-constant "floating" "char" "string" replace-regexp-in-string "^'\\(.+\\)'$" "\\1" font-lock-string-face "tuple" "(" t nil "," haskell-interactive-mode-presentation-slot ")" "list" delete-char -1 delete-indentation "[]" 0 "[" "\n" "]" "\"" "alg" font-lock-type-face 2 "record" " { " " = " "}" "?" font-lock-warning "Unable to present! This very likely means Emacs\nis out of sync with the `present' package. You should make sure\nthey're both up to date, or report a bug." error] 18 (#$ . 28646)]) #@239 Setup the GHCi REPL for using presentations. Using asynchronous queued commands as opposed to sync at this stage, as sync would freeze up the UI a bit, and we actually don't care when the thing completes as long as it's soonish. (fn P) (defalias 'haskell-interactive-mode-setup-presentation #[257 "\300\301\"\210\300\302\"\210\300\303\"\210\300\304\"\210\300\305\"\210\300\306\"\207" [haskell-process-queue-without-filters "import qualified Data.Maybe as Present" "import qualified Data.ByteString.Lazy as Present" "import qualified Data.AttoLisp as Present" "import qualified Present.ID as Present" "import qualified Present as Present" "Present.present (Present.fromJust (Present.fromList [0])) ()"] 4 (#$ . 30502)]) #@23 Counter for the hash. (defvar haskell-interactive-mode-presentation-hash 0 (#$ . 31235)) #@31 Generate a presentation hash. (defalias 'haskell-interactive-mode-presentation-hash #[0 "\301\302T\211\"\207" [haskell-interactive-mode-presentation-hash format "_present_%s"] 4 (#$ . 31330)]) (define-button-type 'haskell-presentation-slot-button 'action 'haskell-presentation-present-slot 'follow-link t 'help-echo "Click to expand…") #@48 Toggle the history N items up or down. (fn N) (defalias 'haskell-interactive-mode-history-toggle #[257 "\205\302 \\G\"\211\303U\204\304\305 \"\210\306 8!\207" [haskell-interactive-mode-history haskell-interactive-mode-history-index mod 0 message "History item: %d" haskell-interactive-mode-set-prompt] 5 (#$ . 31676)]) #@49 Set (and overwrite) the current prompt. (fn P) (defalias 'haskell-interactive-mode-set-prompt #[257 "r\301\302 !q\210b\210`d|\210\211c)\207" [haskell-interactive-mode-prompt-start haskell-session-interactive-buffer haskell-interactive-session] 3 (#$ . 32011)]) #@50 Cycle backwards through input history. (fn ARG) (defalias 'haskell-interactive-mode-history-previous #[257 "\301 \205\211\302U\204\303!\207\302\303\304!\207" [haskell-interactive-mode-history-index haskell-interactive-at-prompt 0 haskell-interactive-mode-history-toggle 1] 3 (#$ . 32280) "*p"]) #@48 Cycle forward through input history. (fn ARG) (defalias 'haskell-interactive-mode-history-next #[257 "\301 \205\211\302U\204\303[!\207\302\303\304!\207" [haskell-interactive-mode-history-index haskell-interactive-at-prompt 0 haskell-interactive-mode-history-toggle -1] 3 (#$ . 32588) "*p"]) #@30 Jump to the previous prompt. (defalias 'haskell-interactive-mode-prompt-previous #[0 "\212\300 \210\301\302 \303\304#\205\305\225)\211\205\211b\207" [beginning-of-line search-backward-regexp haskell-interactive-prompt-regex nil t 0] 4 (#$ . 32892) nil]) #@26 Jump to the next prompt. (defalias 'haskell-interactive-mode-prompt-next #[0 "\300\301 \302\303#\207" [search-forward-regexp haskell-interactive-prompt-regex nil t] 4 (#$ . 33156) nil]) #@62 Clear the screen and put any current input into the history. (defalias 'haskell-interactive-mode-clear #[0 "\301 r\302!q\210\303\304ed\305#\210)ed|\210\306 \210\307!\210\310\311\305#\210\310\312\305#\210)r\313\314!q\210\303ed|\210)\306 )\207" [inhibit-read-only haskell-interactive-session haskell-session-interactive-buffer t set-text-properties nil remove-overlays haskell-interactive-mode-prompt haskell-session-set next-error-region next-error-locus get-buffer-create "*haskell-process-log*"] 5 (#$ . 33348) nil]) #@136 Offer completions for partial expression between prompt and point. This completion function is used in interactive REPL buffer itself. (defalias 'haskell-interactive-mode-completion-at-point-function #[0 "\300 \205/\301 \302 \303\"G@GZ\304\305\306\"\205\307\305\310\"\205$\311A#`Z`E\266\205\207" [haskell-interactive-at-prompt haskell-interactive-process haskell-interactive-mode-input-partial haskell-process-get-repl-completions append string-prefix-p "import" ("import") "let" ("let")] 9 (#$ . 33879)]) #@134 Look for an compile error. If there is one, pop that up in a buffer, similar to `debug-on-error'. (fn STATE RESPONSE) (defalias 'haskell-interactive-mode-trigger-compile-error #[514 "\205c\304\305\"\205c\304\306\"?\205c\307\n`|\210\n \310\223\210db\210)\311\312\234!\204^\304\313\"\2048\304\314\"\203^\315\316 !\210\317\316 \320\321\nd\"P\"\304\322\"\204V\323!\266\202b\324!\266\202b\324!\210\307\207" [haskell-interactive-types-for-show-ambiguous inhibit-read-only haskell-interactive-mode-prompt-start haskell-interactive-mode-old-prompt-start string-match "^\n:[-0-9]+:[-0-9]+:" "^\n:[-0-9]+:[-0-9]+:[\n ]+[Ww]arning:" t nil haskell-interactive-mode-line-is-query 2 "No instance for (?Show[ \n]" "Ambiguous type variable " haskell-process-reset haskell-interactive-process haskell-process-queue-sync-request ":t " buffer-substring-no-properties ":" haskell-interactive-mode-insert-error haskell-interactive-popup-error] 8 (#$ . 34405)]) #@88 Echo a read only piece of text before the prompt. (fn SESSION MESSAGE &optional MODE) (defalias 'haskell-interactive-mode-echo #[770 "r\300!q\210\212\301 \210\211\203\302\303P\"\202#\304\303P\305\306\307\306\310\306&c*\207" [haskell-session-interactive-buffer haskell-interactive-mode-goto-end-point haskell-fontify-as-mode "\n" propertize front-sticky t read-only rear-nonsticky] 11 (#$ . 35427)]) #@63 Get the splices buffer for the current SESSION. (fn SESSION) (defalias 'haskell-interactive-mode-splices-buffer #[257 "\300\301!!\207" [get-buffer-create haskell-interactive-mode-splices-buffer-name] 4 (#$ . 35841)]) #@16 (fn SESSION) (defalias 'haskell-interactive-mode-splices-buffer-name #[257 "\300\301\302!\"\207" [format "*%s:splices*" haskell-session-name] 5 (#$ . 36066)]) #@47 Echo a compiler splice. (fn SESSION MESSAGE) (defalias 'haskell-interactive-mode-compile-splice #[514 "r\301!q\210\302=\204\302 \210\303\304\"\303@\305\"\211@\306\307A\305#A@\310\305\261\210`\305\261\210\311`\312#\266\313c\210`\305\261\210\311`\312#\262\266\205)\207" [major-mode haskell-interactive-mode-splices-buffer haskell-mode split-string "\n ======>\n" "\n" mapconcat identity "-- " indent-rigidly -4 "-- =>\n"] 12 (#$ . 36234)]) #@73 Echo a read only piece of text before the prompt. (fn SESSION MESSAGE) (defalias 'haskell-interactive-mode-insert-garbage #[514 "r\300!q\210\212\301 \210\302\303\304\305\306\307\304\310\304& c*\207" [haskell-session-interactive-buffer haskell-interactive-mode-goto-end-point propertize front-sticky t font-lock-face haskell-interactive-face-garbage read-only rear-nonsticky] 12 (#$ . 36698)]) #@243 Send LINE to the GHCi process and echo the result in some fashion. Result will be printed in the minibuffer or presented using function `haskell-presentation-present', depending on variable `haskell-process-use-presentation-mode'. (fn LINE) (defalias 'haskell-process-show-repl-response #[257 "\300 \301\302\303B\304\305\306%\"\207" [haskell-interactive-process haskell-process-queue-command record haskell-command #[257 "\300@A\"\207" [haskell-process-send-string] 4 "\n\n(fn STATE)"] nil #[514 "\203\f\301\302@!\"\207\303!\207" [haskell-process-use-presentation-mode haskell-presentation-present haskell-process-session haskell-mode-message-line] 5 "\n\n(fn STATE RESPONSE)"]] 10 (#$ . 37101)]) (provide 'haskell-interactive-mode)