如何在emacs中添加工具栏按钮? [英] How to add a tool-bar button in emacs?

查看:172
本文介绍了如何在emacs中添加工具栏按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在工具栏中添加一个按钮,但不起作用。
如何做,我检查Emacs维基,我什么也找不到。
我用emacs 24.3.1。
显示工具栏,但不显示我的新项目。

I try to add a button in the tool-bar but that doesn't works. how to do that, i check in Emacs wiki and i find nothing. I used emacs 24.3.1. The toolsbar are displayed but not my new item.

我可以使用eval-buffer运行它与我的.emacs或找到另一个解决方案来解决。
当我用eval-buffer添加它时,我的按钮在滚动后离开工具栏。

I can run it with eval-buffer but not with my .emacs or find another solution to resolve that. When i add it with eval-buffer my button leave my toolbar after a scroll.

(defun omar-hotel ()
 "another nonce menu function"
 (interactive)
 (message "hotel, motel, holiday inn"))

(define-key global-map [tool-bar omar-button]
'(menu-item "Hotel" omar-hotel
   :image (image :type xpm :file "/usr/share/emacs/24.3/etc/images/jump-to.xpm")
   )
)


推荐答案

我发现一个简单的解决方案来添加一个工具栏按钮spell是/usr/share/emacs/23.4/etc/images /

Hi i found a simple solution to add a toolbar button "spell" is the image in /usr/share/emacs/23.4/etc/images/

(defun omar-hotel ()
 "another nonce menu function"
 (interactive)
 (message "hotel, motel, holiday inn"))

    (tool-bar-add-item "spell" 'omar-hotel
               'omar-hotel
               :help   "Run fonction omar-hotel")

这篇关于如何在emacs中添加工具栏按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆