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

Support Emacs with a minor mode #1

Open
stardiviner opened this issue Jul 31, 2017 · 1 comment
Open

Support Emacs with a minor mode #1

stardiviner opened this issue Jul 31, 2017 · 1 comment

Comments

@stardiviner
Copy link

我之前看过一个用Python还是啥的声音控制Emacs编程的,在youtube上。这是链接 https://www.youtube.com/watch?v=8SkdfdXWYaI 。还有博文的链接 http://puntoblogspot.blogspot.com/2013/03/keyboardless-programming.html 。 我记录在Org-mode里面,都很久了。觉得很厉害。不明觉厉。但是由于安装,使用,等等都非常麻烦。尤其是语音识别在Linux上没啥特别好的软件。所以就放弃了。作者的方案安装起来也是很繁琐。很讨厌繁琐的安装。

最好这个Emacs minor mode能够提供一个简单的借口,比如 xunfei-start. 然后后台启动所有必须的东西,检查所有的东西,比如麦克风,等等之类的。不知道Emacs有没有这个检查。就算没有,也能通过shell返回检查结果。虽然这样有点粗糙。(个人观点)。如果需要下载讯飞SDK包,那么是否可以在Emacs包里面提供命令去自动下载安装?
以及一个核心借口 比如 xunfei-voice 这个接口用来被调用,比如用来翻译语音成文字,或者接受命令,将命令转发给其他程序。或者是将文字发送给这个API,让它读出来。

BTW:

  • 问一下这个讯飞SDK是离线的还是需要连接网络去分析语音的?
  • 看上去这个包是必须在Clojure上运行,那么它应该必须启动。怎么伴随CIDER启动呢?我通常会随Emacs启动自动启动一个CIDER REPL session,给Org-mode Babel用。对于伴随CIDER启动,我有一个解决方案。是我自己在用的。
(defun my/cider-repl-eval (input)
    "Execute Clojure `INPUT' in CIDER REPL.

Usage: (my/cider-repl-eval \"\(clojure expr\)\")"
    (notifications-notify
     :title "CIDER nREPL evaluation starting."
     :body input)
    (cider-interactive-eval input
                            #'(lambda (event)
                                (notifications-notify
                                 :title "CIDER form evaluation finished.")))
    (sit-for 5)
    )

(add-hook 'cider-connected-hook
            #'(lambda ()
                (sit-for 10)
                (my/cider-repl-eval "(import [java.io.File])") ; import Java object static methods like `.getCanonicalFile'.
                (my/cider-repl-eval "(use '(incanter core stats datasets charts io pdf))")
                ) t)
@chanshunli
Copy link
Member

@stardiviner 👍

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

2 participants