我尝试在工具栏中添加一个按钮,但这不起作用。 如何做到这一点,我检查了 Emacs wiki,但什么也没找到。 我使用的是 emacs 24.3.1。 显示了工具栏,但没有显示我的新项目。
我可以使用 eval-buffer 运行它,但不能使用我的 .emacs 运行它,或者找到另一个解决方案来解决该问题。 当我使用 eval-buffer 添加它时,我的按钮在滚动后离开我的工具栏。
(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")
)
)
最佳答案
嗨,我找到了一个简单的解决方案来添加工具栏按钮“拼写”是/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 - 如何在 emacs 中添加工具栏按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24684979/