Message from discussion
Trying to rebind menu widgets
Path: g2news1.google.com!postnews.google.com!u31g2000yqb.googlegroups.com!not-for-mail
From: Davin Pearson <davin.pear...@gmail.com>
Newsgroups: gnu.emacs
Subject: Re: Trying to rebind menu widgets
Date: Sat, 17 Apr 2010 01:39:18 -0700 (PDT)
Organization: http://groups.google.com
Lines: 24
Message-ID: <6a9535a0-0e3b-4089-8f02-67849891ada5@u31g2000yqb.googlegroups.com>
References: <3c5568f4-6807-4fdf-9d2e-d52609175f9b@i37g2000yqn.googlegroups.com>
NNTP-Posting-Host: 60.234.132.53
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1271493559 4782 127.0.0.1 (17 Apr 2010 08:39:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 17 Apr 2010 08:39:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u31g2000yqb.googlegroups.com; posting-host=60.234.132.53;
posting-account=SVVH0AoAAABplEQzMkIR3gU7a0gK8IuF
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3,gzip(gfe)
On Apr 15, 3:56=A0pm, Davin Pearson <davin.pear...@gmail.com> wrote:
> I am trying to rebing <tool-bar> <kill-buffer> to d-kill-buffer, my
> own creation. =A0Here 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. =A0Would
> someone be able to help me with the solution to this problem?
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")
))