Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying to rebind menu widgets

11 views
Skip to first unread message

Davin Pearson

unread,
Apr 14, 2010, 11:56:39 PM4/14/10
to
I am trying to rebing <tool-bar> <kill-buffer> to d-kill-buffer, my
own creation. Here is the code that I have tried to use but failed:

(global-set-key [<tool-bar> <kill-buffer>] 'd-kill-buffer)

This doesn't work as after executing this command, the mouse clicks
are still bound to kill-this-buffer, which I don't want. Would
someone be able to help me with the solution to this problem?

Davin Pearson

unread,
Apr 17, 2010, 4:39:18 AM4/17/10
to

Sorry for wasting your time but I finally got it to work using the
following code:

(define-key
global-map
[tool-bar kill-buffer]
'(menu-item
"Maybe Kill Buffer"
d-kill-buffer
:enable 1
:visible 1
:help "Maybe Kill Buffer"
:image (image :type xpm :file "../etc/images/close.xpm")
))

0 new messages