分页: 1 / 1
emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)
发表于 : 2011-11-11 19:45
由 anix
代码: 全选
(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集成版.
Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)
发表于 : 2011-11-12 18:34
由 tangboyun
(org-defkey org-mode-map (kbd "C-M-/") 'my-ac-expand-snippets)
Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)
发表于 : 2011-11-12 23:10
由 anix
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.
Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)
发表于 : 2011-11-12 23:53
由 tangboyun
这函数是定义在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))
Re: emacs:org-mode-map被去掉了么?(另+一个补全诗句的笨方法)
发表于 : 2011-11-13 0:27
由 anix
tangboyun,
犯了个愚蠢的错误:
载入顺序问题.
绑定放在了(require 'org-install)前面,移动到后面一切正常.
.
代码: 全选
(define-key org-mode-map (kbd "C-M-/") 'my-ac-expand-snippets)
亦可使用.
thanks.