From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.help Subject: RE: Replace tool-bar print-buffer with ps-print-buffer-faces? Date: Tue, 03 Apr 2007 09:46:08 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1175564791 650 80.91.229.12 (3 Apr 2007 01:46:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2007 01:46:31 +0000 (UTC) To: Reiner.Steib@gmx.de, help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 03 03:46:30 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HYY6P-0004pj-GW for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Apr 2007 03:46:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYY9U-0001Ac-Vj for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Apr 2007 21:49:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HYY9G-0001AW-SF for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 21:49:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HYY9E-00019g-BJ for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 21:49:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYY9E-00019d-6W for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 21:49:24 -0400 Original-Received: from bay0-omc3-s28.bay0.hotmail.com ([65.54.246.228]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HYY67-0003ya-VG for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 21:46:12 -0400 Original-Received: from hotmail.com ([65.55.154.86]) by bay0-omc3-s28.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Mon, 2 Apr 2007 18:46:10 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 2 Apr 2007 18:46:10 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Tue, 03 Apr 2007 01:46:08 GMT X-Originating-IP: [202.165.107.100] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: X-OriginalArrivalTime: 03 Apr 2007 01:46:10.0215 (UTC) FILETIME=[DAA2AB70:01C77591] X-detected-kernel: Windows 2000 SP4, XP SP1+ X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42383 Archived-At: >Frobbing `tool-bar-map' should work[2] but it's there a cleaner and >more simple way? > >[2] >ELISP> (assoc 'print-buffer tool-bar-map) >(print-buffer menu-item "Print Buffer" print-buffer > (nil) > :enable > (menu-bar-menu-frame-live-and-visible-p) > :help "Print current buffer with page headings" :image > (image :type xpm :file "[...]/etc/images/print.xpm")) > >==> (setcdr (assoc 'print-buffer tool-bar-map) [new entry]) A cleaner approach is to use `define-key', imo: (define-key tool-bar-map [print-buffer] '(menu-item "Print Buffer with Faces" ps-print-buffer-with-faces (nil) :enable (menu-bar-menu-frame-live-and-visible-p) :help "Print current buffer with faces" :image (image :type xpm :file "/usr/local/share/emacs/23.0.0/etc/images/print.xpm"))) Regards, Guanpeng Xu _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/