Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TC and SC are supported at the same time #7

Open
con5tella opened this issue Jan 9, 2017 · 4 comments
Open

TC and SC are supported at the same time #7

con5tella opened this issue Jan 9, 2017 · 4 comments

Comments

@con5tella
Copy link
Contributor

偶尔需要处理简体、繁体不同字形的文档,这时需要改配置才能切换,能不能加一个同时支持两种模式的函数,根据需要可以选「sc-only」、「tc-only」、「both-sc&tc」三种情况。
谢谢!

@cute-jumper
Copy link
Owner

我不太明白「tc-only」:不应该简体和繁体是有一部分重合的吗?如何做到「tc-only」?

另外我觉得如果你需要新的命令的话,可以自己包装一下,临时将 ace-pinyin-simplified-chinese-only-p 设成你需要的值就行。

比如如果你想让body里的命令只跳转到简体字:

(let ((ace-pinyin-simplified-chinese-only-p t))
  body)

@con5tella
Copy link
Contributor Author

我的意思是这样的,比如「设成」这个词,如果 (setq ace-pinyin-simplified-chinese-only-p nil) ,「c」到「成」没问题,简繁字形一样;而「s」只能到「設」、到不了「设」。我有一些音韵学的笔记和专业课的资料分别是繁体和简体管理的,就需要不断把上面那句配置注释掉、再反过来,这样很不方便。所以想加上像「both-sc&tc」这样的命令。
我 elisp 很渣,大多语句也不会写。谢指点,待我再折腾一下。

@cute-jumper
Copy link
Owner

所以想加上像「both-sc&tc」这样的命令

这个倒不难,你把 https://github.com/cute-jumper/pinyinlib.el 里面的两个 table 合并一下,去重,应该就行了。这个最好在 https://github.com/cute-jumper/pinyinlib.el 中先修改,后面在 ace-pinyin 中做适配。

我 elisp 很渣,大多语句也不会写。谢指点,待我再折腾一下。

很简单。比如,你想让avy-goto-word-0变成一个总是跳到简体字命令,函数定义如下:

(let ((ace-pinyin-simplified-chinese-only-p t))
  (avy-goto-word-0))

@lyserenity
Copy link

我刚好也有这个需求,但我不会 elisp ,所以只能合并去重,然后放在 pinyinlib--traditional-char-table 这个 table 里 (繁简混合 pinyinlib)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants