;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require easymenu pcase tabulated-list tuareg] 2) #@1519 Copyright (c) 2011, Jeremie Dimino All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Jeremie Dimino nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (defconst utop-license "BSD3" (#$ . 205)) (byte-code "\300\301\302\303\304\305\306\307\310\311& \210\312\313\314\315\316DD\317\320\321\310\301&\210\312\322\314\315\323DD\324\320\325\310\301&\210\312\326\314\315\327DD\330\320\315\310\301&\210\312\331\314\315\332DD\333\320\334\310\301&\210\312\335\314\315\336DD\337\320\334\310\301&\210\312\340\314\315\341DD\342\320\325\310\301&\210\343\326\344\345\310\301%\210\343\346\302\347\310\301%\210\343\350\302\351\310\301%\210\343\352\353\354#\210\343\355\356\357\310\301%\207" [custom-declare-group utop nil "A toplevel for the ocaml programming language which interact\nwith Emacs to provide an enhanced environment." :tag "The Caml Emacs-Lisp Toplevel" :version "1.0" :group applications custom-declare-variable utop-command funcall function #[0 "\300\207" [#1="utop -emacs"] 1 #1#] "The command to execute for utop." :type string utop-edit-command #[0 "\300\207" [t] 1] "Whether to read the command from the minibuffer before running utop.\n\nIf nil, `utop-command' will be used without modification." boolean utop-prompt #[0 "\300\207" [utop-default-prompt] 1] "The function which create the prompt for utop." utop-mode-hook #[0 "\300\207" [nil] 1] "A hook that gets run when `utop-mode' is entered." hook utop-exit-hook #[0 "\300\207" [nil] 1] "A hook that is run whenever `utop' is exited.\nThis hook is only run if exiting actually kills the buffer." utop-load-packages-without-asking #[0 "\300\207" [nil] 1] "Load packages from file local variables without asking" custom-declare-face ((((background dark)) (:foreground "Cyan1")) (((background light)) (:foreground "blue"))) "The face used to highlight the prompt." utop-stdout "The face used to highlight messages comming from stdout." utop-stderr "The face used to highlight messages comming from stderr." utop-frozen ((t (:bold t))) "The face used to highlight text that has been sent to utop." utop-error ((t (:foreground "#ff4040" :bold t :underline t))) "The face used to highlight errors in phrases."] 10) #@44 The name of the buffer utop is running on. (defconst utop-buffer-name "*utop*" (#$ . 3750)) #@65 List of text properties for the non-editable part of the buffer (defconst utop-non-editable-properties '(read-only t rear-nonsticky (read-only face)) (#$ . 3848)) #@42 The Lisp-object for the utop sub-process (defvar utop-process nil (#$ . 4017)) #@24 The utop local keymap. (defvar utop-mode-map (byte-code "\300 \301\302\303#\210\301\304\303#\210\301\305\306#\210\301\307\310#\210\301\311\310#\210\301\312\313#\210\301\314\315#\210\301\316\317#\210\301\320\321#\210\301\322\321#\210\301\323\324#\210\301\325\326#\210\301\327\330#\210\301\331\332#\210\207" [make-sparse-keymap define-key [return] utop-eval-input-or-newline [(control 109)] [(control 106)] utop-eval-input-auto-end [home] utop-bol [(control 97)] [(meta 112)] utop-history-goto-prev [(meta 110)] utop-history-goto-next " " utop-complete [(control 99) (control 99)] utop-interrupt [(control 99) (control 105)] [(control 99) (control 107)] utop-kill [(control 99) (control 103)] utop-exit [(control 99) (control 115)] utop [(control 99) 109] utop-copy-old-input] 5) (#$ . 4102)) #@51 The point at the beginning of the current prompt. (defvar utop-prompt-min 0 (#$ . 4913)) #@45 The point at the end of the current prompt. (defvar utop-prompt-max 0 (#$ . 5008)) #@48 The point at the end of the last input prompt. (defvar utop-input-prompt-max 0 (#$ . 5097)) #@55 The output of the utop sub-process not yet processed. (defvar utop-output "" (#$ . 5195)) #@36 The number of the current command. (defvar utop-command-number 0 (#$ . 5291)) #@21 Current completion. (defvar utop-completion nil (#$ . 5375)) #@34 Prefixes for current completion. (defvar utop-completion-prefixes nil (#$ . 5442)) #@90 When set to a non-nil value, always insert text, even if it is before the end of prompt. (defvar utop-inhibit-check nil (#$ . 5531)) #@188 State of utop. It is one of: - edit: the user is typing a command - comp: waiting for completion - hist: waiting for history - wait: ocaml is evaluating a phrase - done: ocaml has died. (defvar utop-state nil (#$ . 5671)) #@39 The buffer that requested completion. (defvar utop-complete-buffer nil (#$ . 5900)) #@29 Initial phrase to evaluate. (defvar utop-initial-command nil (#$ . 5990)) #@59 Mode to evaluate utop-initial-command in (nil or :multi). (defvar utop-initial-mode nil (#$ . 6070)) #@30 The OCaml phrase terminator. (defvar utop-phrase-terminator ";;" (#$ . 6177)) #@15 History entry (defvar utop-pending-entry nil (#$ . 6261)) #@116 The position of the cursor in the phrase sent to OCaml (where to add the newline character if it is not accepted). (defvar utop-pending-position nil (#$ . 6326)) (byte-code "\300\301\302!!\207" [make-variable-buffer-local (lambda (def-tmp-var) (defvar utop-package-list def-tmp-var "List of packages to load when visiting OCaml buffer.\nUseful as file variable.")) nil] 3) #@61 The function used to find the beginning of the next phrase. (defvar utop-next-phrase-beginning 'utop-compat-next-phrase-beginning (#$ . 6705)) #@112 The function used to discover a phrase. It should return a triple (begin-pos, end-pos, end-pos-with-comments). (defvar utop-discover-phrase 'utop-compat-discover-phrase (#$ . 6855)) #@133 Whether to skip to next phrase after evaluation. Non-nil means skip to the end of the phrase after evaluation in the Caml toplevel (defvar utop-skip-after-eval-phrase t (#$ . 7044)) #@74 continuation function to populate the candidates for the company backend (defvar utop--complete-k #[257 "\300\207" [nil] 2 "\n\n(fn CANDIDATES)"] (#$ . 7233)) #@65 detected version of utop protocol. 0 for unknown or version pre (defvar utop-protocol-version "0" (#$ . 7398)) #@48 whether we've tried to detect the utop version (defvar utop--read-version nil (#$ . 7515)) (defvar utop--company-loaded nil) (defalias 'utop--supports-company #[0 "\3011\f\302\303\"0\202\210\202\205\304\305!\207" [utop-protocol-version (error) version<= "1" featurep company] 3]) #@150 Resolve a symbol based on the current major mode. CHOICES is a list of 3 function symbols: (tuareg-symbol typerex-symbol caml-symbol). (fn CHOICES) (defalias 'utop-compat-resolve #[257 "\301\267\202\302\202\303\202\304\202\305\202\306\307\310\"!)8\207" [major-mode #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (tuareg-mode 6 typerex-mode 10 caml-mode 14 reason-mode 18)) 0 1 2 3 error format "utop doesn't support the major mode \"%s\". It\nsupports caml, tuareg, typerex and reason modes by default. For other\nmodes you need to set these variables:\n\n- `utop-next-phrase-beginning'\n- `utop-discover-phrase'\n"] 5 (#$ . 7810)]) #@38 Move to the next phrase after point. (defalias 'utop-tuareg-next-phrase #[0 "\212\301\302\303!)\262\205\304\305x\210`\306V\205`S)\211\203\"\211\202#`\307!\211\205?\211AA@b\210\310 \210\303\311!\203=\312\225b\210\310 \207" [inhibit-changing-match-data "[;[:blank:]]*$" t looking-at ";[:blank:]" nil 1 tuareg-discover-phrase tuareg-skip-blank-and-comments ";;[ \n]*" 0] 5 (#$ . 8503)]) (defalias 'utop-compat-next-phrase-beginning #[0 "\300\301! \207" [utop-compat-resolve (utop-tuareg-next-phrase typerex-skip-to-end-of-phrase caml-skip-to-end-of-phrase reason-next-phrase)] 2]) (defalias 'utop-compat-discover-phrase #[0 "\300\301! \207" [utop-compat-resolve (tuareg-discover-phrase typerex-discover-phrase caml-find-phrase reason-discover-phrase)] 2]) #@75 Execute the given actions while checks are inhibited. (fn &rest ACTIONS) (defalias 'utop-perform '(macro . #[128 "\300\301\302BE\207" [let ((utop-inhibit-check t) (inhibit-read-only t)) progn] 5 (#$ . 9275)])) #@132 Send a string to the utop process. This function can only be called in the utop buffer and while the state is not 'done. (fn STR) (defalias 'utop-send-string #[257 "\301\"\207" [utop-process process-send-string] 4 (#$ . 9494)]) #@88 Send a command to utop. If utop is not running or has exited, it is started. (fn STR) (defalias 'utop-send-command #[257 "\303!\211\204 \212\304 )\262r\211q\210 \305=\203\306 \210\307\n\")\207" [utop-buffer-name utop-state utop-process get-buffer utop done utop-restart process-send-string] 5 (#$ . 9731)]) #@53 Insert text with checks inhibited. (fn &rest ARGS) (defalias 'utop-insert #[128 "\302\211\303\304\"*\207" [inhibit-read-only utop-inhibit-check t apply insert] 4 (#$ . 10051)]) #@58 Move the point to the end of buffer in all utop windows. (defalias 'utop-goto-point-max-all-windows #[0 "\301!\302\303\304\"!\207" [utop-buffer-name get-buffer walk-windows make-closure #[257 "\301!\300=\205\302!\210db\207" [V0 window-buffer select-window] 3 "\n\n(fn WINDOW)"]] 5 (#$ . 10238)]) #@58 Change the utop state and mode-line-process. (fn STATE) (defalias 'utop-set-state #[257 "\211\211\303\267\202m\304\202n\305\202n\306\202n\307\202n\310\202n\311 !\312 !\313=\2034\211\314U\2034\266\315\202n\313=\204@\316=\203g\317\267\202N\320\202O\321\202O\322\323\324\325!\326\260\327\314G\330$\210\262\266\202\202n\266\331\202n\331\211\207" [utop-state utop-process mode-line-process #s(hash-table size 6 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (edit 8 comp 12 hist 16 wait 20 copy 24 done 28)) ": idle" ": completion" ": history" ": running" ": copying" process-status process-exit-status exit 0 ": exited[0]" signal #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (exit 70 signal 74)) "exited" "killed" nil ": " "[" int-to-string "]" add-text-properties (face bold) ": unknown"] 10 (#$ . 10546)]) #@38 Send current input to utop (fn CMD) (defalias 'utop-send-data #[257 "\302\303d\"\304\"\305!\210\211\211\203\"\211@\305\306\304Q!\210A\266\202\202\210\305\307!\207" [utop-prompt-max utop-input-prompt-max split-string buffer-substring-no-properties "\n" utop-send-string "data:" "end:\n"] 8 (#$ . 11444)]) #@51 Extract last inferred type from the uTop toplevel (defalias 'utop-last-type #[0 "rq\210\212 b\210\302y\210\303\304 \305 \"\306!\262*\207" [utop-buffer-name utop-prompt-min -1 buffer-substring-no-properties line-beginning-position line-end-position message] 3 (#$ . 11764)]) #@51 Find limits of an OCaml identifier (fn BACKWARD) (defalias 'utop-ident-looking #[257 "\212\300\301w\210\302`\301\2032`\262\204!\303\304!\210\305\306\"?\262\202\307\304!\210\212\310\306\302#)?\262\202\266\202)\207" [" \n " nil t right-word 1 looking-back "[ \n].*" left-word search-forward-regexp] 8 (#$ . 12047)]) #@21 Identifier at point (defalias 'utop-ident-at-point #[0 "\300\301!\300\302!\303\"\207" [utop-ident-looking t nil buffer-substring-no-properties] 5 (#$ . 12383)]) #@47 Find type of an identifier at point from uTop (defalias 'utop-type-at-point #[0 "\300\301 !\207" [utop-eval-string utop-ident-at-point] 2 (#$ . 12552)]) (defalias 'utop-cannot-edit #[0 "\301\302\303\267\202\304\202\305\202\306\202\307\202\310\202\311\"\207" [utop-state signal text-read-only #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (wait 8 done 12 comp 16 copy 20 hist 24)) "You cannot edit the buffer while ocaml is evaluating a phrase" "You cannot edit the buffer when ocaml is not running" "You cannot edit the buffer while waiting for completion" "You cannot edit the buffer while waiting for copy of last input" "You cannot edit the buffer while waiting for history" nil] 4]) #@19 (fn START STOP) (defalias 'utop-before-change #[514 "?\205& \303=\204\304\305\306\307\310$\210\311 \207\211\nW\205&\304\305\306\307\310$\210\312\313\314\"\207" [utop-inhibit-check utop-state utop-prompt-max edit add-hook post-command-hook utop-add-change nil t utop-cannot-edit signal text-read-only ("You cannot edit this part of the buffer")] 7 (#$ . 13297)]) (defalias 'utop-add-change #[0 "\300\301\302\303#\210\304\305\306\307\303$\207" [remove-hook post-command-hook utop-add-change t add-hook before-change-functions utop-before-change nil] 5]) (defalias 'utop-copy-old-input #[0 "rq\210 \303=\205\304\305!\210\306\307\310!)\207" [utop-buffer-name utop-state utop-pending-entry edit utop-set-state copy nil utop-send-data "history-prev:\n"] 2 nil nil]) #@30 The default prompt function. (defalias 'utop-default-prompt #[0 "\301\302\"\303\304G\305$\210\207" [utop-command-number format "utop[%d]> " add-text-properties 0 (face utop-prompt)] 6 (#$ . 14074)]) #@42 Go to the previous entry of the history. (defalias 'utop-history-goto-prev #[0 "rq\210 \303=\205\304\305!\210\306\307\310!)\207" [utop-buffer-name utop-state utop-pending-entry edit utop-set-state hist nil utop-send-data "history-prev:\n"] 2 (#$ . 14282) nil]) #@38 Go to the next entry of the history. (defalias 'utop-history-goto-next #[0 "rq\210 \303=\205\304\305!\210\306\307\310!)\207" [utop-buffer-name utop-state utop-pending-entry edit utop-set-state hist nil utop-send-data "history-next:\n"] 2 (#$ . 14553) nil]) #@35 Save history to the history file. (defalias 'utop-save-history #[0 "rq\210 \302=?\205\303\304!)\207" [utop-buffer-name utop-state done utop-send-string "save-history:\n"] 2 (#$ . 14820) nil]) #@72 Insert the given output before the prompt. (fn OUTPUT &optional FACE) (defalias 'utop-insert-output #[513 "d\212\305P\203\306\307G\310D$\210b\210\211c\210G\\ G\\\306e \n#\266) \311=\205>\312\f!\313\314\315#!\262\207" [utop-prompt-min utop-prompt-max utop-non-editable-properties utop-state utop-buffer-name "\n" add-text-properties 0 face wait get-buffer walk-windows make-closure #[257 "\302!\301=\205\303!\210`\300=\205db\207" [V0 V1 window-buffer select-window] 3 "\n\n(fn WINDOW)"]] 9 (#$ . 15021)]) #@39 Insert the given prompt. (fn PROMPT) (defalias 'utop-insert-prompt #[257 "db\210`\211c\210`\303e \n#\210\304\305!\210\306 \207" [utop-prompt-min utop-prompt-max utop-non-editable-properties add-text-properties utop-set-state edit utop-goto-point-max-all-windows] 5 (#$ . 15557)]) #@52 Insert the phrase terminator at the end of buffer. (defalias 'utop-insert-phrase-terminator #[0 "d GZ]\302\303\" \"\204\211T\262\202 Z\304Oc\207" [utop-prompt-max utop-phrase-terminator string-prefix-p buffer-substring-no-properties nil] 6 (#$ . 15846)]) #@56 Process one line from the utop sub-process. (fn LINE) (defalias 'utop-process-line #[257 "\306\307\"\210\310\311\"\310\312\"\313\267\202m\314\315\"\207\314\316\"\207\211\211\207 \317!\210\nT \205@db\210 c\210\320\321\320\322\320\f$\210\320\211\207db\210\323c\210\324 d\325#\210\326\327\322#\211\203w\330@!\330A@!\324d+\\^d+\\^\331#\210AA\266\203\202R\210\324ed,#\210d-d\211\207.\203\224 .\\b\210\323c\210\332\333!\207/\203\246/\323Q\211/\207\211\211/\2070\334=\203\272\335/!\210\202\305 b\210 d|\210/c\210\332\333!\207\332\333!\207\332\333!\210r1q\210\211c\210)\336 \207\320\2112\207\3372n3\211\205\211@\340\"\2032B2\341\337\322\"\210A\266\202\202\350\2620\207\332\333!\210\342 \20342\237!\210\202h2G\311V\203er1q\2105r\343\344!q\210p\345 \2105\320\21167\322\2118\3229:\346 \210\347\350!\210+\211;\3512\237!\210\352!\210)\266)\202h\336 \210\320\2112\207\320\207" [utop-phrase-terminator utop-prompt utop-command-number utop-initial-command utop-initial-mode utop-prompt-max string-match "\\`\\([a-z-]*\\):\\(.*\\)\\'" match-string 1 2 #s(hash-table size 13 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("stdout" 19 "stderr" 24 "phrase-terminator" 29 "prompt" 33 "accept" 65 "continue" 134 "history-data" 152 "history-end" 171 "history-bound" 201 "completion-word" 205 "completion-start" 221 "completion" 226 "completion-stop" 267)) utop-insert-output utop-stdout utop-stderr utop-insert-prompt nil utop-eval-input t "\n" add-text-properties (face utop-frozen) split-string "," string-to-number (face utop-error) utop-set-state edit copy kill-new minibuffer-hide-completions done string-prefix-p throw utop--supports-company get-buffer-create "*Completions*" kill-all-local-variables erase-buffer run-hooks temp-buffer-setup-hook display-completion-list internal-temp-output-buffer-show utop-input-prompt-max utop-non-editable-properties utop-prompt-min utop-pending-position utop-pending-entry utop-state utop-complete-buffer utop-completion utop-completion-prefixes utop--complete-k default-directory buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks inhibit-read-only standard-output] 12 (#$ . 16118)]) #@49 Process the output of utop (fn PROCESS OUTPUT) (defalias 'utop-process-output #[514 "rq\210\306\211 P\307 \310\"\211G\311Y\203I\211@\f\203$\312!\210\202B\313 \314\315\"\216\316\317\"\203:\320\321\"\202>\312!\210)\210\306A\266\202\202\211@\211\262+\207" [utop-buffer-name inhibit-read-only utop-inhibit-check utop-output utop--read-version utop-protocol-version t split-string "\n" 2 utop-process-line match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] string-match "protocol-version:\\([0-9]+\\)" match-string 1] 8 (#$ . 18359)]) #@496 Send the current input to the utop process and let ocaml evaluate it. If ALLOW-INCOMPLETE is non-nil and the phrase is not terminated, then a newline character will be inserted and edition will continue. If AUTO-END is non-nill then ALLOW-INCOMPLETE is ignored and a phrase terminator (;; or ; if using revised syntax) will be automatically inserted by utop. If ADD-TO-HISTORY is t then the input will be added to history. (fn &optional ALLOW-INCOMPLETE AUTO-END ADD-TO-HISTORY INPUT-MULTI) (defalias 'utop-eval-input #[1024 "rq\210 \304=\205Q\305\203\306 \210\202(\203(` Z\211\307W\203(d Z\310\311!\210\312\313=\2037\314\202P\203G\204G\203G\315\202P\203O\316\202P\317!)\207" [utop-buffer-name utop-state utop-pending-position utop-prompt-max edit nil utop-insert-phrase-terminator 0 utop-set-state wait utop-send-data :multi "input-multi:\n" "input:allow-incomplete,add-to-history\n" "input:add-to-history\n" "input:\n"] 8 (#$ . 18950) nil]) #@38 Same as (`utop-eval-input' t nil t). (defalias 'utop-eval-input-or-newline #[0 "\300\301\302\301#\207" [utop-eval-input t nil] 4 (#$ . 19928) nil]) #@38 Same as (`utop-eval-input' nil t t). (defalias 'utop-eval-input-auto-end #[0 "\300\301\302\211#\207" [utop-eval-input nil t] 4 (#$ . 20082) nil]) #@45 Send input to complete to utop. (fn INPUT) (defalias 'utop-complete-input #[257 "\301\302\"\303\304!\210\305\306 \203\307\202\310!\210\211\211\211\203,\211@\305\311\302Q!\210A\266\202\202\210\305\312!\207" [utop-completion-prefixes split-string "\n" utop-set-state comp utop-send-string utop--supports-company "complete-company:\n" "complete:\n" "data:" "end:\n"] 8 (#$ . 20234)]) #@25 Complete current input. (defalias 'utop-complete #[0 "\303=\205` Y\205p\304\305 `\"!\207" [utop-state utop-prompt-max utop-complete-buffer edit utop-complete-input buffer-substring-no-properties] 4 (#$ . 20633) nil]) #@30 Prepare utop for evaluation. (defalias 'utop-prepare-for-eval #[0 "\212\302!\211\203(\303!\210r\211q\210 \304=\203\305 \202$ \306=?\205$\307 )\202;\310 \210\311!\262\303!\210r\211q\210\312 )\262)\207" [utop-buffer-name utop-state get-buffer display-buffer done utop-restart edit utop-cannot-edit utop-query-arguments get-buffer-create utop-mode] 3 (#$ . 20862)]) #@30 (fn STRING &optional MODE) (defalias 'utop-eval-string #[513 "rq\210 \304\267\202!db\210c\210\305\306\307\306$\202\"\211\211\202\"\306)\207" [utop-buffer-name utop-state utop-initial-command utop-initial-mode #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (edit 10 wait 25)) utop-eval-input nil t] 7 (#$ . 21243)]) #@63 Eval the given region in utop. (fn START END &optional MODE) (defalias 'utop-eval #[770 "\300\301\"\"\207" [utop-eval-string buffer-substring-no-properties] 7 (#$ . 21613)]) #@50 Eval the current region in utop. (fn START END) (defalias 'utop-eval-region #[514 "\300 \210\301\302#\207" [utop-prepare-for-eval utop-eval :multi] 6 (#$ . 21797) "r"]) #@54 Eval the surrounding Caml phrase (or block) in utop. (defalias 'utop-eval-phrase #[0 "\303 \210\304\212 \3058\262\306@A@\"\266) \205\211b\210\n \207" [utop-discover-phrase utop-skip-after-eval-phrase utop-next-phrase-beginning utop-prepare-for-eval nil 2 utop-eval] 5 (#$ . 21975) nil]) #@26 Send the buffer to utop. (defalias 'utop-eval-buffer #[0 "\300 \210\301ed\302#\207" [utop-prepare-for-eval utop-eval :multi] 4 (#$ . 22276) nil]) #@38 Completion in a caml/tuareg/typerex. (defalias 'utop-edit-complete #[0 "\212` @\304\"p\305 !\211\204!\306 \210\307 !\262r\211q\210\310 \210)r\211q\210\n\311=\2050\312!)\262\266\204)\207" [utop-discover-phrase utop-buffer-name utop-state utop-complete-buffer buffer-substring-no-properties get-buffer utop-query-arguments get-buffer-create utop-mode edit utop-complete-input] 7 (#$ . 22428) nil]) #@58 Go to the beginning of line or to the end of the prompt. (defalias 'utop-bol #[0 "rq\210\303 U\203\nb\202\304\305!)\207" [utop-buffer-name utop-prompt-min utop-prompt-max point-at-bol move-beginning-of-line 1] 2 (#$ . 22840) nil]) #@17 Interrupt utop. (defalias 'utop-interrupt #[0 "rq\210\302 !)\207" [utop-buffer-name utop-process interrupt-process] 2 (#$ . 23083) nil]) #@12 Kill utop. (defalias 'utop-kill #[0 "rq\210\302 !)\207" [utop-buffer-name utop-process kill-process] 2 (#$ . 23227) nil]) #@134 Try to gracefully exit utop. EXIT-CODE is the exit code that shoud be returned by utop. It defaults to 0. (fn &optional EXIT-CODE) (defalias 'utop-exit #[256 "rq\210 \302=?\205\303\304\305\206\306\"!)\207" [utop-buffer-name utop-state done utop-send-string format "exit:%d\n" 0] 5 (#$ . 23357) nil]) #@55 Callback for process' state change. (fn PROCESS MSG) (defalias 'utop-sentinel #[514 "\305!\211\205Orq\210\306 !\211\307=\204\211\310=\205L\311\312!\210\313 !\314\211db\210\315\267\202A\316\317!\320\261\210\202A\321\317!\320\261\210db\210\322ed\f#*\262\262)\207" [utop-buffer-name utop-process inhibit-read-only utop-inhibit-check utop-non-editable-properties get-buffer process-status exit signal utop-set-state done process-exit-status t #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (exit 46 signal 57)) "\n\nProcess utop exited with code " number-to-string "\n" "\n\nProcess utop has been killed by signal " add-text-properties] 9 (#$ . 23671)]) #@61 Return the list of all findlib packages with their version. (defalias 'utop-ocamlfind-list-packages #[0 "\300\301\302!\303\"\304C\305\306\307\"\"\210\211\242\237\207" [split-string shell-command-to-string "ocamlfind list" "[ ]* ?\n" nil mapc make-closure #[257 "\301\302\"\205\300\303\304\"\303\305\"B\300\242B\240\207" [V0 string-match "\\([^ (]*\\)[ ]*(version:[ ]*\\([^)]*\\))" match-string 1 2] 6 "\n\n(fn LINE)"]] 6 (#$ . 24383)]) (defvar utop-list-packages-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [utop-list-packages-mode-hook variable-documentation put "Hook run after entering OCaml package list mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp utop-list-packages-mode-map definition-name utop-list-packages-mode] 4) (defvar utop-list-packages-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" [utop-list-packages-mode-abbrev-table utop-list-packages-mode-map variable-documentation put purecopy "Keymap for `utop-list-packages-mode'." boundp utop-list-packages-mode-syntax-table definition-name utop-list-packages-mode (lambda (def-tmp-var) (defvar utop-list-packages-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `utop-list-packages-mode'." (lambda (def-tmp-var) (defvar utop-list-packages-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `utop-list-packages-mode'." derived-mode-parent tabulated-list-mode] 5) #@276 Major mode for listing the findlib OCaml packages. In addition to any hooks its parent mode `tabulated-list-mode' might have run, this mode runs the hook `utop-list-packages-mode-hook', as the final or penultimate step during initialization. \{utop-list-packages-mode-map} (defalias 'utop-list-packages-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 #\331$\332C%\333&\334\335\336\337\307$\210\340 \210)\341\342!\207" [delay-mode-hooks major-mode mode-name utop-list-packages-mode-map utop-list-packages-mode-syntax-table utop-list-packages-mode-abbrev-table make-local-variable t tabulated-list-mode utop-list-packages-mode "OCaml package list" 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 [("Name" 32 t) ("Version" 32 t)] "Name" utop-package-printer add-hook tabulated-list-revert-hook utop-list-packages--refresh nil tabulated-list-init-header run-mode-hooks utop-list-packages-mode-hook local-abbrev-table tabulated-list-format tabulated-list-sort-key tabulated-list-printer] 5 (#$ . 26184) nil]) #@39 Refresh the list of findlib packages. (defalias 'utop-list-packages--refresh #[0 "\302\303 \304C\305\306\307\"\"\210\211\242\310]T\240\210 \304\234\242\311D\241\210\211\203=\211@\211\211@A\312\"DB\266A\266\202\202 \266\237\211\207" [tabulated-list-entries tabulated-list-format nil utop-ocamlfind-list-packages 0 mapc make-closure #[257 "\300\211\242@G]\240\207" [V0] 4 "\n\n(fn PACKAGE)"] 16 t vector] 11 (#$ . 27554) nil]) #@48 Print one findlib package entry. (fn ID COLS) (defalias 'utop-package-printer #[514 "\301\234A@\302\301\234\303\304\305\306%\210\307\310\301\234GZ\"\210\311\234\312\261\207" [tabulated-list-format 0 insert-text-button follow-link t action utop-require-package-button-action insert-char 32 1 "\n"] 9 (#$ . 28005)]) #@16 (fn PACKAGE) (defalias 'utop-load-package #[257 "\204 \301\302\303\"!\205\304\302\305\"!\207" [utop-load-packages-without-asking y-or-n-p format "Load package `%s'? " utop-send-command "require:%s\n"] 5 (#$ . 28332)]) #@15 (fn BUTTON) (defalias 'utop-require-package-button-action #[257 "\300\301!!\207" [utop-load-package button-label] 4 (#$ . 28564)]) #@69 Display a list of all ocaml findlib packages (fn &optional BUFFER) (defalias 'utop-list-ocaml-packages #[256 "\300!\204 \301\302!\262r\211q\210\303 \210\304 \210\305\306!\210\307!)\207" [bufferp get-buffer-create "*Findlib packages*" utop-list-packages-mode utop-list-packages--refresh tabulated-list-print t display-buffer] 3 (#$ . 28704) nil]) #@67 Load packages defined in utop-package-list buffer local variable. (defalias 'utop-query-load-package-list #[0 "\205\301\302!\205r\303 q\210)\304\305\"\210\306\307!\207" [utop-package-list y-or-n-p "You've defined utop-package-list variable, but uTop toplevel is not running, would you like me to start the toplevel?" utop mapc utop-load-package message "uTop: OCaml packages loaded by file local variables"] 3 (#$ . 29061)]) #@44 Perform actions defined by local variables (defalias 'utop-hack-local-variables #[0 "\300 \207" [utop-query-load-package-list] 1 (#$ . 29498)]) (defalias 'utop-is-running #[0 "\302!\211\205r\211q\210 \205\303 !\304=)\207" [utop-buffer-name utop-process get-buffer process-status run] 3]) (defalias 'utop-about #[0 "\300\301!\207" [describe-variable utop-license] 2 nil nil]) (defalias 'utop-help #[0 "\300\301!\207" [describe-function utop] 2 nil nil]) #@12 utop menu. (defvar utop-menu nil (#$ . 29962)) (easy-menu-do-define 'utop-menu utop-mode-map "utop menu." '("utop" ["Start OCaml" utop t] ["Interrupt OCaml" utop-interrupt :active (utop-is-running)] ["Kill OCaml" utop-kill :active (utop-is-running)] ["Exit utop gracefully" utop-exit :active (utop-is-running)] ["Evaluate Phrase" utop-eval-input-auto-end :active (and (utop-is-running) (eq utop-state 'edit))] "---" ["Customize utop" (customize-group 'utop) t] "---" ["About" utop-about t] ["Help" utop-help t])) #@56 Get argument list from the given command line of utop. (defalias 'utop-arguments #[0 "\301!\211\204 \302\303!\210\207" [utop-command split-string-and-unquote error "The utop command line is empty"] 3 (#$ . 30481)]) #@50 Return the arguments of the utop command to run. (defalias 'utop-query-arguments #[0 "\203 \302\303 \"\304 \207" [utop-edit-command utop-command read-shell-command "utop command line: " utop-arguments] 3 (#$ . 30704)]) #@45 Start utop given ARGUMENTS. (fn ARGUMENTS) (defalias 'utop-start #[257 "ddd\306\307\310\311\312\313\314p@A%\315\316!\210\317\320\"\210\321\322\"\207" [utop-prompt-min utop-prompt-max utop-input-prompt-max utop-output utop-command-number utop-completion "" 0 nil done apply start-process "utop" utop-set-state wait set-process-filter utop-process-output set-process-sentinel utop-sentinel utop-state utop-process] 7 (#$ . 30932)]) #@15 Restart utop. (defalias 'utop-restart #[0 "\300 db\210\301\302!\210\303!\207" [utop-query-arguments utop-insert "\nRestarting...\n\n" utop-start] 3 (#$ . 31385)]) #@12 Deprecated (defalias 'utop-setup-ocaml-buffer #[0 "\300\301!\207" [error "`utop-setup-ocaml-buffer' is deprecated, you need to\nreplace it by `utop-minor-mode'.\n\nSee https://github.com/diml/utop for configuration information."] 2 (#$ . 31555)]) #@99 Non-nil if utop minor mode is enabled. Use the command `utop-minor-mode' to change this variable. (defvar utop-minor-mode nil (#$ . 31808)) (make-variable-buffer-local 'utop-minor-mode) #@576 Minor mode for utop. This is a minor mode. If called interactively, toggle the `utop minor mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `utop-minor-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'utop-minor-mode #[256 "\302 \303=\203 ?\202\247\203\304W\203\305\202\306\307\301!\2031\310\300 \"\2031\300 B\311\312\313\"\210\314\315\203@\316\202A\317\"\210\320\321!\203c\302 \203U\211\302 \232\203c\322\323\203_\324\202`\325\326#\210\210\327 \210\207" [utop-minor-mode local-minor-modes current-message toggle 1 nil t boundp delq add-hook hack-local-variables-hook utop-hack-local-variables run-hooks utop-minor-mode-hook utop-minor-mode-on-hook utop-minor-mode-off-hook called-interactively-p any message "utop minor mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 6 (#$ . 32001) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar utop-minor-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\302\300\304\305#\210\302\300\306\307C#\207" [utop-minor-mode-hook variable-documentation put "Hook run after entering or leaving `utop-minor-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil] 4) #@31 Keymap for `utop-minor-mode'. (defvar utop-minor-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\211\262\314!\203*\207\211<\2033\315!\207\316\317\"\207" [make-sparse-keymap define-key "" utop "" utop-eval-phrase "" utop-eval-region "" utop-eval-buffer " " utop-kill keymapp easy-mmode-define-keymap error "Invalid keymap %S"] 5) (#$ . 33726)) (byte-code "\301\302\303\304\211%\207" [utop-minor-mode-map add-minor-mode utop-minor-mode " utop" nil] 6) (defvar utop-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [utop-mode-hook variable-documentation put "Hook run after entering utop mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp utop-mode-map definition-name utop-mode] 4) (defvar utop-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\317#\207" [utop-mode-abbrev-table utop-mode-map variable-documentation put purecopy "Keymap for `utop-mode'." boundp utop-mode-syntax-table definition-name utop-mode (lambda (def-tmp-var) (defvar utop-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `utop-mode'." (lambda (def-tmp-var) (defvar utop-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `utop-mode'." derived-mode-parent] 5) #@147 Set the buffer mode to utop. This mode runs the hook `utop-mode-hook', as the final or penultimate step during initialization. \{utop-mode-map} (defalias 'utop-mode #[0 "\306\300!\210\307\310 \210\311\312\313 !\210\314\f!\210 .\306\315!\210\306\316!\210\306\317!\210\306\320!\210\306\321!\210\306\322!\210\306\323!\210\306\324!\210\306\325!\210\306\326!\210\306\327!\210\306\330!\210\306\331!\210\306\332!\210\306\333!\210\306\334!\210\306\335!\210\306\336!\210\337\340\341\342\307$\210\337\343\344\307\211$\210\337\345\346\342\307$\210\347\350\351\"\210\352\353 !\210)\354\355!\207" [delay-mode-hooks major-mode mode-name utop-mode-map utop-mode-syntax-table utop-mode-abbrev-table make-local-variable t kill-all-local-variables utop-mode "utop" use-local-map set-syntax-table utop-process utop-prompt-min utop-prompt-max utop-input-prompt-max utop-last-prompt utop-output utop-command-number utop-inhibit-check utop-state utop-complete-buffer utop-initial-command utop-initial-mode utop-phrase-terminator utop-pending-position utop-pending-entry utop-protocol-version utop--complete-k utop--read-version add-hook before-change-functions utop-before-change nil kill-buffer-hook #[0 "\300\301!\207" [run-hooks utop-exit-hook] 2] kill-buffer-query-functions #[0 "\300 \210\301\207" [utop-save-history t] 1] eval-after-load company #[0 "\301>\203\207\301B\211\207" [company-backends utop-company-backend] 2] utop-start utop-arguments run-mode-hooks utop-mode-hook local-abbrev-table] 5 (#$ . 35385) nil]) #@364 A universal toplevel for OCaml. url: https://forge.ocamlcore.org/projects/utop/ utop is a enhanced toplevel for OCaml with many features, including context sensitive completion. This is the emacs frontend for utop. You can use the utop buffer as a standard OCaml toplevel. To complete an identifier, simply press TAB. Special keys for utop: \{utop-mode-map} (defalias 'utop #[0 "\303!\211\203\304!\210 \305=\203-\306 \210\207\307 \210\310!\262\n\304!\210\211rq\210\311 \210)\210\207" [utop-buffer-name utop-state utop-command get-buffer pop-to-buffer done utop-restart utop-query-arguments get-buffer-create utop-mode] 4 (#$ . 36907) nil]) #@80 company backend for utop completions (fn COMMAND &optional ARG &rest IGNORED) (defalias 'utop-company-backend #[641 "\300\267\202\301\302!\207\303\207\304\305!\205 \306\307\310\"\206\311\207\312\313B\207\314\207" [#s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (interactive 6 sorted 10 prefix 12 candidates 27)) company-begin-backend utop-company-backend t derived-mode-p utop-mode company-grab-symbol-cons "\\." 1 stop :async #[257 "\211\301\302!\207" [utop--complete-k call-interactively utop-complete] 3 "\n\n(fn K)"] nil] 6 (#$ . 37568) (byte-code "\300C\207" [interactive] 1)]) (byte-code "\300\301!\210\300\302!\207" [provide utop-minor-mode utop] 2)