;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\301%\210\310\311\312\313\314DD\315\307\304%\210\310\316\312\313\317DD\320\321\322\307\304&\210\310\323\312\313\324DD\325\307\304%\210\310\326\312\313\327DD\330\321\331\307\304&\210\310\332\312\313\333DD\334\321\331\307\304&\207" [require helm helm-utils custom-declare-group helm-xcdoc nil "Search Xcode Document with helm interface" :group custom-declare-variable helm-xcdoc-command-path funcall function #[0 "\300\207" [nil] 1] "command path of `docsletutil'" helm-xcdoc-command-option #[0 "\300\207" [nil] 1] "Command line option of `docsetutil'. This is appended after `helm-xcdoc-command-path'" :type string helm-xcdoc-document-path #[0 "\300\207" [nil] 1] "please set docset path like:\n\"~/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.AppleiOS8.1.iOSLibrary.docset\"" helm-xcdoc-maximum-candidates #[0 "\300\207" [100] 1] "Maximum number of helm candidates" integer helm-xcdoc-log-level #[0 "\300\207" [-1] 1] "Logging level, only messages with level lower or equal will be logged.\n-1 = NONE, 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG"] 8) #@12 query word (defvar helm-xcdoc--query "" (#$ . 1229)) #@19 split window flag (defvar helm-xcdoc--use-otherwin nil (#$ . 1288)) (defconst helm-xcdoc--buffer "*helm xcdoc*") #@279 Log a message at level LEVEL. If LEVEL is higher than `helm-xcdoc-log', the message is ignored. Otherwise, it is printed using `message'. TEXT is a format control string, and the remaining arguments ARGS are the string substitutions (see `format'). (fn LEVEL TEXT &rest ARGS) (defalias 'helm-xcdoc-log #[642 "X\205\301\302#\303\304\"\262\207" [helm-xcdoc-log-level apply format message "%s"] 7 (#$ . 1408)]) #@16 (fn &rest _) (defalias 'helm-xcdoc--set-start-at #[128 "eb\210\301\302\303#\207" [helm-xcdoc--query re-search-forward nil t] 5 (#$ . 1832)]) (advice-add 'eww-render :after 'helm-xcdoc--set-start-at) #@21 (fn QUERY DOCSET) (defalias 'helm-xcdoc--construct-command #[514 "\303!\204\n\304\305!\210\306 !\204\304\307!\210C\310\311D\"\262\n\203)\310\nC\"\262\310 C\"\262\312\313\314#\207" [helm-xcdoc-command-path helm-xcdoc-document-path helm-xcdoc-command-option executable-find error "'docsetutil' is not installed." file-directory-p "Document Directory not found" append "search -query" mapconcat identity " "] 7 (#$ . 2040)]) #@21 (fn QUERY DOCSET) (defalias 'helm-xcdoc--excecute-search #[514 "\300\"\301\302\303#\210\304!\207" [helm-xcdoc--construct-command helm-xcdoc-log 3 "shell command: %s" shell-command-to-string] 7 (#$ . 2484)]) #@10 (fn S) (defalias 'helm-xcdoc--remove-hash #[257 "\300\301\302#\207" [replace-regexp-in-string "#//.*" ""] 5 (#$ . 2703)]) #@12 (fn RES) (defalias 'helm-xcdoc--construct-candidates-from-command-res #[257 "\300\301\"\302\303\"\262\304\305\304\306\"\"\262\307\310!\311\"\207" [split-string "\n" cl-remove-if-not #[257 "\300\301\"\207" [string-match ".*\\.html.*"] 4 "\n\n(fn S)"] mapcar #[257 "\300\301\302\"!@\207" [last split-string " "] 5 "\n\n(fn S)"] helm-xcdoc--remove-hash sort delete-dups string<] 7 (#$ . 2834)]) #@14 (fn S1 S2) (defalias 'helm-xcdoc--catdir #[514 "\300\301\302#\300\303\302#\304Q\207" [replace-regexp-in-string "/$" "" "^/" "/"] 7 (#$ . 3242)]) #@18 (fn FILE-PATH) (defalias 'helm-xcdoc--extract-html #[257 "\301\211\302!\"\207" [helm-xcdoc-document-path #[514 "\300\211\301\"\"\207" [helm-xcdoc--catdir "Contents/Resources/Documents/"] 6 "\n\n(fn DOCPATH HTML-RETURN-SEARCH)"] expand-file-name] 5 (#$ . 3399)]) #@18 (fn FILE-PATH) (defalias 'helm-xcdoc--open-eww #[257 "\203p\301\302!!\210\303!\210\304\305!\207\301\302!!\207" [helm-xcdoc--use-otherwin eww-open-file helm-xcdoc--extract-html switch-to-buffer pop-to-buffer "*eww*"] 5 (#$ . 3673)]) #@18 (fn FILE-PATH) (defalias 'helm-xcdoc--open-eww-other-window #[257 "\301\302!)\207" [helm-xcdoc--use-otherwin t helm-xcdoc--open-eww] 3 (#$ . 3919)]) (defalias 'helm-xcdoc--search-init #[0 "r\305\306!q\210\211\307\310\311\312 \f\"!\"\210\313 G\314U\205!\315\316 \"+\207" [buffer-file-coding-system coding-system-for-write coding-system-for-read helm-xcdoc--query helm-xcdoc-document-path helm-candidate-buffer global mapc #[257 "\211\300Pc\207" ["\n"] 3 "\n\n(fn ROW)"] helm-xcdoc--construct-candidates-from-command-res helm-xcdoc--excecute-search buffer-string 0 error "No output: '%s'"] 7]) (defvar helm-xcdoc--open-eww-action '(("Open eww" . helm-xcdoc--open-eww) ("Open eww other window" . helm-xcdoc--open-eww-other-window))) (defvar helm-source-xcdoc-search (helm-make-source "Xcode Document List" 'helm-source-in-buffer :init 'helm-xcdoc--search-init :candidate-number-limit helm-xcdoc-maximum-candidates :action helm-xcdoc--open-eww-action)) #@38 (fn SRCS QUERY &optional OTHERWIN) (defalias 'helm-xcdoc--search-prepare #[770 "\303\304!\305\230\203\211\204\306\307!\210\305\230\203\211\202\310\311\312#\210\313\314\315\n$\207" [helm-xcdoc--query helm-xcdoc--use-otherwin helm-xcdoc--buffer thing-at-point symbol "" error "Input is empty!!" helm-xcdoc-log 3 "helm-xcdoc--query %s" helm :sources :buffer] 9 (#$ . 4883)]) (defalias 'helm-xcdoc--prompt #[0 "\300\301!\211\203\302\303\304\"!\207\302\305!\207" [thing-at-point symbol read-string format "Search word(default \"%s\"): " "Search word: "] 5]) #@35 search xcode document (fn QUERY) (defalias 'helm-xcdoc-search #[257 "\300\301\"\207" [helm-xcdoc--search-prepare (helm-source-xcdoc-search)] 4 (#$ . 5464) (byte-code "\300 C\207" [helm-xcdoc--prompt] 1)]) #@53 search xcode document with other-window (fn QUERY) (defalias 'helm-xcdoc-search-other-window #[257 "\300\301\302#\207" [helm-xcdoc--search-prepare (helm-source-xcdoc-search) t] 5 (#$ . 5677) (byte-code "\300 C\207" [helm-xcdoc--prompt] 1)]) (provide 'helm-xcdoc)