一月 13, 2009

eval-after-load

当我使用wl-install-elisp-from-emacswiki更新anythinganything-config之后,发现我对它们做的定制不见了。

解决方法是使用eval-after-load,在每次加载一个文件的时候运行一段代码,如下:

(eval-after-load 'anything
  '(progn
     (setq anything-enable-digit-shortcuts t)
     (global-set-key (kbd "<f9>") 'anything)))

(eval-after-load 'anything-config
  '(add-to-list 'anything-sources anything-c-source-file-cache))

注意,第二个参数是个list,一定要quote,不然他们会立刻执行。

5 条评论:

时间 1:19 下午 , Anonymous 匿名 说...

anything主要是做什么的?

 
时间 2:30 下午 , Blogger netcasper 说...

偷懒了 :-)

链接加上了。

 
时间 12:07 上午 , Anonymous 匿名 说...

I wish not acquiesce in on it. I over nice post. Particularly the title-deed attracted me to study the sound story.

 
时间 8:34 下午 , Anonymous 匿名 说...

Amiable brief and this post helped me alot in my college assignement. Gratefulness you seeking your information.

 
时间 8:29 上午 , Anonymous 匿名 说...

Opulently I to but I about the collection should secure more info then it has.

 

发表评论

指向此帖子的链接:

创建链接

<< 主页