;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313&\210\314\315\303\316#\210\302\317\304\305\320DD\321\310\311\312\322&\210\302\323\304\305\324DD\325\310\311\312\322&\210\302\326\304\305\327DD\330\310\311\312\322&\210\302\331\304\305\332DD\333\310\311\312\334&\207" [require cl-lib custom-declare-variable liberime-after-start-hook funcall function #[0 "\300\207" [nil] 1] "List of functions to be called after liberime start." :group liberime :type hook make-obsolete-variable after-liberime-load-hook "2019-12-13" liberime-module-file #[0 "\300\207" [nil] 1] "Liberime module file on the system.\nWhen it is nil, librime will auto search module in many path." file liberime-shared-data-dir #[0 "\300\207" [nil] 1] "Data directory on the system.\n\nMore info: https://github.com/rime/home/wiki/SharedData" liberime-user-data-dir #[0 "\300\301!\207" [locate-user-emacs-file "rime/"] 2] "Data directory on the user home directory." liberime-auto-build #[0 "\300\207" [nil] 1] "If set to t, try build when module file not found in the system." boolean] 8) #@41 Timer used by `liberime-select-schema'. (defvar liberime-select-schema-timer nil (#$ . 1163)) #@50 The rime schema set by `liberime-select-schema'. (defvar liberime-current-schema nil (#$ . 1263)) #@39 Return the liberime package direcory. (defalias 'liberime-get-library-directory #[0 "\300\301!\206 \300\302!\211\205\303!\205\304!\207" [locate-library "liberime" "liberime-config" file-exists-p file-name-directory] 3 (#$ . 1367)]) #@129 Find directories listed in NAMES from PARENT-DIRS. if NAMES is nil, "rime-data" as fallback. (fn PARENT-DIRS &optional NAMES) (defalias 'liberime-find-rime-data #[513 "\300\301\302\"\303\304\305\306!\203\307\306 \"\202\"\"\207" [cl-some make-closure #[257 "\301\302\303\"\300\206\n\304\"\207" [V0 cl-some make-closure #[257 "\301\300!P\302!\205\f\211\207" [V0 file-name-as-directory file-directory-p] 4 "\n\n(fn NAME)"] ("rime-data")] 5 "\n\n(fn PARENT)"] remove nil fboundp xdg-data-dirs append] 9 (#$ . 1613)]) #@29 Return user data directory. (defalias 'liberime-get-shared-data-dir #[0 "\206; \302\267\2025\303\304!\2026\305\207\303\306\307!\211\205'\310!\205'\311\312!\313P!\262\314\315\316\317\320\257\321\"\2026\322\206;\323 \207" [liberime-shared-data-dir system-type #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (quote 10 gnu/linux 10 darwin 16 windows-nt 18)) liberime-find-rime-data ("/usr/share/local" "/usr/share") "/Library/Input Methods/Squirrel.app/Contents/SharedSupport" executable-find "emacs" file-exists-p expand-file-name file-name-directory "../share" "c:/" "d:/" "e:/" "f:/" "g:/" ("rime-data" "msys32/mingw32/share/rime-data" "msys64/mingw64/share/rime-data") nil liberime-get-user-data-dir] 7 (#$ . 2147)]) #@53 Return user data directory, create it if necessary. (defalias 'liberime-get-user-data-dir #[0 "\301!\302!\204 \303!\210\207" [liberime-user-data-dir expand-file-name file-directory-p make-directory] 3 (#$ . 2920)]) #@51 Open DIRECTORY with external app. (fn DIRECTORY) (defalias 'liberime-open-directory #[257 "\302!\303!\205/\304\230\203\305\306\"\207\307\230\203 \310\311!P\207\312\230\205/\313\314\315\313\316$)\207" [system-type process-connection-type expand-file-name file-directory-p "windows-nt" w32-shell-execute "open" "darwin" "open " shell-quote-argument "gnu/linux" nil start-process "" "xdg-open"] 7 (#$ . 3145)]) #@39 Open user data dir with external app. (defalias 'liberime-open-user-data-dir #[0 "\300\301 !\207" [liberime-open-directory liberime-get-user-data-dir] 2 (#$ . 3574) nil]) #@41 Open shared data dir with external app. (defalias 'liberime-open-shared-data-dir #[0 "\300\301 !\207" [liberime-open-directory liberime-get-shared-data-dir] 2 (#$ . 3751) nil]) #@52 Open liberime library directory with external app. (defalias 'liberime-open-package-directory #[0 "\300\301 !\207" [liberime-open-directory liberime-get-library-directory] 2 (#$ . 3934) nil]) #@35 Open liberime library README.org. (defalias 'liberime-open-package-readme #[0 "\300\301 \302P!\207" [find-file liberime-get-library-directory "README.org"] 3 (#$ . 4132) nil]) #@29 Build liberime-core module. (defalias 'liberime-build #[0 "\304\305!\306 \211\203\307!\204\310\311!\207\310\312!\210rq\210\313 \210\314c\210\204(\315c\210\316\317!\2041\320c\210\316\321!\204:\322c\210)\211 \323=\203F\324\202G\325\326\327\330\206O\331\"\332\333\334\335\336!\206Z\337#\340!\341P\342\343P!\203q\344\345Q\266\202\202y\346\347\n!\345Q\266\202\350\351!\211\203\222\352\353\354\355\356 \357\260 \202\223\345\262\360\260\361\362\363\"r\211q\210\364\365\"\216c\210\366ed\367P\370\371%\210*\210\372\373\374\375\321\374$\364\376\"\")\207" [module-file-suffix system-type emacs-major-version default-directory get-buffer-create "*liberime build help*" liberime-get-library-directory file-directory-p message "Liberime: library directory is not found." "Liberime: start build liberime-core module ..." erase-buffer "* Liberime build help" "** Your emacs do not support dynamic module.\n" executable-find "gcc" "** You should install gcc." "make" "** You should install make." windows-nt "LIBRIME = -llibrime\n" "LIBRIME = -lrime\n" "CC = gcc\nLDFLAGS = -shared\nSRC = src\nSOURCES = $(wildcard $(SRC)/*.c)\nOBJS = $(patsubst %.c, %.o, $(SOURCES))\n" format "TARGET = $(SRC)/liberime-core%s\n" ".so" replace-regexp-in-string "/share/emacs/.*" "" locate-library "files" "/usr" file-name-as-directory "include/" file-exists-p "emacs-module.h" "CFLAGS = -fPIC -O2 -Wall -I " "\n" "CFLAGS = -fPIC -O2 -Wall -I emacs-module/" number-to-string getenv "RIME_PATH" "CFLAGS += -I " "/src/\nLDFLAGS += -L " "/build/lib/ -L " "/build/lib/Release/\nLDFLAGS += -Wl,-rpath," "/build/lib/:" "/build/lib/Release\n" ".PHONY:all objs\nall:$(TARGET)\nobjs:$(OBJS)\n$(TARGET):$(OBJS)\n $(CC) $(OBJS) $(LDFLAGS) $(LIBRIME) $(LIBS) -o $@" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] write-region "Makefile-liberime-build" nil :silent set-process-sentinel start-process "liberime-build" "*liberime build*" #[514 "\301!\302=\205!\303!\304U\203\305 \210\306\307!\207\310\300!\210\311\312\303!\"\207" [V0 process-status exit process-exit-status 0 liberime-load message "Liberime: load liberime-core module successful." pop-to-buffer error "Liberime: building failed with exit code %d"] 6 "\n\n(fn PROC EVENT)"]] 19 (#$ . 4314) nil]) #@34 Return t when liberime can work. (defalias 'liberime-workable-p #[0 "\300\301!\207" [featurep liberime-core] 2 (#$ . 6642)]) #@17 Start liberime. (defalias 'liberime--start #[0 "\301 \302 \303\304#\210\305\"\210\203\306!\210\307\310!\207" [liberime-current-schema liberime-get-shared-data-dir liberime-get-user-data-dir message "Liberime: start with shared dir %S, user dir: %S" liberime-start liberime-try-select-schema run-hooks liberime-after-start-hook] 6 (#$ . 6773)]) #@28 Load liberime-core module. (defalias 'liberime-load #[0 "\203\303!\203\304\305!\204\306!\210\307 \211\310P\311PE\312\305\313\314#\210)\210\304\305!\2030\315 \207\n\2037\316 \207\317\320!r\211q\210\321 \210\322c\210eb\210)\323!\207" [liberime-module-file load-path liberime-auto-build file-exists-p featurep liberime-core load-file liberime-get-library-directory "src" "build" require nil t liberime--start liberime-build get-buffer-create "*liberime load*" erase-buffer "Liberime: Fail to load liberime-core module, try to run command: (liberime-build)" pop-to-buffer] 5 (#$ . 7131) nil]) (liberime-load) #@19 Get rime preedit. (defalias 'liberime-get-preedit #[0 "\300 \301\302\"\301\303\"\207" [liberime-get-context alist-get composition preedit] 5 (#$ . 7757)]) #@34 Get rime page size from context. (defalias 'liberime-get-page-size #[0 "\300 \301\302\"\301\303\"\207" [liberime-get-context alist-get menu page-size] 5 (#$ . 7920)]) #@237 Select rime candidate cross page. This function is different from `liberime-select-candidate', When NUM > page size, `liberime-select-candidate' do nothing, while this function will go to proper page then select a candidate. (fn NUM) (defalias 'liberime-select-candidate-crosspage #[257 "\300 S\211\245\246\301\302!\210\303\211W\203#\304\301\305!\266\211T\262\202\266\306!\207" [liberime-get-page-size liberime-process-key 65360 0 nil 65366 liberime-select-candidate] 10 (#$ . 8096)]) #@32 Clear the lastest rime commit. (defalias 'liberime-clear-commit #[0 "\300 \207" [liberime-get-commit] 1 (#$ . 8602)]) #@47 Deploy liberime to affect config file change. (defalias 'liberime-deploy #[0 "\300 \210\301 \207" [liberime-finalize liberime--start] 1 (#$ . 8726) nil]) #@161 Set rime page-size to PAGE-SIZE or by default 10. you also need to call `liberime-deploy' to make it take affect you only need to do this once. (fn PAGE-SIZE) (defalias 'liberime-set-page-size #[257 "\300\301\302\206\303\304$\207" [liberime-set-user-config "default.custom" "patch/menu/page_size" 10 "int"] 6 (#$ . 8887) "P"]) #@59 Try to select rime schema with SCHEMA_ID. (fn SCHEMA_ID) (defalias 'liberime-try-select-schema #[257 "\302C\303\304!\205 \203\305 !\210\306\302\307\310\311##\312\207" [liberime-current-schema liberime-select-schema-timer 1 featurep liberime-core cancel-timer run-with-timer 2 make-closure #[0 "\303\304\3051\f\306 0\202\210\307\"\211\300\232\204\301\242\310V\203=\301\242\310V\203+\311\312\300\"\210\2020\311\313\300\"\210\311\314!\210\315\n!\210\307\202Q\311\316\301\242\300#\210\3171P\320\300!0\210\202Q\210\301\211\242T\240\207" [V0 V1 liberime-select-schema-timer alist-get schema_id (error) liberime-get-status nil 10 message "Liberime: fail to select schema %S." "Liberime: success to select schema %S." "" cancel-timer "Liberime: try (n=%s) to select schema %S ..." (error) liberime-select-schema] 5] t] 9 (#$ . 9224)]) #@35 Select a rime schema interactive. (defalias 'liberime-select-schema-interactive #[0 "\300\301\3021\f\303 0\202\210\304\"\211\203\"\305\306\"\307\304\211\310%\311!\207\312\313!\207" [mapcar #[257 "\300\301A@@#@B\207" [format "%s(%s)"] 5 "\n\n(fn X)"] (error) liberime-get-schema-list nil completing-read "Rime schema: " alist-get equal liberime-try-select-schema message "Liberime: no schema has been found, ignore."] 8 (#$ . 10081) nil]) #@116 Sync rime user data. User should specify sync_dir in installation.yaml file of `liberime-user-data-dir' directory. (defalias 'liberime-sync #[0 "\300 \207" [liberime-sync-user-data] 1 (#$ . 10537) nil]) (provide 'liberime)