;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (defvar tuareg-opam-mode-hook nil) #@36 The default amount of indentation. (defvar tuareg-opam-indent-basic 2 (#$ . 122)) #@39 It t, use flymake to lint OPAM files. (defvar tuareg-opam-flymake nil (#$ . 210)) #@29 Keymap for tuareg-opam mode (defvar tuareg-opam-mode-map (byte-code "\300 \301\302\303#\210\207" [make-keymap define-key "\n" newline-and-indent] 5) (#$ . 298)) (custom-declare-group 'tuareg-opam nil "Support for the OPAM files." :group 'languages) #@59 The list of OPAM directories for the installed compilers. (defconst tuareg-opam-compilers (byte-code "\300\301!\205\302\301\303\304#\300\305!\203\305B\202\211\262\207" [file-directory-p "~/.opam" directory-files t "[0-9]+\\.[0-9]+\\.[0-9]+" "~/.opam/system"] 4) (#$ . 554)) #@69 The full path of the opam executable or `nil' if opam wasn't found. (defvar tuareg-opam (byte-code "\301\302!\211\203\207\303\304\"\211\205\305!\205\211\207" [tuareg-opam-compilers executable-find "opam" locate-file "bin/opam" file-executable-p] 4) (#$ . 842)) (custom-declare-face 'tuareg-opam-error-face '((t (:inherit error))) "Face for constructs considered as errors (e.g. deprecated constructs)." :group 'tuareg-opam) #@72 Face for constructs considered as errors (e.g. deprecated constructs). (defvar tuareg-opam-error-face 'tuareg-opam-error-face (#$ . 1280)) (custom-declare-face 'tuareg-opam-pkg-variable-name-face '((t (:inherit font-lock-variable-name-face :slant italic))) "Face for package specific variables." :group 'tuareg-opam) #@38 Face for package specific variables. (defvar tuareg-opam-pkg-variable-name-face 'tuareg-opam-pkg-variable-name-face (#$ . 1603)) #@24 Kewords in OPAM files. (defconst tuareg-opam-keywords '("opam-version" "name" "version" "maintainer" "authors" "license" "homepage" "doc" "bug-reports" "dev-repo" "tags" "patches" "substs" "build" "install" "run-test" "remove" "depends" "depopts" "conflicts" "conflict-class" "depexts" "messages" "post-messages" "available" "flags" "features" "synopsis" "description" "url" "setenv" "build-env" "extra-files" "pin-depends") (#$ . 1738)) (defconst tuareg-opam-keywords-regex (regexp-opt tuareg-opam-keywords 'symbols)) #@29 Variables declared in OPAM. (defconst tuareg-opam-variables-regex "\\_<\\(arch\\|bin\\|doc\\|etc\\|group\\|jobs\\|lib\\|ma\\(?:ke\\|n\\)\\|name\\|o\\(?:pam-version\\|s\\(?:-\\(?:distribution\\|family\\|version\\)\\)?\\)\\|p\\(?:inned\\|refix\\)\\|root\\|s\\(?:bin\\|hare\\|tublibs\\|witch\\)\\|toplevel\\|user\\|version\\)\\_>" (#$ . 2263)) #@28 Package variables in OPAM. (defconst tuareg-opam-pkg-variables-regex "\\_<\\(b\\(?:in\\|uild\\(?:-id\\)?\\)\\|d\\(?:e\\(?:pends\\|v\\)\\|oc\\)\\|e\\(?:nable\\|tc\\)\\|hash\\|installed\\|lib\\|man\\|name\\|pinned\\|s\\(?:bin\\|hare\\)\\|version\\)\\_>" (#$ . 2610)) #@16 Package scopes (defconst tuareg-opam-scopes-regex "\\_<\\(build\\|false\\|pinned\\|true\\|with-\\(?:doc\\|test\\)\\)\\_>" (#$ . 2881)) (defconst tuareg-opam-deprecated-regex "\\_<\\(build-\\(?:doc\\|test\\)\\)\\_>") #@29 Highlighting for OPAM files (defvar tuareg-opam-font-lock-keywords (byte-code "\305B\306 \307Q\310B\311\312\313B\n\314B \315B\316 \317Q\320B\321\f\317Q\322B\323\324B\325\fP\326B\327BBBBBBBBBB\207" [tuareg-opam-deprecated-regex tuareg-opam-keywords-regex tuareg-opam-scopes-regex tuareg-opam-variables-regex tuareg-opam-pkg-variables-regex tuareg-opam-error-face "^" ":" (1 font-lock-keyword-face) ("^\\(extra-source\\)\\_>" 1 font-lock-keyword-face) "^\\(x-[[:alnum:]]+\\):" (1 font-lock-keyword-face) font-lock-constant-face font-lock-variable-name-face "%{" "\\(?:}%\\|?\\)" ((1 font-lock-variable-name-face t)) "%{\\([a-zA-Z_][a-zA-Z0-9_+-]*\\):" ((1 font-lock-type-face t) (2 font-lock-variable-name-face t t)) "%{\\([a-zA-Z_][a-zA-Z0-9_+-]*\\):\\([a-zA-Z][a-zA-Z0-9_+-]*\\)\\(?:}%\\|?\\)" ((1 font-lock-type-face t) (2 tuareg-opam-pkg-variable-name-face t t)) "\\_<\\([a-zA-Z_][a-zA-Z0-9_+-]*\\):" ((1 font-lock-type-face) (2 font-lock-variable-name-face)) (("\\_<\\([a-zA-Z_][a-zA-Z0-9_+-]*\\):\\([a-zA-Z][a-zA-Z0-9_+-]*\\)\\_>" (1 font-lock-type-face) (2 tuareg-opam-pkg-variable-name-face)))] 11) (#$ . 3103)) #@100 Alist of symbol prettifications for OPAM files. See `prettify-symbols-alist' for more information. (defvar tuareg-opam-prettify-symbols (byte-code "\300\301\302\303\"B\304\301\302\305\"B\306\301\302\307\"B\310\301\302\311\"B\312\301\302\313\"B\257\207" ["&" decode-char ucs 8743 "|" 8744 "<=" 8804 ">=" 8805 "!=" 8800] 8) (#$ . 4229)) #@27 Tuareg-opam syntax table. (defvar tuareg-opam-mode-syntax-table (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\207" [make-syntax-table modify-syntax-entry 35 "< b" 10 "> b" 40 "()" 41 ")(" 123 "(}" 125 "){" 91 "(]" 93 ")["] 5) (#$ . 4571)) (require 'smie) (defvar tuareg-opam-smie-grammar (byte-code "\301\302\303\304\"B\305B!\306\307\310\"!\207" [tuareg-opam-keywords #[257 "\300\301BB\207" [decls (":" list)] 4 "\n\n(fn KW)"] smie-bnf->prec2 decls mapcar ((list ("[" list "]") (value)) (value (string "{" filter "}") (string)) (string) (filter)) smie-prec2->grammar smie-merge-prec2s #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ((#1="&" . #1#) < (#1# . #8="|") < (#1# . #2="=") < (#2# . #1#) > (#1# . #3="!=") < (#3# . #1#) > (#1# . #4=">") < (#4# . #1#) > (#1# . #5=">=") < (#5# . #1#) > (#1# . #6="<") < (#6# . #1#) > (#1# . #7="<=") < (#7# . #1#) > (#8# . #1#) < (#8# . #8#) < (#8# . #2#) < (#2# . #8#) > (#8# . #3#) < (#3# . #8#) > (#8# . #4#) < (#4# . #8#) > (#8# . #5#) < (#5# . #8#) > (#8# . #6#) < (#6# . #8#) > (#8# . #7#) < (#7# . #8#) > (#2# . #2#) > (#2# . #3#) > (#2# . #4#) > (#2# . #5#) > (#2# . #6#) > (#2# . #7#) > (#3# . #2#) > (#3# . #3#) > (#3# . #4#) > (#3# . #5#) > (#3# . #6#) > (#3# . #7#) > (#4# . #2#) > (#4# . #3#) > (#4# . #4#) > (#4# . #5#) > (#4# . #6#) > (#4# . #7#) > (#5# . #2#) > (#5# . #3#) > (#5# . #4#) > (#5# . #5#) > (#5# . #6#) > (#5# . #7#) > (#6# . #2#) > (#6# . #3#) > (#6# . #4#) > (#6# . #5#) > (#6# . #6#) > (#6# . #7#) > (#7# . #2#) > (#7# . #3#) > (#7# . #4#) > (#7# . #5#) > (#7# . #6#) > (#7# . #7#) >))] 6)) #@19 (fn KIND TOKEN) (defalias 'tuareg-opam-smie-rules #[514 "\302=\203\211\235\203\303\207\302=\203!\211\304\232\203!\305 \203!\303\207\302=\203/\211\306\232\203/\303\207 \207" [tuareg-opam-keywords tuareg-opam-indent-basic :before 0 "[" smie-rule-hanging-p "{"] 4 (#$ . 6291)]) #@58 Emit context information about the current syntax state. (defvar tuareg-opam-smie-verbose-p t (#$ . 6587)) #@34 (fn MESSAGE &rest FORMAT-ARGS) (defalias 'tuareg-opam-smie-debug '(macro . #[385 "\300\301\302\303\304BBDE\305BB\207" [progn when tuareg-opam-smie-verbose-p message format (nil)] 9 (#$ . 6700)])) #@19 (fn KIND TOKEN) (defalias 'verbose-tuareg-opam-smie-rules #[514 "\302\"\203C\303\304\305\3061\307 0\202\210\310\3111\" 0\202$\210\310\3121/\313\314!0\2021\210\310\3151;\316 0\202=\210\310 &!\210\207" [tuareg-opam-smie-verbose-p smie--parent tuareg-opam-smie-rules message format "%s '%s'; sibling-p:%s parent:%s prev-is-[:%s hanging:%s = %s" (error) smie-rule-sibling-p nil (error) (error) smie-rule-prev-p "[" (error) smie-rule-hanging-p] 13 (#$ . 6908)]) (byte-code "\300\301!\210\302\303\304\305!\203\305\202\306\"\210\302\307\304\310!\203\310\202 \311\"\207" [require flymake defalias tuareg-opam--flymake-proc-init-create-temp-buffer-copy functionp flymake-proc-init-create-temp-buffer-copy flymake-init-create-temp-buffer-copy tuareg-opam--proc-create-temp-inplace flymake-proc-create-temp-inplace flymake-create-temp-inplace] 4) (defalias 'tuareg-opam-flymake-init #[0 "\300\301!\302\303DD\207" [tuareg-opam--flymake-proc-init-create-temp-buffer-copy tuareg-opam--proc-create-temp-inplace "opam" "lint"] 4]) (byte-code "\300\301\302\303!\203\f\303\202 \304\"\207" [defvaralias tuareg-opam--flymake-proc-allowed-file-name-masks boundp flymake-proc-allowed-file-name-masks flymake-allowed-file-name-masks] 4) #@71 Flymake entry for OPAM files. See `flymake-allowed-file-name-masks'. (defvar tuareg-opam--allowed-file-name-masks '("[./]opam_?\\'" tuareg-opam-flymake-init) (#$ . 8158)) (byte-code "\300\301\302\303!\203\f\303\202 \304\"\207" [defvaralias tuareg-opam--flymake-proc-err-line-patterns boundp flymake-proc-err-line-patterns flymake-err-line-patterns] 4) #@59 Value of `flymake-proc-err-line-patterns' for OPAM files. (defvar tuareg-opam--err-line-patterns '(("File \"\\([^\"]+\\)\", line \\([0-9]+\\), characters \\([0-9]+\\)-\\([0-9]+\\): +\\([^\n]*\\)$" 1 2 3 5)) (#$ . 8519)) (put 'tuareg-opam-insert-opam-form 'no-self-insert t) #@556 Insert a minimal opam file. This is a skeleton command (see `skeleton-insert'). Normally the skeleton text is inserted at point, with nothing "inside". If there is a highlighted region, the skeleton text is wrapped around the region text. A prefix argument ARG says to wrap the skeleton around the next ARG words. A prefix argument of -1 says to wrap around region, even if not highlighted. A prefix argument of zero says to wrap around zero words---that is, nothing. This is a way of overriding the use of a highlighted region. (fn &optional STR ARG) (defalias 'tuareg-opam-insert-opam-form #[512 "\304 \305\211\305C\306\307#\216\310!\210\311\312#\313\240\210,\207" [most-positive-fixnum undo-strong-limit undo-limit undo-outer-limit prepare-change-group nil make-closure #[0 "\301\242\203 \302\300!\207\303\300!\207" [V0 V1 accept-change-group cancel-change-group] 2] activate-change-group skeleton-proxy-new (nil "opam-version: \"2.0\"" > n "maintainer: \"" _ "\"" > n "authors: [" _ "]" > n "tags: [" _ "]" > n "license: \"" _ "\"" > n "homepage: \"" _ "\"" > n "dev-repo: \"" _ "\"" > n "bug-reports: \"" _ "\"" > n "doc: \"" _ "\"" > n "build: [" > n "[\"dune\" \"subst\" ] {pinned}" > n "[\"dune\" \"build\" \"-p\" name \"-j\" jobs]" > n "[\"dune\" \"build\" \"-p\" name \"-j\" jobs \"@doc\"] {with-doc}" > n "[\"dune\" \"runtest\" \"-p\" name \"-j\" jobs] {with-test}" > n "]" > n "depends: [" > n "\"ocaml\" {>= \"4.02\"}" > n "\"dune\"" > n "]" > n "synopsis: \"\"" > n "description: \"\"\"" > n "\"\"\"" > 10) t] 11 (#$ . 8800) "*P\nP"]) #@34 Keymap used in Tuareg-opam mode. (defvar tuareg-opam-mode-map (byte-code "\300 \301\302\303#\210\207" [make-sparse-keymap define-key ".o" tuareg-opam-insert-opam-form] 5) (#$ . 10375)) (defalias 'tuareg-opam-build-menu #[0 "\302\303!\210\304\301C\305\306$\210\307 !\207" [tuareg-opam-mode-map tuareg-opam-mode-menu (lambda (#1=#:def-tmp-var) (defvar tuareg-opam-mode-menu #1# #2="Tuareg-opam mode menu.")) nil easy-menu-do-define #2# ("OPAM" ["Skeleton" tuareg-opam-insert-opam-form t]) easy-menu-add] 5]) (defvar tuareg-opam-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [tuareg-opam-mode-hook variable-documentation put "Hook run after entering Tuareg-opam mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp tuareg-opam-mode-map definition-name tuareg-opam-mode] 4) (defvar tuareg-opam-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" [tuareg-opam-mode-abbrev-table tuareg-opam-mode-map variable-documentation put purecopy "Keymap for `tuareg-opam-mode'." boundp tuareg-opam-mode-syntax-table definition-name tuareg-opam-mode (lambda (#1=#:def-tmp-var) (defvar tuareg-opam-mode-syntax-table #1#)) make-syntax-table "Syntax table for `tuareg-opam-mode'." (lambda (#1#) (defvar tuareg-opam-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `tuareg-opam-mode'." derived-mode-parent prog-mode] 5) #@232 Major mode to edit opam files. In addition to any hooks its parent mode `prog-mode' might have run, this mode runs the hook `tuareg-opam-mode-hook', as the final or penultimate step during initialization. \{tuareg-opam-mode-map} (defalias 'tuareg-opam-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)\306\332!\210\333\306\334!\210\335\306\336!\210*\337+\306\340!\210, \341-\342\"\210./B/\306\343!\2100#1\203\2442\203\244\344\307!\210\345 \210\346\347!\210)\346\347!\207" [delay-mode-hooks major-mode mode-name tuareg-opam-mode-map tuareg-opam-mode-syntax-table tuareg-opam-mode-abbrev-table make-local-variable t prog-mode tuareg-opam-mode "Tuareg-opam" 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 (tuareg-opam-font-lock-keywords) comment-start "#" comment-end "" prettify-symbols-alist nil require-final-newline smie-setup tuareg-opam-smie-rules tuareg-opam--flymake-proc-err-line-patterns flymake-mode tuareg-opam-build-menu run-mode-hooks tuareg-opam-mode-hook local-abbrev-table font-lock-defaults tuareg-opam-prettify-symbols indent-tabs-mode mode-require-final-newline tuareg-opam-smie-grammar tuareg-opam--allowed-file-name-masks tuareg-opam--flymake-proc-allowed-file-name-masks tuareg-opam--err-line-patterns tuareg-opam-flymake buffer-file-name] 5 (#$ . 12104) nil]) #@317 Get the opam environment for the given switch (or the default switch if none is provied) and return a list of lists of the form (n v) where n is the name of the environment variable and v its value (both being strings). If opam is not found or the switch is not installed, `nil' is returned. (fn &optional SWITCH) (defalias 'tuareg-opam-config-env #[256 "\211\205\301P\302Q\303!\211\205\304!@\207" [tuareg-opam " --switch " " config env --sexp" tuareg--shell-command-to-string read-from-string] 6 (#$ . 13776)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable tuareg-opam-insinuate funcall function #[0 "\300\207" [nil] 1] "By default, Tuareg will use the environment that Emacs was\nlaunched in. That environment may not contain an OCaml\ncompiler (say, because Emacs was launched graphically and the\npath is set in ~/.bashrc) and will remain unchanged when one\nissue an \"opam switch\" in a shell. If this variable is set to\nt, Tuareg will try to use opam to set the right environment for\n`compile', `run-ocaml' and `merlin-mode' based on the current\nopam switch at the time the command is run (provided opam is\nfound). You may also use `tuareg-opam-update-env' to set the\nenvironment for another compiler from within emacs (without\nchanging the opam switch). Beware that setting it to t causes\nproblems if you compile under tramp." :group tuareg :type boolean] 8) #@170 Similar to shell-command-to-string, but returns nil when the process return code is not 0 (shell-command-to-string returns the error message as a string). (fn COMMAND) (defalias 'tuareg--shell-command-to-string #[257 "\303\304\305\306\"\307\216rq\210\310 \311\312\311\n&\262*rq\210\313 +\303U\205)\211\207" [standard-output shell-file-name shell-command-switch 0 generate-new-buffer " *string-output*" t #[0 "\301!\207" [standard-output kill-buffer] 2] process-file nil (t nil) buffer-string] 9 (#$ . 15213)]) #@317 Get the opam environment for the given switch (or the default switch if none is provied) and return a list of lists of the form (n v) where n is the name of the environment variable and v its value (both being strings). If opam is not found or the switch is not installed, `nil' is returned. (fn &optional SWITCH) (defalias 'tuareg-opam-config-env #[256 "\211\205\301P\302Q\303!\211\205\304!@\207" [tuareg-opam " --switch " " config env --sexp" tuareg--shell-command-to-string read-from-string] 6 (#$ . 15743)]) (defalias 'tuareg-opam-installed-compilers #[0 "\301P\302P\303!\206\303!\211\205\304\305\306#\207" [tuareg-opam " switch list -i -s" " switch list -s" tuareg--shell-command-to-string split-string "[ \f \n ]+" t] 7]) (defalias 'tuareg-opam-current-compiler #[0 "\301P\302!\211\205\303\304\305#\207" [tuareg-opam " switch show -s" tuareg--shell-command-to-string replace-regexp-in-string "[ \n]*" ""] 6]) #@82 Update the environment to follow current OPAM switch configuration. (fn SWITCH) (defalias 'tuareg-opam-update-env #[257 "\211\302\230?\205\211\303!\211\2034\211\211\2053\211@\304@A@\"\210\211@\305\230\203,\306A@\"A\266\202\202\207\307\310\"\207" [path-separator exec-path "" tuareg-opam-config-env setenv "PATH" split-string message "Switch %s does not exist (or opam not found)"] 8 (#$ . 16691) (byte-code "\300 \301 \211\203\f\211\202 \302\303\304\"\305\"C\207" [tuareg-opam-installed-compilers tuareg-opam-current-compiler "current" format "opam switch (default: %s): " completing-read] 7)]) #@103 Advice to update the OPAM environment to sync it with the OPAM switch before compiling. (fn &rest _) (defalias 'tuareg--compile-opam #[128 "\301 \211\205\302\300!\210\303\304\301 \"\211\207" [compilation-environment tuareg-opam-config-env make-local-variable mapcar #[257 "\211@\300A@Q\207" ["="] 4 "\n\n(fn V)"]] 5 (#$ . 17314)]) (byte-code "\300\301\302\"\210\303\304!\207" [add-to-list auto-mode-alist ("[./]opam_?\\'" . tuareg-opam-mode) provide tuareg-opam] 3)