help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Replace tool-bar print-buffer with ps-print-buffer-faces?


From: Herbert Euler
Subject: RE: Replace tool-bar print-buffer with ps-print-buffer-faces?
Date: Tue, 03 Apr 2007 09:46:08 +0800

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]