保存,关闭和重新打开文件后,Emacs按钮不起作用

时间:2015-01-25 16:13:04

标签: emacs

我在.emacs中添加了以下代码,以便在按下Shift-F10时创建按钮:

(require 'button)
(global-set-key (kbd "<S-f10>")
                (lambda ()
                  (interactive nil)
                  (insert-button 
                   "Open and search file." 
                   'action (lambda (x) (find-file "~/org/bib.org") (isearch-forward)))
                  )
                )

当我在包含文件的缓冲区中按Shift-F10时,按钮会插入,标签会突出显示并且工作正常。但是,如果我保存,关闭并重新打开文件,则按钮标签不会突出显示,按钮也不起作用。

文件关闭并重新打开后,为什么它不起作用?

1 个答案:

答案 0 :(得分:1)

即使将缓冲区保存在文件中,插入缓冲区的按钮也不会持久存在。