;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (defvar nix-prompt-regexp "nix-repl> ") (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\302%\210\310\311\312\313\314DD\315\316\317%\207" [require comint nix custom-declare-group nix-repl nil "nix-repl customizations" :group custom-declare-variable nix-repl-executable-args funcall function #[0 "\300\207" [("repl")] 1] "Arguments to provide to nix-repl." :type list] 6) #@60 Buffer to be used to redirect output of readline commands. (defvar nix-repl-completion-redirect-buffer " *nix-repl completions redirect*" (#$ . 468)) (byte-code "\300\301\302\303\304DD\305\306\307%\207" [custom-declare-variable nix-repl-completion-output-timeout funcall function #[0 "\300\207" [1.0] 1] "Time in seconds to wait for completion output before giving up." :type float] 6) (defvar nix-repl-mode-map (byte-code "\300 \301\302\303#\210\207" [make-sparse-keymap define-key " " completion-at-point] 5)) (defvar nix-repl-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [nix-repl-mode-hook variable-documentation put "Hook run after entering Nix-REPL mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp nix-repl-mode-map definition-name nix-repl-mode] 4) (defvar nix-repl-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" [nix-repl-mode-abbrev-table nix-repl-mode-map variable-documentation put purecopy "Keymap for `nix-repl-mode'." boundp nix-repl-mode-syntax-table definition-name nix-repl-mode (lambda (def-tmp-var) (defvar nix-repl-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `nix-repl-mode'." (lambda (def-tmp-var) (defvar nix-repl-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `nix-repl-mode'." derived-mode-parent comint-mode] 5) #@225 Interactive prompt for Nix. In addition to any hooks its parent mode `comint-mode' might have run, this mode runs the hook `nix-repl-mode-hook', as the final or penultimate step during initialization. \{nix-repl-mode-map} (defalias 'nix-repl-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 \325\"C#\210\327 !\210\330\f!\210 \"\306\331!\210#\306\332!\210\307\333\334\335\336\337$\210)\340\341!\207" [delay-mode-hooks major-mode mode-name nix-repl-mode-map nix-repl-mode-syntax-table nix-repl-mode-abbrev-table make-local-variable t comint-mode nix-repl-mode "Nix-REPL" 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 comint-prompt-regexp comint-prompt-read-only add-hook completion-at-point-functions nix-repl-completion-at-point nil local run-mode-hooks nix-repl-mode-hook local-abbrev-table nix-prompt-regexp] 5 (#$ . 2177) nil]) #@61 Use temp process PROC filter on BODY. (fn PROC &rest BODY) (defalias 'nix--with-temp-process-filter '(macro . #[385 "\300\301\302\303DD\304BB\305\306BB\307\310\311BB\305\312BB\313BBBF\207" [let* (buf (generate-new-buffer " *temp-process-output*")) proc-filter-saved process-filter ((proc-marker (with-current-buffer buf (point-marker)))) set-process-filter ((nix--process-filter buf proc-marker)) unwind-protect with-current-buffer buf (proc-filter-saved) ((kill-buffer buf))] 10 (#$ . 3344)])) (byte-code "\300\301\302\303#\300\207" [function-put nix--with-temp-process-filter lisp-indent-function defun] 4) #@20 Load the Nix-REPL. (defalias 'nix-repl #[0 "\300\301\302!!\210\303p!?\205\304p!\210\305 \207" [pop-to-buffer-same-window get-buffer-create "*Nix-REPL*" comint-check-proc nix--make-repl-in-buffer nix-repl-mode] 3 (#$ . 3966) nil]) (defalias 'nix-repl-show 'nix-repl) #@39 Make Nix Repl in BUFFER. (fn BUFFER) (defalias 'nix--make-repl-in-buffer #[257 "\302\303\304\305\306BBB \"\"\207" [nix-executable nix-repl-executable-args apply make-comint-in-buffer append "Nix-REPL" (nil)] 8 (#$ . 4240)]) #@82 Get completions for INPUT using native readline for PROCESS. (fn PROCESS INPUT) (defalias 'nix-get-completions #[514 "r\306!q\210\307!\310!\311P\212d\312 ZG\\)\313\314\"P\315\316 #\216rq\210\317 \210\320\211\211\321  !\"\322\323\324 \"\"\210\325\"\210\326# #\205\206\327 \210\320f\330=\203n\331\332\333 e\"\334\321#A\202\206\335\336\320\321#\210\337u\210`Sf\340=?\205\206\332\333 `\"C.\266\206)\207" [nix-repl-completion-redirect-buffer nix-prompt-regexp comint-redirect-output-buffer comint-redirect-finished-regexp comint-redirect-insert-matching-regexp comint-redirect-perform-sanity-check process-buffer process-filter get-buffer-create " " comint-bol make-string 8 make-closure #[0 "\302\300\301\"\207" [V0 V1 set-process-filter] 3] erase-buffer nil t set-process-filter apply-partially comint-redirect-filter process-send-string nix--accept-process-output beginning-of-line 13 split-string buffer-substring-no-properties line-beginning-position "[ \f \n ]+" search-forward "" -1 7 comint-redirect-completed comint-redirect-echo-input nix-repl-completion-output-timeout] 14 (#$ . 4473)]) #@516 Accept PROCESS output with TIMEOUT until REGEXP is found. Optional argument TIMEOUT is the timeout argument to `accept-process-output' calls. Optional argument REGEXP overrides the regexp to match the end of output, defaults to `comint-prompt-regexp'. Returns non-nil when output was properly captured. This utility is useful in situations where the output may be received in chunks, since `accept-process-output' gives no guarantees they will be grabbed in a single call. (fn PROCESS &optional TIMEOUT REGEXP) (defalias 'nix--accept-process-output #[769 "\211\206\3012%\302\"\204\303\301\304\"\210\305\304\306#\203 \303\301\306\"\210\202 \207" [comint-prompt-regexp found accept-process-output throw nil re-search-backward t] 8 (#$ . 5609)]) #@93 Completion at point function for Nix using "nix-repl". See `completion-at-point-functions'. (defalias 'nix-repl-completion-at-point #[0 "\212\301\302!\205\303!\205\304 \211:\205*\211\242\243\305\306p!{\"\307\310\257\266\204\262)\207" [nix-executable derived-mode-p nix-repl-mode executable-find nix--prefix-bounds nix-get-completions get-buffer-process :exclusive no] 11 (#$ . 6373)]) #@74 Get bounds of Nix attribute path at point as a (BEG . END) pair, or nil. (defalias 'nix--prefix-bounds #[0 "\212\300\301x\302W\205``\300\301w\\B)\207" ["a-zA-Z0-9'\\-_\\." nil 0] 4 (#$ . 6779)]) #@98 Send INPUT to PROCESS. MUTE if true then don’t alert user. (fn INPUT &optional PROCESS MUTE) (defalias 'nix--send-repl #[769 "\206\300p!\2032\301\302!\303!rq\210\304 )\305\306\"\"\210\307\310$\216rq\210\311\"*\207\311\"\207" [get-buffer-process generate-new-buffer " *temp-process-output*" process-filter point-marker set-process-filter nix--process-filter make-closure #[0 "\303\300\302\"\210\304\301!\207" [V0 V1 V2 set-process-filter kill-buffer] 3] process-send-string] 12 (#$ . 6982)]) #@45 Generate control character CHAR. (fn CHAR) (defalias 'nix--char-with-ctrl #[257 "\300\301\302\"!\207" [char-to-string logand 159] 5 (#$ . 7502)]) #@67 Process filter for Nix-rel buffer BUF at MARKER. (fn BUF MARKER) (defalias 'nix--process-filter #[514 "\300\301#\207" [make-closure #[514 "\302\300!\205r\300q\210\212\301b\210\211c\210\301`\303\223*\207" [V0 V1 buffer-live-p nil] 5 "\n\n(fn PROC STRING)"]] 6 (#$ . 7656)]) (provide 'nix-repl)