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: Thu, 05 Apr 2007 10:06:53 +0800

(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
                            ,(image-search-load-path "print.xpm")))

You forgot a comma here: there should be one before
`menu-bar-menu-frame-live-and-visible-p':

(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
                           ,(image-search-load-path "print.xpm")))


When I eval this, the print button just disappears:

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 "[prefix]/share/emacs/22.0.97/etc/images/print.xpm"))

ELISP> (define-key tool-bar-map
  (where-is-internal 'print-buffer tool-bar-map 'non-ascii)
  'ps-print-buffer)

ps-print-buffer
ELISP> (assoc 'print-buffer tool-bar-map)
(print-buffer . ps-print-buffer)

You have to provide *all* the fields in order to keep the icon.

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]