;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require comint caml] 2) #@73 *If true, display the inferior caml buffer when evaluating expressions. (defvar caml-display-when-eval t (#$ . -152)) (defvar inferior-caml-mode-map nil) (byte-code "\204\302 !\302\207" [inferior-caml-mode-map comint-mode-map copy-keymap] 2) #@58 *Program name for invoking an inferior OCaml from Emacs. (defvar inferior-caml-program "ocaml" (#$ . -404)) #@266 Major mode for interacting with an inferior OCaml process. Runs an OCaml toplevel as a subprocess of Emacs, with I/O through an Emacs buffer. A history of input phrases is maintained. Phrases can be sent from another buffer in Caml mode. \{inferior-caml-mode-map} (defalias 'inferior-caml-mode #[nil "\306 \210\307\310\311\312\304!\210\313 P\312\305!\210\f\312\314!\210\315\f\312\316!\210\315\312\317!\210\320\312\321!\210\322\312\323!\210\324\312\325!\210\326\312\327!\210\330\331!\210\332\333!\207" [comint-prompt-regexp major-mode mode-name page-delimiter paragraph-start paragraph-separate comint-mode "^# ?" inferior-caml-mode "Inferior Caml" make-local-variable "^$\\|" paragraph-ignore-fill-prefix t require-final-newline comment-start "(*" comment-end "*)" comment-column 40 comment-start-skip "(\\*+ *" parse-sexp-ignore-comments nil use-local-map run-hooks inferior-caml-mode-hooks inferior-caml-mode-map] 2 (#$ . 519) nil]) (defconst inferior-caml-buffer-subname "inferior-caml") (defconst inferior-caml-buffer-name (concat #1="*" inferior-caml-buffer-subname #1#)) (defalias 'caml-sit-for #[(second &optional mili redisplay) "\304\300!\203\203\305 \203\n \306_\\\202\n \"\207\305\n #\207" [running-xemacs mili second redisplay boundp sit-for 0.001] 4]) (defvar inferior-caml-output nil) (defalias 'inferior-caml-signal-output #[(s) "\302\303\"\205\n\304\211\207" [s inferior-caml-output string-match "[^ ]" t] 3]) (defalias 'inferior-caml-mode-output-hook #[nil "\300\301\302C\303#\207" [set-variable comint-output-filter-functions inferior-caml-signal-output t] 4]) (add-hook 'inferior-caml-mode-hooks 'inferior-caml-mode-output-hook) (defalias 'caml-run-process-if-needed #[(&optional cmd) "\306!?\205: \204\306!\203\n\202\307\310\n\" \311 !\312\313\314 \f@\312\fA%q\210\315 \210\316!\210*\317\211\207" [inferior-caml-buffer-name cmd inferior-caml-program process-connection-type cmdlist inferior-caml-buffer-subname comint-check-proc read-from-minibuffer "OCaml toplevel to run: " inferior-caml-args-to-list nil apply make-comint inferior-caml-mode display-buffer t caml-shell-active] 6]) #@79 Run an inferior OCaml process. Input and output via buffer `*inferior-caml*'. (defalias 'run-caml #[(&optional cmd) "\302!\210\303 !\207" [cmd inferior-caml-buffer-name caml-run-process-if-needed switch-to-buffer-other-window] 2 (#$ . 2680) (list (if (not (comint-check-proc inferior-caml-buffer-name)) (read-from-minibuffer "OCaml toplevel to run: " inferior-caml-program)))]) (defalias 'inferior-caml-args-to-list #[(string) "\303\304\"\211\204C\2025 \305U\204$\305 O\306 TGO!B\2025\303\307\"\211\2054\306\nGO!))\207" [string where pos string-match "[ ]" 0 inferior-caml-args-to-list "[^ ]"] 6]) (defalias 'inferior-caml-show-subshell #[nil "\304 \210\305!\210p\306!\307 \310W\203'\311p!\232\204'\312 \210 T\211\202\311p!\232\2032db\210 \307V\205B\313 \210 S\211\2023+\207" [inferior-caml-buffer-name count caml-buf buf caml-run-process-if-needed display-buffer get-buffer 0 10 buffer-name next-multiframe-window previous-multiframe-window] 4 nil nil]) #@56 Send the current region to the inferior OCaml process. (defalias 'inferior-caml-eval-region #[(start end) "\212\304 \210)\212b\210\305 \210\306 \n`#\210`\307Y\203)\310u\210\311\312!\203)\313 \314\"\210\202.\313 \315\"\210 \2056\316 \317\")\207" [end inferior-caml-buffer-name start caml-display-when-eval caml-run-process-if-needed caml-skip-comments-backward comint-send-region 2 -2 looking-at ";;" comint-send-string "\n" ";;\n" display-buffer t] 4 (#$ . 3676) "r"]) #@75 Jump to the location of the last error as indicated by inferior toplevel. (defalias 'inferior-caml-goto-error #[(start end) "\212\304 !q\210\305\n\306P!\210\307\310\311!!)\\\211b)\207" [start inferior-caml-buffer-name comint-prompt-regexp loc get-buffer re-search-backward "[ ]*Characters[ ]+\\([0-9]+\\)-[0-9]+:$" caml-string-to-int match-string 1] 5 (#$ . 4156) "r"]) #@244 Send the phrase containing the point to the CAML process. With prefix-arg send as many phrases as its numeric value, ignoring possible errors during evaluation. Optional arguments min max defines a region within which the phrase should lies. (defalias 'inferior-caml-just-eval-phrase #[(arg &optional min max) "\304 \305V\203 S\306\n \"\307`\"\210\202)\207" [beg arg min max nil 0 caml-find-phrase caml-eval-region] 3 (#$ . 4537) "p"]) #@118 Tells the beginning of output in the shell-output buffer, so that the output can be retrieved later, asynchronously. (defvar caml-previous-output nil (#$ . 4990)) #@505 Send the phrase containing the point to the CAML process. With prefix-arg send as many phrases as its numeric value, If an error occurs during evaluation, stop at this phrase and report the error. Return nil if noerror and position of error if any. If arg's numeric value is zero or negative, evaluate the current phrase or as many as prefix arg, ignoring evaluation errors. This allows to jump other erroneous phrases. Optional arguments min max defines a region within which the phrase should lies. (defalias 'inferior-caml-eval-phrase #[(arg &optional min max) "\212\306 )\203\307\310\311\312\"\210 \312W\203\313\312\314 Z]\n #\207\315\f!p\307\211\211\211\211,-./01\316 2\317\216 \314V\203- \204-\320\3211!!\211/3\307\313\312\n #.\310 \210\322\f\307\"\210/b\210\323\324d\325#\203\234\326\327\312!!-\326\327\330!!,\3220!\210.b\210\331,!\210`,.b\210\331-!\210`\211-\202&\332\333!\203\355\327\312!\334\225\334\224Z\330\225\334\225Z456\335\3366\"\203\3066\312\224\312\225O6\3220!\210\337\340\3416!\342Q.\311Z\"\210\314\2245\\b\210`4\\,+-\202&\332\343!\203!\327\312!7\327\334!8\3417!\344\3418!Q6\3220!\210\3376.\345#\210\314\225,+-\202&\3220!\210 S\211\202;\346\f!\210 \203;db\210\202B/b\210db\210\3460!\210* \203X\347 \210\350`,\"\210\202g\203c\351\352!\210\202g\351\353!\210 .\207" [inferior-caml-output arg min max inferior-caml-buffer-name err caml-run-process-if-needed nil caml-wait-output 10 1 inferior-caml-just-eval-phrase 0 get-buffer-process current-window-configuration #[nil "\301!\207" [#1=#:wconfig set-window-configuration] 2] marker-position process-mark switch-to-buffer re-search-forward " *Characters \\([01-9][01-9]*\\)-\\([1-9][01-9]*\\):\n[^W]" t caml-string-to-int caml-match-string 2 forward-byte looking-at "Toplevel input:\n[>]\\([^\n]*\\)\n[>]\\(\\( *\\)^*\\)\n" 3 string-match "^\\(.*\\)[<]EOF[>]$" re-search-backward "^" regexp-quote "$" "Toplevel input:\n>[.]*\\([^.].*\n\\)\\([>].*\n\\)*[>]\\(.*[^.]\\)[.]*\n" "\\(.*\n\\)*" move pop-to-buffer beep caml-overlay-region message "No error" "No output yet..." end beg orig previous-output buf proc #1# caml-previous-output width column expr e1 e2] 8 (#$ . 5160) "p"]) (defalias 'caml-overlay-region #[(beg end &optional wait) "\304\305!\205.\204\305\306\211\"\307\310\311#\210\312\216\313 \np$\210\314 \210 \203*\315 \202-\316\317!)\207" [caml-error-overlay beg end wait fboundp make-overlay 1 overlay-put face region #[nil "\301!\207" [caml-error-overlay delete-overlay] 2] move-overlay beep read-event caml-sit-for 60] 5 nil "%r"]) (defalias 'caml-wait-output #[(&optional before after) "\304\305\306 \206 \304\"\210\304\n\204%\307W\203%\305\306\310#\203%T\202 )\305 \206,\306\304\")\207" [c before inferior-caml-output after 1 caml-sit-for 0 99 t] 4]) #@56 Insert the result of the evaluation of previous phrase (defalias 'caml-insert-last-output #[nil "\303\304!!\305\n \306Z#)\207" [inferior-caml-buffer-name pos caml-previous-output process-mark get-buffer-process insert-buffer-substring 2] 5 (#$ . 8000) nil]) (provide 'inf-caml)