How to add a tool-bar button in emacs?

后端 未结 2 482
迷失自我
迷失自我 2021-01-15 14:00

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

2条回答
  •  别那么骄傲
    2021-01-15 14:33

    Your code works, but you need to execute it after tool bar is active.

    If you add your code to your .emacs like this, your problem should be gone:

    (add-hook 'after-init-hook
              (lambda ()
                (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")
                              ))))
    

提交回复
热议问题