{"action":"closed","issue":{"url":"https://api.github.com/repos/tumashu/chinese-pyim/issues/96","repository_url":"https://api.github.com/repos/tumashu/chinese-pyim","labels_url":"https://api.github.com/repos/tumashu/chinese-pyim/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/tumashu/chinese-pyim/issues/96/comments","events_url":"https://api.github.com/repos/tumashu/chinese-pyim/issues/96/events","html_url":"https://github.com/tumashu/chinese-pyim/issues/96","id":154515973,"number":96,"title":"把高亮选择加入个人词库","user":{"login":"wrn","id":1781926,"avatar_url":"https://avatars.githubusercontent.com/u/1781926?v=3","gravatar_id":"","url":"https://api.github.com/users/wrn","html_url":"https://github.com/wrn","followers_url":"https://api.github.com/users/wrn/followers","following_url":"https://api.github.com/users/wrn/following{/other_user}","gists_url":"https://api.github.com/users/wrn/gists{/gist_id}","starred_url":"https://api.github.com/users/wrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wrn/subscriptions","organizations_url":"https://api.github.com/users/wrn/orgs","repos_url":"https://api.github.com/users/wrn/repos","events_url":"https://api.github.com/users/wrn/events{/privacy}","received_events_url":"https://api.github.com/users/wrn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-12T15:44:44Z","updated_at":"2016-05-13T13:27:07Z","closed_at":"2016-05-13T13:27:07Z","body":"\r\n对应pyim-delete-word-from-personal-buffer，我写了这个函数。\r\n\r\n```\r\n(defun pyim-create-word-from-selection ()\r\n    \"Add the selected text as a Chinese word into the personal dictionary.\"\r\n    (interactive)\r\n    (when (region-active-p)\r\n      (let ((string (buffer-substring-no-properties (region-beginning) (region-end))))\r\n        (if (> (length string) 6)\r\n            (error \"词条太长\")\r\n          (if (not (string-match-p \"^\\\\cc+\\\\'\" string))\r\n              (error \"不是纯中文字符串\")\r\n            (pyim-create-or-rearrange-word string)\r\n            (message \"将词条: \\\"%s\\\" 插入 personal file。\" string))))))\r\n```\r\n"}}