;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!\207" [require cider-client cider-compat cider-popup cider-util cl-lib nrepl-dict seq subr-x help-mode] 2) (defconst cider-browse-spec-buffer "*cider-spec-browser*") (defconst cider-browse-spec-example-buffer "*cider-spec-example*") #@38 Keymap for `cider-browse-spec-mode'. (defvar cider-browse-spec-mode-map (byte-code "\303 \304\305 \n\"\"\210\306\307\310#\210\306\311\312#\210\306\313\314#\210)\207" [map button-buffer-map cider-popup-buffer-mode-map make-sparse-keymap set-keymap-parent make-composed-keymap define-key " " cider-browse-spec--browse-at "n" forward-button "p" backward-button] 5) (#$ . 445)) (defvar cider-browse-spec-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [cider-browse-spec-mode-hook variable-documentation put "Hook run after entering Specs mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp cider-browse-spec-mode-map definition-name cider-browse-spec-mode] 4) (defvar cider-browse-spec-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" [cider-browse-spec-mode-abbrev-table cider-browse-spec-mode-map variable-documentation put purecopy "Keymap for `cider-browse-spec-mode'." boundp cider-browse-spec-mode-syntax-table definition-name cider-browse-spec-mode (lambda (def-tmp-var) (defvar cider-browse-spec-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `cider-browse-spec-mode'." (lambda (def-tmp-var) (defvar cider-browse-spec-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `cider-browse-spec-mode'." derived-mode-parent special-mode] 5) #@255 Major mode for browsing Clojure specs. \{cider-browse-spec-mode-map} In addition to any hooks its parent mode `special-mode' might have run, this mode runs the hook `cider-browse-spec-mode-hook', as the final or penultimate step during initialization. (defalias 'cider-browse-spec-mode #[nil "\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\2036 \321 =\203<\322\f\323 \"\210)\324 \325\"\204V !=\204V\326 \325!C#\210\327 !\210\330\f!\210 !\306\331!\210\332\306\333!\210\334\"\203|\306\335!\210\307)\336\337!\207" [delay-mode-hooks major-mode mode-name cider-browse-spec-mode-map cider-browse-spec-mode-syntax-table parent make-local-variable t special-mode cider-browse-spec-mode "Specs" 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 electric-indent-chars nil sesman-system CIDER truncate-lines run-mode-hooks cider-browse-spec-mode-hook cider-browse-spec-mode-abbrev-table local-abbrev-table cider-special-mode-truncate-lines] 6 (#$ . 2145) nil]) (defvar cider-browse-spec--current-spec nil) #@43 Keymap for `cider-browse-spec-view-mode'. (defvar cider-browse-spec-view-mode-map (byte-code "\302 \303 \"\210\304\305\306#\210\304\307\310#\210\304\311\312#\210\304\313\314#\210\304\315\316#\210)\207" [map help-mode-map make-sparse-keymap set-keymap-parent define-key " " cider-browse-spec--browse-at "^" cider-browse-spec-all "e" cider-browse-spec--print-curr-spec-example "n" forward-button "p" backward-button] 4) (#$ . 3403)) (defvar cider-browse-spec-view-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [cider-browse-spec-view-mode-hook variable-documentation put "Hook run after entering Spec mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp cider-browse-spec-view-mode-map definition-name cider-browse-spec-view-mode] 4) (defvar cider-browse-spec-view-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" [cider-browse-spec-view-mode-abbrev-table cider-browse-spec-view-mode-map variable-documentation put purecopy "Keymap for `cider-browse-spec-view-mode'." boundp cider-browse-spec-view-mode-syntax-table definition-name cider-browse-spec-view-mode (lambda (def-tmp-var) (defvar cider-browse-spec-view-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `cider-browse-spec-view-mode'." (lambda (def-tmp-var) (defvar cider-browse-spec-view-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `cider-browse-spec-view-mode'." derived-mode-parent help-mode] 5) #@261 Major mode for displaying CIDER spec. \{cider-browse-spec-view-mode-map} In addition to any hooks its parent mode `help-mode' might have run, this mode runs the hook `cider-browse-spec-view-mode-hook', as the final or penultimate step during initialization. (defalias 'cider-browse-spec-view-mode #[nil "\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\2036 \321 =\203<\322\f\323 \"\210)\324!\325\"\204V!\"=\204V\326!\325\"C#\210\327 !\210\330\f!\210!\"\306\331!\210\332\306\333!\210\332\306\334!\210\335#\203\203\306\336!\210\307)\337\340!\207" [delay-mode-hooks major-mode mode-name cider-browse-spec-view-mode-map cider-browse-spec-view-mode-syntax-table parent make-local-variable t help-mode cider-browse-spec-view-mode "Spec" 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 cider-browse-spec--current-spec nil electric-indent-chars sesman-system CIDER truncate-lines run-mode-hooks cider-browse-spec-view-mode-hook cider-browse-spec-view-mode-abbrev-table local-abbrev-table cider-special-mode-truncate-lines] 6 (#$ . 5228) nil]) #@46 Keymap for `cider-browse-spec-example-mode'. (defvar cider-browse-spec-example-mode-map (byte-code "\302 \303 \"\210\304\305\306#\210\304\307\310#\210\304\311\312#\210)\207" [map cider-popup-buffer-mode-map make-sparse-keymap set-keymap-parent define-key "^" cider-browse-spec-all "e" cider-browse-spec--print-curr-spec-example "g" revert-buffer] 4) (#$ . 6529)) (defvar cider-browse-spec-example-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [cider-browse-spec-example-mode-hook variable-documentation put "Hook run after entering Example mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp cider-browse-spec-example-mode-map definition-name cider-browse-spec-example-mode] 4) (defvar cider-browse-spec-example-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" [cider-browse-spec-example-mode-abbrev-table cider-browse-spec-example-mode-map variable-documentation put purecopy "Keymap for `cider-browse-spec-example-mode'." boundp cider-browse-spec-example-mode-syntax-table definition-name cider-browse-spec-example-mode (lambda (def-tmp-var) (defvar cider-browse-spec-example-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `cider-browse-spec-example-mode'." (lambda (def-tmp-var) (defvar cider-browse-spec-example-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `cider-browse-spec-example-mode'." derived-mode-parent special-mode] 5) #@270 Major mode for Clojure spec examples. \{cider-browse-spec-example-mode-map} In addition to any hooks its parent mode `special-mode' might have run, this mode runs the hook `cider-browse-spec-example-mode-hook', as the final or penultimate step during initialization. (defalias 'cider-browse-spec-example-mode #[nil "\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\2036 \321 =\203<\322\f\323 \"\210)\324\"\325\"\204V\"#=\204V\326\"\325#C#\210\327 !\210\330\f!\210\"#\306\331!\210\332\306\333!\210\334\306\335!\210\336$\203\203\306\337!\210\307)\340\341!\207" [delay-mode-hooks major-mode mode-name cider-browse-spec-example-mode-map cider-browse-spec-example-mode-syntax-table parent make-local-variable t special-mode cider-browse-spec-example-mode "Example" 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 electric-indent-chars nil revert-buffer-function cider-browse-spec--example-revert-buffer-function sesman-system CIDER truncate-lines run-mode-hooks cider-browse-spec-example-mode-hook cider-browse-spec-example-mode-abbrev-table local-abbrev-table cider-special-mode-truncate-lines] 6 (#$ . 8332) nil]) (define-button-type 'cider-browse-spec--spec 'action 'cider-browse-spec--browse-at 'face nil 'follow-link t 'help-echo "View spec") #@87 Reset contents of BUFFER. Display TITLE at the top and SPECS are indented underneath. (defalias 'cider-browse-spec--draw-list-buffer #[(buffer title specs) "rq\210\306 \210\307\310 \210db\210\311\n\312\"\313\261\210 \314\211\203C @\315\316\304\f#c\210\317\320\321\f!\322\323#\304\f#\210\315\313\304\f#c\210 A\211\204*eb*\207" [buffer inhibit-read-only title specs spec-name --dolist-tail-- cider-browse-spec-mode t erase-buffer cider-propertize emph "\n" nil propertize " " button-put insert-text-button cider-font-lock-as-clojure type cider-browse-spec--spec] 6 (#$ . 9840)]) #@48 Return non nil if STR is a namespaced keyword. (defalias 'cider--qualified-keyword-p #[(str) "\302\303\304\305#)\207" [str inhibit-changing-match-data "^:.+/.+$" nil t string-match] 7 (#$ . 10434)]) #@58 Return non nil if VALUE is clojure.spec.[alpha]/FN-NAME. (defalias 'cider--spec-fn-p #[(value fn-name) "\303\304Q \305\306\307#)\207" [fn-name value inhibit-changing-match-data "^\\(clojure.spec\\|clojure.spec.alpha\\)/" "$" nil t string-match] 7 (#$ . 10644)]) #@81 Given a spec FORM builds a multi line string with a pretty render of that FORM. (defalias 'cider-browse-spec--pprint #[(form) ";\203.\306!\203$\307\310\311\"r q\210\312\216\313\314\315\316#\317#\210\320 +\207\321\322\323\321\324\325##\207<\203w@;\203w@\211\326\230\203hA@\327\232\203Y\330\331\332\333\334\335AA\"\"\"\202u\330\336\332\333\334\335AA\"\"\"\202u\337\n\340\"\203\205\330\341\334\342\334\335A\"\"\343\344\345#\266\202\"\202u\337\n\346\"\203\245\347A\350\"\330\351\334\352 \"\343\344\345#\266\202\")\202u\337\n\353\"\203\302\330\354\334\355\334\335A\"\"\343\344\345#\266\202\"\202u\337\n\356\"\203\335\347A\350\"\330\357\332\333\334\360\f\"\"\")\202u\337\n\361\"\203 A@AA@AAA@A\330\362A@\334\363 \"\343\344\345#\266\202$+\202u\337\n\364\"\203(\347A\350\"B\330\365\332\333\334\366B\"\"\")\202u\337\n\367\"\203E\347A\350\"B\330\370\332\333\334\371B\"\"\")\202u\337\n\372\"\203`\330\373\332\333\334\374\375\376\347A\350\"\"\"\"\"\202u\330\377\335\n!\334\335A\"\201C\344\345#\266\202#)\207\330\373\"\207" [form #1=#:temp-buffer form-tag name-spec-pair keys-args sub-specs cider--qualified-keyword-p generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] button-put insert-text-button type cider-browse-spec--spec spec-name buffer-string replace-regexp-in-string "^\\(clojure.core\\)/" #3="" "^\\(clojure.spec\\|clojure.spec.alpha\\)/" "s/" "clojure.core/fn" ("%") format "#%s" cl-reduce concat mapcar cider-browse-spec--pprint "(fn [%%] %s)" cider--spec-fn-p "and" "(s/and\n%s)" #[(x) "\301\302\"\207" [x format "%s"] 3] "\n" mapconcat identity "or" seq-partition 2 "(s/or\n%s)" #[(s) "\301\302@\303A@!#\207" [s format "%s %s" cider-browse-spec--pprint] 5] "merge" "(s/merge\n%s)" #[(x) "\301\302\"\207" [x format "%s"] 3] "keys" "(s/keys%s)" #[(s) "@A@\303\n\304\305\306\305\307 \"\"\303\310\311#\266\202\312\260*\207" [s specs-vec key-type "\n" " [" mapcar #[(x) "\301\302\"\207" [x format "%s"] 3] cider-browse-spec--pprint mapconcat identity "]"] 9] "multi-spec" "(s/multi-spec %s %s\n%s)" #[(s) "\301@\302\303A@!R\207" [s "\n\n" " " cider-browse-spec--pprint] 5] "cat" "(s/cat %s)" #[(s) "\301@\302\303A@!R\207" [s "\n" " " cider-browse-spec--pprint] 5] "alt" "(s/alt %s)" #[(s) "\301@\302\303A@!R\207" [s "\n" " " cider-browse-spec--pprint] 5] "fspec" "%s" #[(s) "\302\303@\211\304\267\202\305\202\306\202\307\202\310)\311A@!#\207" [s #2=#:val format "\n%-11s: %s" #s(hash-table size 3 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (":args" 11 ":ret" 15 ":fn" 19)) "arguments" "returns" "invariants" nil cider-browse-spec--pprint] 6] cl-remove-if #[(s) "A@;\205A@\211\301\230\262\207" [s #3#] 3] "(%s %s)" retag multi-method name-spec-pairs " "] 12 (#$ . 10917)]) #@79 Indent (pretty-print) and font-lock SPEC-FORM. Return the result as a string. (defalias 'cider-browse-spec--pprint-indented #[(spec-form) "\302\303\304\"rq\210\305\216\306 \210\307 !c\210\310ed\"\210\311 \210\312 +\207" [#1=#:temp-buffer spec-form generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] clojure-mode cider-browse-spec--pprint indent-region cider--font-lock-ensure buffer-string] 3 (#$ . 13766)]) #@201 Reset contents of BUFFER and draws everything needed to browse the SPEC-FORM. Display SPEC as a title and uses `cider-browse-spec--pprint' to display a more user friendly representation of SPEC-FORM. (defalias 'cider-browse-spec--draw-spec-buffer #[(buffer spec spec-form) "rq\210\304\305\306\nD\307#\210db\210\310\n!\311\261\210\312 !c\210\313 \210p*\207" [buffer inhibit-read-only spec spec-form t cider--help-setup-xref cider-browse-spec nil cider-font-lock-as-clojure "\n\n" cider-browse-spec--pprint-indented cider--make-back-forward-xrefs] 4 (#$ . 14228)]) #@14 Browse SPEC. (defalias 'cider-browse-spec--browse #[(spec) "\305 \210\306\307!\210\310\311\312\313#)\266\203\205\314\315\316 \"\317\"\211\203&\n)r\320 \321\322\323$q\210\324\304!\210\325p\326!#\210eb\210p)\207" [spec inhibit-changing-match-data val cider-browse-spec-buffer cider-browse-spec--current-spec cider-ensure-connected cider-ensure-op-supported "spec-form" "^::.+" nil t string-match nrepl-dict-get cider-sync-tooling-eval cider-current-ns "value" cider-popup-buffer select cider-browse-spec-view-mode ancillary make-local-variable cider-browse-spec--draw-spec-buffer cider-sync-request:spec-form] 8 (#$ . 14801)]) #@193 View the definition of a spec. Optional argument POS is the position of a spec, defaulting to point. POS may also be a button, so this function can be used a the button's `action' property. (defalias 'cider-browse-spec--browse-at #[(&optional pos) "\206`\302\303\"\211\205\304 !*\207" [pos spec button-get spec-name cider-browse-spec--browse] 4 (#$ . 15448) nil]) #@52 Generate and print an example of the current spec. (defalias 'cider-browse-spec--print-curr-spec-example #[nil "\305 \210\306\307!\210\211\203E\310 !\211\203;r\311 \312\313\314$q\210\315\300!\210 \316\317\320 !\261\210\321c\210\320\n!c\210eb*\202A\322\323\324 \"!)\202H\322\325!)\207" [cider-browse-spec--current-spec spec example cider-browse-spec-example-buffer inhibit-read-only cider-ensure-connected cider-ensure-op-supported "spec-example" cider-sync-request:spec-example cider-popup-buffer select cider-browse-spec-example-mode ancillary make-local-variable t "Example of " cider-font-lock-as-clojure "\n\n" error format "No example for spec %s" "No current spec"] 6 (#$ . 15828) nil]) #@111 `revert-buffer' function for `cider-browse-spec-example-mode'. Generates a new example for the current spec. (defalias 'cider-browse-spec--example-revert-buffer-function #[(&rest _) "\300 \207" [cider-browse-spec--print-curr-spec-example] 1 (#$ . 16538)]) #@25 Browse SPEC definition. (defalias 'cider-browse-spec #[(spec) "\301!\207" [spec cider-browse-spec--browse] 2 (#$ . 16801) (list (completing-read "Browse spec: " (cider-sync-request:spec-list) nil nil (cider-symbol-at-point)))]) #@100 Open the list of specs that matches REGEX in a popup buffer. Displays all specs when REGEX is nil. (defalias 'cider-browse-spec-regex #[(regex) "\304 \210\305\306!\210\206\f\307r\310\n\311\312\313$q\210\314 !\315p \211\307\230\262\203)\316\202-\317\320 \" #+\207" [regex filter-regex cider-browse-spec-buffer specs cider-ensure-connected cider-ensure-op-supported "spec-list" "" cider-popup-buffer select nil ancillary cider-sync-request:spec-list cider-browse-spec--draw-list-buffer "All specs in registry" format "All specs matching regex `%s' in registry"] 5 (#$ . 17037)]) #@159 Open list of specs in a popup buffer. With a prefix argument ARG, prompts for a regexp to filter specs. No filter applied if the regexp is the empty string. (defalias 'cider-browse-spec-all #[(&optional arg) "\301\203 \302\303!\202\f\304!\207" [arg cider-browse-spec-regex read-string "Filter regex: " ""] 3 (#$ . 17628) "P"]) (provide 'cider-browse-spec)