Gnus development mailing list
 help / color / mirror / Atom feed
* Printing Article Subject in Banner
@ 1998-03-04 16:36 Jake Colman
  1998-03-04 18:33 ` Alan Shutko
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jake Colman @ 1998-03-04 16:36 UTC (permalink / raw)


Sometime ago, I posted a request for a method of printing the article's subject
in the page banner when printing an article.  I was sent the following code:

(add-hook 'gnus-ps-print-hook
  (lambda ()              
    (setq ps-left-header
	  (list (concat "(" (mail-header-subject gnus-current-headers) ")")
		(concat "(" (mail-header-from gnus-current-headers) ")")))
    (setq ps-right-header 
	  (list "/pagenumberstring load" 
		(concat "(" (mail-header-date gnus-current-headers) ")")))))

which does the job quite well.

A problem and a comment:

1) Problem:  after doing an AP, subsequent ps-print-buffer commands on other
   buffers do not display the buffer name in the banner.  Instead, it continues
   to display the most recently printed article's subject.

2) Shouldn't the behavior of this hook be the default behavior of gnus?  It
   would see that this is a reasonable behavior (the above problem
   notwithstanding) and should not have to be custimized individually.  What do
   you think?


-- 
Jake Colman                     

Principia Partners LLC                  Phone: (201) 946-0300
Harborside Financial Center               Fax: (201) 946-0320
902 Plaza II                           Beeper: (800) 505-2795
Jersey City, NJ 07311                  E-mail: colman@ppllc.com
                                       E-mail: jcolman@jnc.com
                                          web: http://www.ppllc.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-04 16:36 Printing Article Subject in Banner Jake Colman
@ 1998-03-04 18:33 ` Alan Shutko
  1998-03-04 19:52   ` Jake Colman
  1998-03-05  6:37 ` Yair Friedman
  1998-03-07 13:03 ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 10+ messages in thread
From: Alan Shutko @ 1998-03-04 18:33 UTC (permalink / raw)
  Cc: ding

>>>>> "J" == Jake Colman <colman@ppllc.com> writes:

J> 1) Problem: after doing an AP, subsequent ps-print-buffer commands
J> on other buffers do not display the buffer name in the banner.
J> Instead, it continues to display the most recently printed
J> article's subject.

After the lambda, add 

	  (make-local-variable 'ps-left-header)
	  (make-local-variable 'ps-right-header)



-- 
Alan Shutko <ats@acm.org> - By consent of the corrupted
All power corrupts, but we need electricity.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-04 18:33 ` Alan Shutko
@ 1998-03-04 19:52   ` Jake Colman
  0 siblings, 0 replies; 10+ messages in thread
From: Jake Colman @ 1998-03-04 19:52 UTC (permalink / raw)
  Cc: ding

>>>>> "AS" == Alan Shutko <ats@acm.org> writes:


    AS> After the lambda, add

    AS> 	  (make-local-variable 'ps-left-header) 
    AS>           (make-local-variable 'ps-right-header)

OK.  I tried this, putting make-local-variable anywhere I could think of
'after' the lambda.  All to no avail.  Here's what I tried last:

(add-hook 'gnus-ps-print-hook
  (lambda ()              
    (make-local-variable 'ps-left-header)
    (make-local-variable 'ps-right-header)
    (setq ps-left-header
      (list (concat "(" 
        (mail-header-subject gnus-current-headers) ")")
          (concat "(" 
            (mail-header-from gnus-current-headers) ")")))
    (setq ps-right-header 
      (list "/pagenumberstring load" 
        (concat "(" 
          (mail-header-date gnus-current-headers) ")")))
  ))

Still, after I print an article, it retains the settings for ps-left-header and
ps-right-header in all my other buffers.

-- 
Jake Colman                     

Principia Partners LLC                  Phone: (201) 946-0300
Harborside Financial Center               Fax: (201) 946-0320
902 Plaza II                           Beeper: (800) 505-2795
Jersey City, NJ 07311                  E-mail: colman@ppllc.com
                                       E-mail: jcolman@jnc.com
                                          web: http://www.ppllc.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-04 16:36 Printing Article Subject in Banner Jake Colman
  1998-03-04 18:33 ` Alan Shutko
@ 1998-03-05  6:37 ` Yair Friedman
  1998-03-05 14:58   ` Lars Balker Rasmussen
  1998-03-07 13:03 ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 10+ messages in thread
From: Yair Friedman @ 1998-03-05  6:37 UTC (permalink / raw)


Jake Colman <colman@ppllc.com> writes:

> 1) Problem:  after doing an AP, subsequent ps-print-buffer commands on other
>    buffers do not display the buffer name in the banner.  Instead, it continues
>    to display the most recently printed article's subject.


Try this (untested).

(add-hook 'gnus-ps-print-hook
  (lambda ()              
    (when (string-match (buffer-name) "*Article*")
      (setq ps-left-header
	    (list (concat "(" (mail-header-subject gnus-current-headers) ")")
	   (concat "(" (mail-header-from gnus-current-headers) ")")))
      (setq ps-right-header 
	    (list "/pagenumberstring load" 
	   (concat "(" (mail-header-date gnus-current-headers) ")"))))))

--
Yair Friedman.                  John Bryce (Systems) 1984 Ltd.           
                                7 Hamarpeh St.                           
                                Har-Hotzvom Science Based Industry Campus
                                Jerusalem 97 774, Israel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-05  6:37 ` Yair Friedman
@ 1998-03-05 14:58   ` Lars Balker Rasmussen
  1998-03-05 17:28     ` Kai Grossjohann
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Balker Rasmussen @ 1998-03-05 14:58 UTC (permalink / raw)


Yair Friedman <yfriedma@johnbryce.co.il> writes:
> Try this (untested).
> 
[...]
<     (when (string-match (buffer-name) "*Article*")

Better escape those *'s :-)

>     (when (string-match (buffer-name) "\\\\*Article\\\\*")
-- 
Lars Balker Rasmussen, Software Engineer, Mjolner Informatics ApS
lbr@mjolner.dk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-05 14:58   ` Lars Balker Rasmussen
@ 1998-03-05 17:28     ` Kai Grossjohann
  1998-03-05 21:23       ` Colin Rafferty
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Grossjohann @ 1998-03-05 17:28 UTC (permalink / raw)


>>>>> Yair Friedman <yfriedma@johnbryce.co.il> writes:

  Yair> <     (when (string-match (buffer-name) "*Article*")

>>>>> On 05 Mar 1998, Lars Balker Rasmussen said:

  Lars> Better escape those *'s :-)

Please note the order of the arguments of string-match.  What happens
if buffer-name returns ".*"?  :-)

kai
-- 
Every country gets the pop music it deserves. -- Guildo Horn


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-05 17:28     ` Kai Grossjohann
@ 1998-03-05 21:23       ` Colin Rafferty
  0 siblings, 0 replies; 10+ messages in thread
From: Colin Rafferty @ 1998-03-05 21:23 UTC (permalink / raw)


Kai Grossjohann writes:

>>>>>> Yair Friedman <yfriedma@johnbryce.co.il> writes:
Yair> <     (when (string-match (buffer-name) "*Article*")

>>>>>> On 05 Mar 1998, Lars Balker Rasmussen said:

Lars> Better escape those *'s :-)

> Please note the order of the arguments of string-match.  What happens
> if buffer-name returns ".*"?  :-)

Also, what if gnus-single-article-buffer is nil?

(buffer-name) -> "*Article nnml:list.ding*"

-- 
Colin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-04 16:36 Printing Article Subject in Banner Jake Colman
  1998-03-04 18:33 ` Alan Shutko
  1998-03-05  6:37 ` Yair Friedman
@ 1998-03-07 13:03 ` Lars Magne Ingebrigtsen
  1998-03-09 14:49   ` Jake Colman
  2 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-07 13:03 UTC (permalink / raw)


Jake Colman <colman@ppllc.com> writes:

> Sometime ago, I posted a request for a method of printing the article's subject
> in the page banner when printing an article.  I was sent the following code:

[...]

> 2) Shouldn't the behavior of this hook be the default behavior of
>    gnus?  It would see that this is a reasonable behavior (the above
>    problem notwithstanding) and should not have to be custimized
>    individually.  What do you think?

It is supposed to be the default behavior --
`gnus-summary-print-article' binds those variables to reasonable
values now...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-07 13:03 ` Lars Magne Ingebrigtsen
@ 1998-03-09 14:49   ` Jake Colman
  1998-03-13 21:23     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Jake Colman @ 1998-03-09 14:49 UTC (permalink / raw)


>>>>> "LMI" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

    LMI> Jake Colman <colman@ppllc.com> writes:
    >> Sometime ago, I posted a request for a method of printing the article's
    >> subject in the page banner when printing an article.  I was sent the
    >> following code:

    LMI> [...]

    >> 2) Shouldn't the behavior of this hook be the default behavior of
    >> gnus?  It would see that this is a reasonable behavior (the above
    >> problem notwithstanding) and should not have to be custimized
    >> individually.  What do you think?

    LMI> It is supposed to be the default behavior --
    LMI> `gnus-summary-print-article' binds those variables to reasonable
    LMI> values now...

So I should not bother with the suggestions in the parallel thread of using
make-local-variable to make this all work?

-- 
Jake Colman                     

Principia Partners LLC                  Phone: (201) 946-0300
Harborside Financial Center               Fax: (201) 946-0320
902 Plaza II                           Beeper: (800) 505-2795
Jersey City, NJ 07311                  E-mail: colman@ppllc.com
                                       E-mail: jcolman@jnc.com
                                          web: http://www.ppllc.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Printing Article Subject in Banner
  1998-03-09 14:49   ` Jake Colman
@ 1998-03-13 21:23     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-13 21:23 UTC (permalink / raw)


Jake Colman <colman@ppllc.com> writes:

> So I should not bother with the suggestions in the parallel thread of using
> make-local-variable to make this all work?

Not unless you want to do something else than the (new) defaults.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1998-03-13 21:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-04 16:36 Printing Article Subject in Banner Jake Colman
1998-03-04 18:33 ` Alan Shutko
1998-03-04 19:52   ` Jake Colman
1998-03-05  6:37 ` Yair Friedman
1998-03-05 14:58   ` Lars Balker Rasmussen
1998-03-05 17:28     ` Kai Grossjohann
1998-03-05 21:23       ` Colin Rafferty
1998-03-07 13:03 ` Lars Magne Ingebrigtsen
1998-03-09 14:49   ` Jake Colman
1998-03-13 21:23     ` Lars Magne Ingebrigtsen

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 NNTP newsgroup(s).