;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\303\304\305\306\307\310%\210\311\312\313\314\315DD\316\317\320%\210\311\321\313\314\322DD\323\317\324%\207" [require cl-lib pyim-common custom-declare-group pyim-punctuation nil "Punctuation libs for pyim." :group pyim custom-declare-variable pyim-punctuation-dict funcall function #[0 "\300\207" [(("'" "‘" "’") ("\"" "“" "”") ("_" "——") ("^" "…") ("]" "】") ("[" "【") ("@" "◎") ("?" "?") (">" "》") ("=" "=") ("<" "《") (";" ";") (":" ":") ("/" "、") ("." "。") ("-" "-") ("," ",") ("+" "+") ("*" "×") (")" ")") ("(" "(") ("&" "※") ("%" "%") ("$" "¥") ("#" "#") ("!" "!") ("`" "・") ("~" "~") ("}" "』") ("|" "÷") ("{" "『"))] 1] "标点符号表." :type list pyim-punctuation-half-width-functions #[0 "\300\207" [nil] 1] "让 pyim 输入半角标点.\n\n取值为一个函数列表,这个函数列表中的任意一个函数的运行结果为 t 时,\npyim 输入半角标点,函数列表中每个函数都有一个参数:char ,表示\n最后输入的一个字符,具体见: `pyim-process-outcome-handle-char' 。" (choice (const nil) (repeat function))] 6) #@283 这个变量的第一个元素的取值用于控制标点符号全角半角模式切换. 1. 当第一个元素为 'yes 时,输入全角标点。 2. 当第一个元素为 'no 时,输入半角标点。 3. 当第一个元素为 'auto 时,根据中英文环境,自动切换。 (defvar pyim-punctuation-translate-p '(auto yes no) (#$ . 1578)) #@33 成对标点符号切换状态. (defvar pyim-punctuation-pair-status '(("\"" nil) ("'" nil)) (#$ . 1931)) #@110 Punctuation will not insert after this characters. If you don't like this function, set the variable to nil (defvar pyim-punctuation-escape-list (number-sequence 48 57) (#$ . 2044)) (pyim-register-local-variables '(pyim-punctuation-translate-p pyim-punctuation-pair-status pyim-punctuation-escape-list pyim-punctuation-half-width-functions)) #@595 Pyim 标点符号全角半角模式切换命令. 每次运行 `pyim-punctuation-toggle' 命令,都会调整变量 `pyim-punctuation-translate-p' 的取值,`pyim-process-outcome-handle-char' 根据 `pyim-process-punctuation-full-width-p' 函数的返回值,来决定是否转换标点 符号: 1. 当返回值为 'yes 时,`pyim-process-outcome-handle-char' 转换标点符号,从而输入全角标点。 2. 当返回值为 'no 时,`pyim-process-outcome-handle-char' 忽略转换,从而输入半角标点。 3. 当返回值为 'auto 时,根据中英文环境,自动切换。 (defalias 'pyim-punctuation-toggle #[0 "\301A@C\"\302@\303\304\"\203\305\202)\303\306\"\203!\307\202)\303\310\"\205)\311\262!\207" [pyim-punctuation-translate-p append message eql yes "开启全角标点输入模式。" no "开启半角标点输入模式。" auto "开启全半角标点自动转换模式。"] 5 (#$ . 2394) nil]) #@166 切换光标处标点的样式(全角 or 半角). 用户也可以使用命令 `pyim-punctuation-translate-at-point' 来切换 *光标前* 标点符号的样式。 (defalias 'pyim-punctuation-translate-at-point #[0 "\301h!\302\303\304\305\306\307!\310\"\311\312%\"\211\205,\313\314!\210@\232\203)\315!c\202,\211@c\207" [pyim-punctuation-dict char-to-string cl-some make-byte-code 257 "\300\235\205\211\207" vconcat vector [] 3 "\n\n(fn X)" delete-char -1 pyim-punctuation-return-proper-punct] 8 (#$ . 3339) nil]) #@256 将光标前1个或前后连续成对的n个标点符号进行全角/半角转换. 当 PUNCT-STYLE 设置为 'full-width 时,所有的标点符号转换为全角符 号,设置为 'half-width 时,转换为半角符号。 (fn &optional PUNCT-STYLE) (defalias 'pyim-punctuation-translate #[256 "\301!\206 \302\303\304\305\"!\306\211`\307\211\31020\311!\211\235\203'T\262\202,\312\310\307\"\210\210\202\210\3102VX\205U\313!\211\235\203LT\262\202Q\312\310\307\"\210\210\20250\210^\262Z\\{\262\314!\210\314[!\210\315\316\"\211\203\327\211@\211\203\317\211@\317\320\321$\211\203\307\n\322=\203\252\211\306U\203\241\323!B\262\202\307B\262\202\307\n\324=\203\307\211\306U\203\300B\262\202\307@B\262\210A\266\202\202y\210A\266\202\202r\210\325\326\327!\316#c\210\206\346\330[u\207" [pyim-punctuation-dict flatten-tree intern completing-read "将光标处的标点转换为" ("full-width" "half-width") 0 nil break pyim-char-after-to-string throw pyim-char-before-to-string delete-char split-string "" cl-position :test equal full-width pyim-punctuation-return-proper-punct half-width mapconcat identity reverse 1] 17 (#$ . 3872) nil]) #@609 返回合适的标点符号,PUNCT-LIST 为标点符号列表. 这个函数用于处理成对的全角标点符号,简单来说:如果第一次输入的标 点是:(‘)时,那么下一次输入的标点就是(’)。 PUNCT-LIST 格式类似: `("," ",") 或者:`("'" "‘" "’") 当 BEFORE 为 t 时,只返回切换之前的结果,这个用来获取切换之前的 标点符号。 函数 `pyim-punctuation-return-proper-punct' 内部,我们使用变量 `pyim-punctuation-pair-status' 来记录 “成对” 中文标点符号的状态。 (fn PUNC-LIST &optional BEFORE) (defalias 'pyim-punctuation-return-proper-punct #[513 "@A\301\"A\302!\303U\203@\2027\203!\211?\262\202+\301\"\211?\241\266\211\2034@\2027A@\207" [pyim-punctuation-pair-status assoc safe-length 1] 8 (#$ . 5086)]) (provide 'pyim-punctuation)