;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\312%\210\313\314\315\316\317DD\320\321\322%\207" [require cl-lib pyim-pymap xr rx custom-declare-group pyim-cregexp nil "Chinese regexp tools for pyim." :group pyim custom-declare-variable pyim-cregexp-fallback-scheme funcall function #[0 "\300\207" [quanpin] 1] "`pyim-cregexp-build' 使用的 Fallback scheme.\n\n如果 `pyim-cregexp-build' 无法支持用户正在使用的 scheme 时,\n将使用这个 scheme." :type symbol] 6) #@163 根据 STRING 构建一个中文 regexp, 用于 "拼音搜索汉字". 比如:"nihao" -> "[你呢...][好号...] \| nihao" (fn STRING &optional CHAR-LEVEL-NUM) (defalias 'pyim-cregexp-build #[513 "\300\232\203\207\211\206 \301\211\302U\203\2026\30314\304\305\306\307\310\311\312!\313\"\314\315%\316!\"!0\2026\210\317\211\203Q\211;\203Q\320!\203I\211\202R\321S\"\202R\207" ["" 3 0 (error) rx-to-string pyim-cregexp-build-from-rx make-byte-code 257 "\211;\203\f\301\302\300\"!\207\207" vconcat vector [xr pyim-cregexp-build-1] 5 "\n\n(fn X)" xr nil pyim-cregexp-valid-p pyim-cregexp-build] 11 (#$ . 928)]) #@56 Return t when cregexp is a valid regexp. (fn CREGEXP) (defalias 'pyim-cregexp-valid-p #[257 "\211\205\211;\205\3011\211\302\303\304\305#)\266\3040\207\210\303\207" [inhibit-changing-match-data (error) "" nil t string-match] 8 (#$ . 1566)]) #@19 (fn FN RX-FORM) (defalias 'pyim-cregexp-build-from-rx #[514 "\211\204\300\207\211:\2037\211@A\211\204!\262\2026\301=\203&\2026\302\303\304\305\306\307 !\310\"\311\312%\"\207!\207" [nil any mapcar make-byte-code 257 "\301\300\"\207" vconcat vector [pyim-cregexp-build-from-rx] 4 "\n\n(fn X)"] 11 (#$ . 1824)]) #@37 (fn STR &optional CHAR-LEVEL-NUM) (defalias 'pyim-cregexp-build-1 #[513 "\301 C\302\242\303\"\302\242\304\"\305\306\307\310\311\312\313Q #\"\"\203,\314V\203,\314\202;\203:\315W\203:\315\202;\316 \210\317\235\204H\240\210\320\321\322\323\324\325    $\326\"\327\330%\307#\207" [pyim-cregexp-fallback-scheme pyim-scheme-name pyim-scheme-get-option :class :code-prefix "#####&&&&#####" remove #1="" split-string replace-regexp-in-string "\\([a-z]+'*\\)" "\\1" 3 1 pyim-dcache-init-variables (quanpin shuangpin xingma) mapconcat make-byte-code 257 "\304\305\"\204 \211\306\232\203\207\307\310\306#\311\300\242\"\312\313\314\315\316\317\301\302\303#\320\"\321\322%\"\211\2055\323\324\325\326\"\327#\211G\330V\203S\232\203I\327Q\202T\327\327\260\202T\331\332\"\207" vconcat vector [pyim-string-match-p "[^a-z']+" #1# replace-regexp-in-string "'" pyim-imobjs-create mapcar make-byte-code 257 "\300\303=\203\304\305\211\211\301%\207\306\305\211\211\302%\207" vconcat vector [xingma pyim-cregexp-build:xingma nil pyim-cregexp-build:quanpin] 7 "\n\n(fn IMOBJ)" mapconcat identity delq nil "\\|" 0 format "\\(?:%s\\)"] 12 "\n\n(fn STRING)"] 18 (#$ . 2161)]) #@122 从 IMOBJ 创建一个搜索中文的 regexp. (fn IMOBJ &optional MATCH-BEGINNING FIRST-EQUAL ALL-EQUAL CHAR-LEVEL-NUM) (defalias 'pyim-cregexp-build:quanpin #[1281 "\300\301\"\302\303\211\203C\211@\206\205\302U\304\305\306\307\310\311\f!\312\"\313\314%\315\303\316$\317#\211B\262\266T\262A\266\202\202\210\211\237\266\202\304\320\317#\211\317\232?\205`\203]\321\202^\317P\207" [mapcar #[257 "\211@A@P\207" [] 3 "\n\n(fn X)"] 0 nil mapconcat make-byte-code 257 "\301\302\303\304\305\"\306\300#\307#\207" vconcat vector [mapconcat identity cl-subseq split-string "|" 0 #1=""] 7 "\n\n(fn X)" pyim-pymap-py2cchar-get t #1# #[257 "\300\301\"\205 \302\303\"\207" [pyim-string-match-p "\\cc" format "[%s]"] 4 "\n\n(fn X)"] "^"] 18 (#$ . 3370)]) #@119 从 IMOBJ 创建一个搜索中文的 regexp. (fn IMOBJ &optional MATCH-BEGINNING FIRST-EQUAL ALL-EQUAL CODE-PREFIX) (defalias 'pyim-cregexp-build:xingma #[1281 "\300\301\302\303\304\305\306 #\307\"\310\311%\312#\211\312\232?\205)\203&\313\202'\312P\262\207" [#[257 "\300\301\302\303\"\"\304\305\211W\203=\211\306\307\310\311\312\313\314\315!\316\"\317\320% \321#\305V\203/\322\2020\321#B\262\210\211T\262\202\n\266\310\323\324!\321#\207" [apply max mapcar length nil 0 format "[%s]%s" mapconcat make-byte-code 257 "\300GSV\203\n\301\207\302\300\234!\207" vconcat vector [#1="" char-to-string] 4 "\n\n(fn X)" #1# "?" identity reverse] 15 "\n\n(fn LIST)"] mapconcat make-byte-code 257 "\301\206\303\300\203\304\305O\202P\302\306!!\207" vconcat vector [#1# 0 1 pyim-dcache-get] 5 "\n\n(fn X)" #1# "^"] 15 (#$ . 4153)]) (byte-code "\300\301\302\303#\210\304\301\302\305#\207" [defalias pyim-convert-cregexp-at-point pyim-cregexp-convert-at-point nil make-obsolete "4.0"] 4) #@275 将光标前的字符串按拼音的规则转换为一个搜索中文的 regexp. 用于实现拼音搜索中文的功能。 在 minibuffer 中,这个命令默认会自动运行 `exit-minibuffer'. 这个可以使用 INSERT-ONLY 参数控制。 (fn &optional INSERT-ONLY) (defalias 'pyim-cregexp-convert-at-point #[256 "\303\232\204\n\304\305!\210ed{ \203\306\307 \310 \"\202#`\212\311\312!\210`){\211G\313!\314[!\210\315 \203K\316\317\320\321#)\266\203\203K\322\323\"c\210\202N\211c\210?\205Z\315 \205Z\324 \207" [input-method-function mark-active inhibit-changing-match-data pyim-input-method activate-input-method pyim buffer-substring-no-properties region-beginning region-end skip-syntax-backward "w" pyim-cregexp-build delete-char window-minibuffer-p "\\[\\+-]Word/{Regexp}" nil t string-match format "{%s}" exit-minibuffer] 12 (#$ . 5173) "P"]) #@126 这个函数为 isearch 相关命令添加中文拼音搜索功能, 做为 `isearch-search-fun' 函数的 advice 使用。 (defalias 'pyim-cregexp-isearch-search-fun #[0 "\301\302\303\304\305BB\306BBE\207" [isearch-forward lambda (string &optional bound noerror count) funcall if ('re-search-forward 're-search-backward) ((pyim-cregexp-build string) bound noerror count)] 6 (#$ . 6053)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317& \207" [custom-declare-variable pyim-isearch-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Pyim-Isearch mode is enabled.\nSee the `pyim-isearch-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `pyim-isearch-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :group pyim-isearch :type boolean :require pyim] 14) #@71 这个 mode 为 isearch 添加拼音搜索功能. (fn &optional ARG) (defalias 'pyim-isearch-mode #[256 "\301 \302\300\303=\203\304\300!?\202\305!\306V\"\210\203)\307\310\311\312#\210\313\314!\210\202.\315\310\312\"\210\316\317\304\300!\203:\320\202;\321\"\210\322\323!\203e\324\300!\210\301 \203S\211\301 \232\203e\325\313\326\304\300!\203`\327\202a\330#\266\210\331 \210\304\300!\207" [pyim-isearch-mode current-message set-default toggle default-value prefix-numeric-value 0 advice-add isearch-search-fun :override pyim-cregexp-isearch-search-fun message "PYIM: `pyim-isearch-mode' 已经激活,激活后,一些 isearch 扩展包有可能失效。" advice-remove run-hooks pyim-isearch-mode-hook pyim-isearch-mode-on-hook pyim-isearch-mode-off-hook called-interactively-p any customize-mark-as-set "" "Pyim-Isearch mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 7016) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)]) (defvar pyim-isearch-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\311\211%\210\312\313\314\311#\210\315\313\314\316#\207" [pyim-isearch-mode-map pyim-isearch-mode-hook variable-documentation put "Hook run after entering or leaving `pyim-isearch-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode pyim-isearch-mode " pyim-isearch" boundp nil defalias pyim-ivy-cregexp pyim-cregexp-ivy make-obsolete "4.0"] 6) #@63 Let ivy support search Chinese with pinyin feature. (fn STR) (defalias 'pyim-cregexp-ivy #[257 "\301!\302\211<\203\303\304\"\202\305!)\207" [case-fold-search ivy--regex-plus nil mapcar #[257 "\211A\203\211@\300\232\203\300\202\301@!AD\207\301@!C\207" ["" pyim-cregexp-build] 3 "\n\n(fn Y)"] pyim-cregexp-build] 5 (#$ . 8546)]) (provide 'pyim-cregexp)