emacs - 如何在 emacs 中添加工具栏按钮?

标签 emacs elisp toolbar emacs24 dot-emacs

我尝试在工具栏中添加一个按钮,但这不起作用。 如何做到这一点,我检查了 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/

相关文章:

iOS 从导航 Controller 子类设置工具栏项

emacs - 如何更改 Emacs 中主要模式的缓冲区局部变量?

emacs - Emacs Elscreen-如何禁用“分屏”?

emacs - 如何在 Emacs 中显示所有 minibuffer 命令历史记录?

Emacs:从文件头禁用次要模式

toolbar - 制作浏览器工具栏?

android - 如何将AppBarLayout的高度设置为0

emacs - emacs中的附加修饰键?

emacs - C-a 使用 ipython-mode 转到 emacs 中的第一个字符

emacs - 在 Windows 上的 Emacs 中更改 .ido.last 历史文件的位置