emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)

Vim、Emacs配置和使用
回复
头像
anix
帖子: 88
注册时间: 2009-05-18 22:33
联系:

emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)

#1

帖子 anix » 2011-11-11 19:45

代码: 全选

(defun my-ac-expand-snippets ()
  "补全单词和诗句,也可用于补全其他文本片段,默认键绑定设为C-M-/"
  (interactive)
  (find-file-noselect "~/workspace/my-snippets/words-en.txt")
  (find-file-noselect "~/workspace/my-snippets/poem-zh.txt")
  (call-interactively 'ac-complete-words-in-all-buffer))
(global-set-key (kbd "C-M-/") 'ac-expand-snippets)
(define-key org-mode-map (kbd "C-M-/") 'my-ac-expand-snippets);;#FIXME:org-mode-map失效!
使用C-h v org-mode-map显示为不匹配
但是用semantic语义分析补全时却有org-mode-map的选项,这是怎么回事?
我用的org-mode是7.7-1,官方版本,非emacs集成版.
I firmly believe that the Internet and knowledge should be open, public, and accessible to everyone without any restrictions.
头像
tangboyun
帖子: 701
注册时间: 2009-07-25 1:57
联系:

Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)

#2

帖子 tangboyun » 2011-11-12 18:34

(org-defkey org-mode-map (kbd "C-M-/") 'my-ac-expand-snippets)
https://github.com/tangboyun
http://tangboyun.is-programmer.com/
提问的智慧————Eric Steven Raymond
回答的智慧————Andrew Clarke
吾尝终日而思矣,不如须臾之所学也;吾尝跂而望矣,不如登高之博见也。
急急急标题什么的,最讨厌了!
急急复急急,急急何其多,我生待急急,万事急急急。
头像
anix
帖子: 88
注册时间: 2009-05-18 22:33
联系:

Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)

#3

帖子 anix » 2011-11-12 23:10

tangboyun,

代码: 全选

Symbol's function definition is void: org-defkey

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.
Starting Emacs daemon.
I firmly believe that the Internet and knowledge should be open, public, and accessible to everyone without any restrictions.
头像
tangboyun
帖子: 701
注册时间: 2009-07-25 1:57
联系:

Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)

#4

帖子 tangboyun » 2011-11-12 23:53

这函数是定义在org.el里的,检查你的载入是否有问题,我这边ok阿,用的也是7.7

代码: 全选

;; in org.el
(defun org-defkey (keymap key def)
  "Define a key, possibly translated, as returned by `org-key'."
  (define-key keymap (org-key key) def))
https://github.com/tangboyun
http://tangboyun.is-programmer.com/
提问的智慧————Eric Steven Raymond
回答的智慧————Andrew Clarke
吾尝终日而思矣,不如须臾之所学也;吾尝跂而望矣,不如登高之博见也。
急急急标题什么的,最讨厌了!
急急复急急,急急何其多,我生待急急,万事急急急。
头像
anix
帖子: 88
注册时间: 2009-05-18 22:33
联系:

Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)

#5

帖子 anix » 2011-11-13 0:27

tangboyun,
犯了个愚蠢的错误:
载入顺序问题.
绑定放在了(require 'org-install)前面,移动到后面一切正常.
.

代码: 全选

(define-key org-mode-map (kbd "C-M-/") 'my-ac-expand-snippets)
亦可使用.
thanks.
I firmly believe that the Internet and knowledge should be open, public, and accessible to everyone without any restrictions.
回复