;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305!\204\306\305\307\"\210\310\311\312\313\314\315%\210\316\317\320\321\322DD\323\324\325\314\311&\210\316\326\320\321\327DD\330\324\331\314\311&\210\316\332\320\321\333DD\334\324\335\314\311&\210\316\336\320\321\337DD\340\324\341\314\311&\207" [require cl-lib json erlang fboundp user-error defalias error custom-declare-group erldoc nil "Browse Erlang document." :group help custom-declare-variable erldoc-man-index funcall function #[0 "\300\207" [#1="http://www.erlang.org/doc/man_index.html"] 1 #1#] "The URL to the man_index.html page.\nNote it is advisable to customise this to a local URL for example\n`file:///usr/local/19.1/lib/erlang/doc/man_index.html' to speed\nup the indexing." :type string erldoc-verify-man-path #[0 "\300\207" [nil] 1] "If non-nil verify man path existence for `file://'." boolean erldoc-output-file #[0 "\300\301!\207" [locate-user-emacs-file "cache/erldoc"] 2] "File to store the parsed results." file erldoc-no-signature-function #[0 "\300\207" [ignore] 1] "Notification function called if no function signature was found." (choice (function-item :tag "Ignore" ignore) (function-item :tag "Warn" warn) (function-item :tag "Error" error))] 8) #@10 (fn S) (defalias 'erldoc-strip-string #[257 "\300\301\"\203\f\302\225\202 \302\300\303\"\205\302\224\205]O\207" [string-match "\\`[ \n \f  ]+" 0 "[ \n \f  ]+\\'"] 7 (#$ . 1328)]) #@21 (fn URL BASE-URL) (defalias 'erldoc-expand-url #[514 "\301!\302!>\204\303\304\305D\"\210\211\306H\262\203\207\301!\307\310\302!>\2040\303\304\305D\"\210\311H!!\302!>\204D\303\304\305D\"\210\211\311\312\"I\266\313!\207" [cl-struct-url-tags url-generic-parse-url type-of signal wrong-type-argument url 1 directory-file-name file-name-directory 6 expand-file-name url-recreate-url] 10 (#$ . 1532)]) #@12 (fn URL) (defalias 'erldoc-parse-html #[257 "\300\301\302\"r\211q\210\303\304\"\216\305!\210\306ed\"*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] url-insert-file-contents libxml-parse-html-region] 5 (#$ . 1962)]) (defalias 'erldoc-dom-text-node-p 'stringp) #@12 (fn DOM) (defalias 'erldoc-dom-attributes #[257 "\300!?\205\n\211A@\207" [erldoc-dom-text-node-p] 3 (#$ . 2303)]) #@24 (fn DOM ATTRIB-NAME) (defalias 'erldoc-dom-get-attribute #[514 "\211\300!\236A\207" [erldoc-dom-attributes] 5 (#$ . 2427)]) #@12 (fn DOM) (defalias 'erldoc-dom-children #[257 "\300!?\205\n\211AA\207" [erldoc-dom-text-node-p] 3 (#$ . 2560)]) #@12 (fn DOM) (defalias 'erldoc-dom-get-text #[257 "\300\301!!@\302!\205 \211\207" [last erldoc-dom-children erldoc-dom-text-node-p] 4 (#$ . 2682)]) (defvar erldoc-dom-walk-parent nil) (defvar erldoc-dom-walk-siblings nil) #@14 (fn DOM K) (defalias 'erldoc-dom-walk #[514 "\211!\210\302!?\205AA\211\205$\211@\303\"\210A\266\202\202\262*\207" [erldoc-dom-walk-siblings erldoc-dom-walk-parent erldoc-dom-text-node-p erldoc-dom-walk] 7 (#$ . 2911)]) #@25 (fn DOM ELEMENT-NAME) (defalias 'erldoc-dom-get-element #[514 "\3002\f\301\302\303\"\"0\207" [return erldoc-dom-walk make-closure #[257 "\211\242\300=\205 \301\302\"\207" [V0 throw return] 4 "\n\n(fn D)"]] 7 (#$ . 3154)]) #@15 (fn DOM ID) (defalias 'erldoc-dom-get-element-by-id #[514 "\3002\f\301\302\303\"\"0\207" [return erldoc-dom-walk make-closure #[257 "\301\302\"\300\232\205 \303\304\"\207" [V0 erldoc-dom-get-attribute id throw return] 4 "\n\n(fn D)"]] 7 (#$ . 3389)]) #@15 (fn DOM ID) (defalias 'erldoc-dom-get-elements-by-id #[514 "\300C\301\302\303#\"\210\211\242\237\207" [nil erldoc-dom-walk make-closure #[257 "\302\303\"\300\232\205\301\301\242B\240\207" [V0 V1 erldoc-dom-get-attribute id] 4 "\n\n(fn D)"]] 9 (#$ . 3654)]) #@12 (fn URL) (defalias 'erldoc-fix-path #[257 "\203r\302!\303! >\204\304\305\306D\"\210\211\307H\262\310\232\203r\302!\311\312\313\314\303! >\2047\304\305\306D\"\210\315H#!@\211\204X\316\317\303! >\204S\304\305\306D\"\210\315H\"\210\303! >\204g\304\305\306D\"\210\211\315I\266\320!\207\207" [erldoc-verify-man-path cl-struct-url-tags url-generic-parse-url type-of signal wrong-type-argument url 1 "file" file-expand-wildcards replace-regexp-in-string "-[0-9]+\\(?:[.][0-9]+\\)*" "*" 6 error "File %s does not exist" url-recreate-url] 10 (#$ . 3926)]) #@12 (fn URL) (defalias 'erldoc-parse-man-index #[257 "\300\301!\302\"\303C\304\305\306#\"\210\211\242\237\207" [erldoc-dom-get-element erldoc-parse-html table nil erldoc-dom-walk make-closure #[257 "\211\242\303=\205A\304\305\"\211\205?\306\307\310\311#)\266\203?\205?\31217\301\313!\314\315\300\"!B\301\242B\2400\202?\316\317\"\210\307\262\262\207" [V0 V1 inhibit-changing-match-data a erldoc-dom-get-attribute href "index\\.html\\'" nil t string-match (debug error) erldoc-dom-get-text erldoc-fix-path erldoc-expand-url message "erldoc-parse-man-index: %S"] 9 "\n\n(fn D)"]] 9 (#$ . 4509)]) #@12 (fn MAN) (defalias 'erldoc-parse-man #[257 "\300A!\301\302\303\"\304\305\306\"\307\310#\"\210\311\312C\304\307\313%\"\210\211\242\207" [erldoc-parse-html make-hash-table :test equal erldoc-dom-walk erldoc-dom-get-element-by-id "loadscrollpos" make-closure #[257 "\302\303\"\211\205'\304\305\"\205'\306\307\225\310O\300@\311\312\313!!Q\314\300A\"D\301#\207" [V0 V1 erldoc-dom-get-attribute href string-match "#" puthash 0 nil ":" erldoc-strip-string erldoc-dom-get-text erldoc-expand-url] 9 "\n\n(fn D)"] #[257 "\300C\301\302\303\"\"\210\211\242\205\304\305\242\237\306#\207" [nil erldoc-dom-walk make-closure #[257 "\301!\205\300\302!\300\242B\240\207" [V0 erldoc-dom-text-node-p erldoc-strip-string] 4 "\n\n(fn D)"] mapconcat identity " "] 7 "\n\n(fn SPAN)"] nil #[257 "\211\242\306=\203D\307\310\311\"\301\"\203D\310\311\"\307\301\"\211@\302!\2068\302\312\313\"\206.\f>A@!\2068 \314\"\210\315\303\316C\"\303\242B\240\266\211\242\306=\205r\317\320\310\311\"\206U\321\"\205r\303\300@\322\302!Q\300A\323\310\311\"Q\302!E\303\242B\240\207" [V0 V1 V2 V3 erldoc-dom-walk-siblings erldoc-no-signature-function a gethash erldoc-dom-get-attribute name erldoc-dom-get-element span "erldoc-parse-man: no sig for %s" nil append string-prefix-p "type-" "" ":" "#" erldoc-dom-walk-parent] 9 "\n\n(fn D)"]] 13 (#$ . 5127)]) #@40 (fn MAN-INDEX OUTPUT &optional JSON) (defalias 'erldoc-parse-all #[770 "\301!\302\303\304\305\306$\307!\310\311\312\310G#\313\211\211\203^\211@\3141-\315!B\211\2620\210\2027\316!B\211\262\266\317\313\320\"\210T\211\262\313\247\203P@Y\205U\321#\266A\266\202\202\210\203q\322\323\324\325\326\327\330#\"\331#\210\332!\210\333\334\335\"\336\337\237\"\"\210\340\341\342\"r\211q\210\334\343\"\216\204\235\344p\"\210\202\246\342\345!c\210)\346\347 !!\204\267\350\347 !\342\"\210\351\313\211\n\313\211\211\352&*\207" [json-encoding-pretty-print expand-file-name make-hash-table :size 11503 :test equal erldoc-parse-man-index 1 make-progress-reporter "Parsing Erlang/OTP documentation" nil (error) erldoc-parse-man error-message-string accept-process-output 0.01 progress-reporter-do-update display-warning erldoc-parse-all format "\n\n%s" mapconcat identity "\n" :error progress-reporter-done mapc make-closure #[257 "\301@A\300#\207" [V0 puthash] 5 "\n\n(fn X)"] apply nconc generate-new-buffer " *temp*" t #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] pp json-encode file-directory-p file-name-directory make-directory write-region ask] 19 (#$ . 6500)]) #@62 Get the otp release version (as string) or nil if not found. (defalias 'erldoc-otp-release #[0 "\301\302\303\304\305\"!\306\"!\307\310\"\205\311\312\"\207" [erldoc-man-index erldoc-dom-get-text erldoc-dom-get-element erldoc-parse-html erldoc-expand-url "index.html" title string-match "[0-9.]+\\'" match-string 0] 6 (#$ . 7732)]) (defvar erldoc-browse-history nil) (defvar erldoc-lookup-table nil) (defalias 'erldoc-lookup-table #[0 "\206O\303 !\2046\304 \211\204 \202\211 \305Q\262\262\303!\204(\306\n\"\210 \230\2045\307\310! \"\210\210\311\312\313\"r\211q\210\314\315\"\216\316 !\210\317p!*\262\211\207" [erldoc-lookup-table erldoc-output-file erldoc-man-index file-exists-p erldoc-otp-release "-" erldoc-parse-all make-symbolic-link expand-file-name generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents read] 5]) #@12 (fn MFA) (defalias 'erldoc-best-matches #[257 "\211:\205\211\211\242\243\211:\205\207\211\242\243\211?\205\205\300\301 \262\302\303$\304\305 \"\2032\211C\202\203B\306\307\310R\305 \"\202\311 \211\205M\211\307\310R\312\310Q\307\313!\310Q\203d\306\305 \"\206}\306\305 \"\206}\300C\314\315\316#\305 \"\210\211\242\237\262\266\204\262\266\203\262\266\202\266\202\207" [nil erlang-get-function-arity format "%s:%s/%s" gethash erldoc-lookup-table all-completions ":" "/" erlang-get-module "erlang:" regexp-quote maphash make-closure #[514 "\300\303\304\305#)\266\203\205\301\301\242B\240\207" [V0 V1 inhibit-changing-match-data nil t string-match] 9 "\n\n(fn K --CL-VAR--)"]] 20 (#$ . 8659)]) #@12 (fn MFA) (defalias 'erldoc-browse #[257 "\211;\204 \300\301\302\303E\"\210\304\305\306 \"@\206\307\310\"!\207" [signal wrong-type-argument string mfa browse-url gethash erldoc-lookup-table user-error "No documentation for %s"] 6 (#$ . 9400) (byte-code "\301 p\302\303#\216\304\206\305 !\210\3061/\307\310 \206*\212\311 A@\206%`b\210\310 )!0\2021\210\312)\266\202\313\314\203>\315\202?\316GG\317U\203L\320\202M\321@$\322 \312\323\312\324&C\207" [erlang-mode-syntax-table syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table standard-syntax-table (error) erldoc-best-matches erlang-get-function-under-point syntax-ppss nil completing-read format "Function {%d %s} (default %s): " "Function: " 1 "guess" "guesses" erldoc-lookup-table t erldoc-browse-history] 9)]) #@16 (fn PATTERN) (defalias 'erldoc-apropos #[257 "\305\211\223\210\306 B\307\nB\310 \311 \312!\211\305\211r\fq\210\313\314\315Q!\210\316\317\320\"\321 \")\262rq\210\322\305\"\262)\323\324!\203I\324\"\202J\211)\266\204*\207" [help-window-point-marker temp-buffer-window-setup-hook temp-buffer-window-show-hook help-window-old-frame standard-output nil help-mode-setup help-mode-finish selected-frame help-buffer temp-buffer-window-setup princ "Erldoc apropos pattern: " "\n\n" maphash make-closure #[514 "\300\302\303\304#)\266\203\205\305\306\307\310@C%\210\311c\207" [V0 inhibit-changing-match-data nil t string-match insert-text-button :type help-url help-args "\n"] 9 "\n\n(fn K V)"] erldoc-lookup-table temp-buffer-window-show functionp help-window-setup] 9 (#$ . 10244) "sPattern: "]) #@12 (fn SIG) (defalias 'erldoc-tokenize-signature #[257 "\300\301\"\203 \302\225S\202\302\300\303\"\205\302\224\304\302O!\304\205']O!\2053\304\305O!E\207" [string-match "\\`.+?(" 0 "\\s-*->\\s-*.*?\\'" erldoc-strip-string nil] 9 (#$ . 11065)]) #@15 (fn MOD FN) (defalias 'erldoc-format-signature #[514 "\205X\211\205X\204\302 !\205X\303\304\305\260\306C\307\310\311#\300 \"\210\211\242\205V\312\313\242\314\315$\316\242\317\"\203I\304\320\321\322#\323\260\207\320\310\324#\325#\266\202\266\202\207" [erldoc-lookup-table erldoc-output-file file-exists-p "\\`" ":" "/\\([0-9]+\\)\\'" nil maphash make-closure #[514 "\303\300\"\205$\211A@\203 \301\304\305\306\"!\307A@!AB\301\242B\240\207\n\310\"\207" [V0 V1 erldoc-no-signature-function string-match string-to-number match-string 1 erldoc-tokenize-signature "erldoc-format-signature: No sig for %s"] 7 "\n\n(fn K V)"] cl-reduce #[514 "\205\211\205\232\205\207" [] 4 "\n\n(fn X1 X2)"] :key cl-caddr sort car-less-than-car mapconcat cadr " | " " " #[257 "\300\302\301A@\303\3048\260\207" [V0 V1 ":" " " 2] 8 "\n\n(fn X)"] "\n"] 13 (#$ . 11332)]) #@57 A function suitable for `eldoc-documentation-function'. (defalias 'erldoc-eldoc-function #[0 "\212\300 \211:\205K\211\242\243\211:\205I\211\242\211\204\243\301\262\202G\2046\243\211?\2051\302\303\"\262\262\202G\243\211?\205E\302\"\266\202\262\262\266\202\262)\207" [erlang-get-function-under-point nil erldoc-format-signature "erlang"] 10 (#$ . 12232)]) (defalias 'erldoc-parse-eeps-index #[0 "\300\3012\f\302\303\300!\304\"0\305\306C\302\307\310$\"\210\211\242\237\207" ["http://www.erlang.org/eeps/" return erldoc-dom-walk erldoc-parse-html #[257 "\211\242\300=\205\301\302\"\303\232\205\304\305\"\207" [table erldoc-dom-get-attribute summary "Numerical Index of EEPs" throw return] 4 "\n\n(fn D)"] #[257 "\300\301\302\300\303\304##\207" [replace-regexp-in-string "`` *" "" " *``, *" " by "] 8 "\n\n(fn TITLE)"] nil make-closure #[257 "\211\242\303=\205\302\301\304\305\"!\306\304\307\"\300\"B\302\242B\240\207" [V0 V1 V2 a erldoc-dom-get-attribute title erldoc-expand-url href] 7 "\n\n(fn D)"]] 11]) (defvar erldoc-user-guides nil) #@59 List of standard Erlang applications with no user guides. (defvar erldoc-missing-user-guides '("compiler" "kernel" "os_mon" "parsetools") (#$ . 13319)) #@47 List of applications that come with a manual. (defvar erldoc-app-manuals '("crypto" "diameter" "erl_docgen" "kernel" "observer" "os_mon" "runtime_tools" "sasl" "snmp" "ssl" "test_server" ("ssh" . "SSH") ("stdlib" . "STDLIB")) (#$ . 13477)) #@19 (fn USER-GUIDE) (defalias 'erldoc-user-guide-chapters #[257 "\211\242\243\235?\205+\301\302\303!\304\"\305\"\211\204!\306\307A\"\210\310\311\312#\"\262\207" [erldoc-missing-user-guides erldoc-dom-get-elements-by-id erldoc-dom-get-element-by-id erldoc-parse-html "leftnav" "no" warn "erldoc-user-guide-chapters no chapters found for `%s'" mapcar make-closure #[257 "\300\302\303\304\"Q\305\303\306\307\"\310\"\301\"B\207" [V0 V1 "#" erldoc-dom-get-attribute title erldoc-expand-url erldoc-dom-get-element a href] 7 "\n\n(fn LI)"]] 11 (#$ . 13723)]) (defalias 'erldoc-user-guides-1 #[0 "\301\302\"\303C\303C\304\305!\306\307$\"\210\242\237\242\237D\207" [erldoc-man-index erldoc-expand-url "applications.html" nil erldoc-dom-walk erldoc-parse-html make-closure #[257 "\211\242\306=\205r\307\310!\311\312\313#)\266\203?\205r\3141j\315\310!!\316\317\320\321\"\300\"!\301\211\f\235\2038\202<\317\322\"B\301\242B\240\210\323\324\325 \"\"\211:\205d\211\243\211\302\317\326\327\"\"B\302\242B\240\262\262\262\266\2020\207\330\331\"\210\311\262\207" [V0 V1 V2 inhibit-changing-match-data erldoc-missing-user-guides erldoc-app-manuals a "\\`[0-9.]+\\'" erldoc-dom-get-text nil t string-match (debug error) erldoc-strip-string erldoc-fix-path erldoc-expand-url erldoc-dom-get-attribute href "users_guide.html" assoc mapcar #[257 "\211:\203\207\211B\207" [] 3 "\n\n(fn X)"] format "%s_app.html" message "erldoc-user-guides-1: %S"] 12 "\n\n(fn D)"]] 10]) (defalias 'erldoc-user-guides #[0 "\206u \302P\303!\204Z\304\305!!\204\306\305!\307\"\210\310\311\307\"r\211q\210\312\313\"\216\314 \211\242\243\211\242\243\315\316\317\320\316\321\322\323\"\"\"\321\324\"\325 #p\"\266\326\327\211\327\211\211\330&\210*\210\310\311\307\"r\211q\210\312\331\"\216\332!\210\333p!*\262\211\262\207" [erldoc-user-guides erldoc-output-file "-topics" file-exists-p file-directory-p file-name-directory make-directory t generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] erldoc-user-guides-1 pp append cl-mapcan erldoc-user-guide-chapters mapcar #[257 "\211\301\302P\"B\207" [erldoc-man-index erldoc-expand-url "/users_guide.html"] 5 "\n\n(fn DIR)"] ("design_principles" "efficiency_guide" "embedded" "getting_started" "installation_guide" "oam" "programming_examples" "reference_manual" "system_architecture_intro" "system_principles" "tutorial") #[257 "\211\242\243\300PB\207" [" (App)"] 7 "\n\n(fn MAN)"] erldoc-parse-eeps-index write-region nil ask #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents read] 17]) #@14 (fn TOPIC) (defalias 'erldoc-browse-topic #[257 "\300\301\302 \"A!\207" [browse-url assoc erldoc-user-guides] 5 (#$ . 16393) (byte-code "\300\301\302 \303\304$C\207" [completing-read "User guide: " erldoc-user-guides nil t] 5)]) (provide 'erldoc)