* Replace tool-bar print-buffer with ps-print-buffer-faces?
@ 2007-04-02 20:01 Reiner Steib
2007-04-03 1:46 ` Herbert Euler
2007-04-04 2:53 ` Kevin Rodgers
0 siblings, 2 replies; 7+ messages in thread
From: Reiner Steib @ 2007-04-02 20:01 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I wonder what's the best way to _replace_ `print-buffer' in the tool
bar [1] with with `ps-print-buffer-faces'?
Frobbing `tool-bar-map' should work[2] but it's there a cleaner and
more simple way?
Bye, Reiner.
[1]
,----[ `<f1> k <tool-bar> <print-buffer>' ]
| <tool-bar> <print-buffer> runs the command print-buffer
| which is an interactive autoloaded Lisp function in `lpr'.
| It is bound to <menu-bar> <file> <print-buffer>.
| (print-buffer)
`----
[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])
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Replace tool-bar print-buffer with ps-print-buffer-faces?
2007-04-02 20:01 Replace tool-bar print-buffer with ps-print-buffer-faces? Reiner Steib
@ 2007-04-03 1:46 ` Herbert Euler
2007-04-04 18:23 ` Reiner Steib
2007-04-04 2:53 ` Kevin Rodgers
1 sibling, 1 reply; 7+ messages in thread
From: Herbert Euler @ 2007-04-03 1:46 UTC (permalink / raw)
To: Reiner.Steib, help-gnu-emacs
>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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Replace tool-bar print-buffer with ps-print-buffer-faces?
2007-04-02 20:01 Replace tool-bar print-buffer with ps-print-buffer-faces? Reiner Steib
2007-04-03 1:46 ` Herbert Euler
@ 2007-04-04 2:53 ` Kevin Rodgers
2007-04-04 18:24 ` Reiner Steib
1 sibling, 1 reply; 7+ messages in thread
From: Kevin Rodgers @ 2007-04-04 2:53 UTC (permalink / raw)
To: help-gnu-emacs
Reiner Steib wrote:
> Hi,
>
> I wonder what's the best way to _replace_ `print-buffer' in the tool
> bar [1] with with `ps-print-buffer-faces'?
>
> Frobbing `tool-bar-map' should work[2] but it's there a cleaner and
> more simple way?
(define-key tool-bar-map
(where-is-internal 'print-buffer tool-bar-map 'non-ascii)
'ps-print-buffer)
> Bye, Reiner.
>
> [1]
> ,----[ `<f1> k <tool-bar> <print-buffer>' ]
> | <tool-bar> <print-buffer> runs the command print-buffer
> | which is an interactive autoloaded Lisp function in `lpr'.
> | It is bound to <menu-bar> <file> <print-buffer>.
> | (print-buffer)
> `----
>
> [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])
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Replace tool-bar print-buffer with ps-print-buffer-faces?
2007-04-03 1:46 ` Herbert Euler
@ 2007-04-04 18:23 ` Reiner Steib
0 siblings, 0 replies; 7+ messages in thread
From: Reiner Steib @ 2007-04-04 18:23 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, Apr 03 2007, Herbert Euler wrote:
> (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")))
Thanks. I hoped that there's a way without hard-coding so many
elements. At least the image location can be avoided:
(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")))
But after glancing through `tool-bar-local-item-from-menu', it doesn't
look promising.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Replace tool-bar print-buffer with ps-print-buffer-faces?
2007-04-04 2:53 ` Kevin Rodgers
@ 2007-04-04 18:24 ` Reiner Steib
2007-04-05 2:06 ` Herbert Euler
0 siblings, 1 reply; 7+ messages in thread
From: Reiner Steib @ 2007-04-04 18:24 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, Apr 04 2007, Kevin Rodgers wrote:
> Reiner Steib wrote:
>> Hi,
>>
>> I wonder what's the best way to _replace_ `print-buffer' in the tool
>> bar [1] with with `ps-print-buffer-faces'?
>>
>> Frobbing `tool-bar-map' should work[2] but it's there a cleaner and
>> more simple way?
>
> (define-key tool-bar-map
> (where-is-internal 'print-buffer tool-bar-map 'non-ascii)
> 'ps-print-buffer)
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)
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Replace tool-bar print-buffer with ps-print-buffer-faces?
2007-04-04 18:24 ` Reiner Steib
@ 2007-04-05 2:06 ` Herbert Euler
2007-04-05 2:10 ` Herbert Euler
0 siblings, 1 reply; 7+ messages in thread
From: Herbert Euler @ 2007-04-05 2:06 UTC (permalink / raw)
To: Reiner.Steib, help-gnu-emacs
>(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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Replace tool-bar print-buffer with ps-print-buffer-faces?
2007-04-05 2:06 ` Herbert Euler
@ 2007-04-05 2:10 ` Herbert Euler
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Euler @ 2007-04-05 2:10 UTC (permalink / raw)
To: herberteuler, Reiner.Steib, help-gnu-emacs
>>(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")))
>
>
Oh, I'm sorry I was wrong. The comma is not needed.
Regards,
Guanpeng Xu
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-04-05 2:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-02 20:01 Replace tool-bar print-buffer with ps-print-buffer-faces? Reiner Steib
2007-04-03 1:46 ` Herbert Euler
2007-04-04 18:23 ` Reiner Steib
2007-04-04 2:53 ` Kevin Rodgers
2007-04-04 18:24 ` Reiner Steib
2007-04-05 2:06 ` Herbert Euler
2007-04-05 2:10 ` Herbert Euler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).