unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
@ 2008-10-10 18:47 Friedrich Delgado Friedrichs
  0 siblings, 0 replies; 7+ messages in thread
From: Friedrich Delgado Friedrichs @ 2008-10-10 18:47 UTC (permalink / raw)
  To: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

Hi!

ps-print.el from current cvs uses non-exhaustive cases in the function
ps-n-up-printing, if a page size symbol does not match any of the
cars in ps-n-up-database.

The background of this is that I'm using a label printer with maximum
54mm (nominally, really 136 points, 47mm) width to print labels and
small leaflets.

My ps-page-dimensions-database looks like this:

((a4 595.275590551181 841.8897637795276 "A4")
 (a3 841.8897637795276 1190.551181102362 "A3")
 (letter 612.0 792.0 "Letter")
 (legal 612.0 1008.0 "Legal")
 (letter-small 552.96 731.52 "LetterSmall")
 (tabloid 792.0 1224.0 "Tabloid")
 (ledger 1224.0 792.0 "Ledger")
 (statement 396.0 612.0 "Statement")
 (executive 540.0 720.0 "Executive")
 (a4small 537.84 781.1999999999999 "A4Small")
 (b4 729.0 1031.76 "B4")
 (b5 515.52 729.0 "B5")
 (shipping 271 136 "Shipping")
 (topcoated 425.19685 136 "TopCoatedPaper"))

The next to last entries are the relevant ones. If ps-paper-type is
set to 'topcoated or 'shipping, ps-n-up-printing returns nil, causing
an error in the format for the page header later.

ps-n-up-printing being set to 1

This quick workaround fixes this for me:

---------------------------
--- ps-print.el.~1.219.~    2008-05-20 00:03:17.000000000 +0200
+++ ps-print.el 2008-10-10 20:28:05.000000000 +0200
@@ -5256,7 +5256,8 @@
     (and the-list
     (while (> ps-n-up-printing (caar the-list))
       (setq the-list (cdr the-list))))
-    (car the-list)))
+    (or (car the-list)
+        '(1   nil 1  1  0))))
 
 
 (defconst ps-n-up-filling-database
---------------------------

However you might want to apply a more general fix for the
distribution.

I've tried to delete some insubstantial information from M-x
report-emacs-bug, and I think it wasn't too much, but if you have any
further questions, please don't hesitate to ask.

Kind regards
     Friedel
-- 
        Friedrich Delgado Friedrichs <friedel@nomaden.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
@ 2008-10-11 21:38 Chong Yidong
  2008-10-16  1:11 ` Vinicius Jose Latorre
  0 siblings, 1 reply; 7+ messages in thread
From: Chong Yidong @ 2008-10-11 21:38 UTC (permalink / raw)
  To: Vinicius Jose Latorre; +Cc: 1138

Hi,

Could you take a look at this bug report against ps-print.el?  Is the
attached patch safe to apply?  Thanks!

Friedrich Delgado Friedrichs <friedel@nomaden.org> wrote:
> ps-print.el from current cvs uses non-exhaustive cases in the function
> ps-n-up-printing, if a page size symbol does not match any of the
> cars in ps-n-up-database.
>
> The background of this is that I'm using a label printer with maximum
> 54mm (nominally, really 136 points, 47mm) width to print labels and
> small leaflets.
>
> My ps-page-dimensions-database looks like this:
>
> ((a4 595.275590551181 841.8897637795276 "A4")
>  (a3 841.8897637795276 1190.551181102362 "A3")
>  (letter 612.0 792.0 "Letter")
>  (legal 612.0 1008.0 "Legal")
>  (letter-small 552.96 731.52 "LetterSmall")
>  (tabloid 792.0 1224.0 "Tabloid")
>  (ledger 1224.0 792.0 "Ledger")
>  (statement 396.0 612.0 "Statement")
>  (executive 540.0 720.0 "Executive")
>  (a4small 537.84 781.1999999999999 "A4Small")
>  (b4 729.0 1031.76 "B4")
>  (b5 515.52 729.0 "B5")
>  (shipping 271 136 "Shipping")
>  (topcoated 425.19685 136 "TopCoatedPaper"))
>
> The next to last entries are the relevant ones. If ps-paper-type is
> set to 'topcoated or 'shipping, ps-n-up-printing returns nil, causing
> an error in the format for the page header later.
>
> ps-n-up-printing being set to 1
>
> This quick workaround fixes this for me:

--- ps-print.el.~1.219.~    2008-05-20 00:03:17.000000000 +0200
+++ ps-print.el 2008-10-10 20:28:05.000000000 +0200
@@ -5256,7 +5256,8 @@
     (and the-list
     (while (> ps-n-up-printing (caar the-list))
       (setq the-list (cdr the-list))))
-    (car the-list)))
+    (or (car the-list)
+        '(1   nil 1  1  0))))
 
 
 (defconst ps-n-up-filling-database

> However you might want to apply a more general fix for the
> distribution.






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

* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
  2008-10-11 21:38 Chong Yidong
@ 2008-10-16  1:11 ` Vinicius Jose Latorre
  2008-10-16 11:58   ` Friedrich Delgado Friedrichs
  0 siblings, 1 reply; 7+ messages in thread
From: Vinicius Jose Latorre @ 2008-10-16  1:11 UTC (permalink / raw)
  To: Chong Yidong, friedel; +Cc: 1138

Hi Friedrich,


> Friedrich Delgado Friedrichs <friedel@nomaden.org> wrote:
>   
>> ps-print.el from current cvs uses non-exhaustive cases in the function
>> ps-n-up-printing, if a page size symbol does not match any of the
>> cars in ps-n-up-database.
>>
>> The background of this is that I'm using a label printer with maximum
>> 54mm (nominally, really 136 points, 47mm) width to print labels and
>> small leaflets.
>>
>> My ps-page-dimensions-database looks like this:
>>
>> ((a4 595.275590551181 841.8897637795276 "A4")
>>  (a3 841.8897637795276 1190.551181102362 "A3")
>>  (letter 612.0 792.0 "Letter")
>>  (legal 612.0 1008.0 "Legal")
>>  (letter-small 552.96 731.52 "LetterSmall")
>>  (tabloid 792.0 1224.0 "Tabloid")
>>  (ledger 1224.0 792.0 "Ledger")
>>  (statement 396.0 612.0 "Statement")
>>  (executive 540.0 720.0 "Executive")
>>  (a4small 537.84 781.1999999999999 "A4Small")
>>  (b4 729.0 1031.76 "B4")
>>  (b5 515.52 729.0 "B5")
>>  (shipping 271 136 "Shipping")
>>  (topcoated 425.19685 136 "TopCoatedPaper"))
>>     

Ok, it seems ok to add these two new entries into 
ps-page-dimensions-database.


>> The next to last entries are the relevant ones. If ps-paper-type is
>> set to 'topcoated or 'shipping, ps-n-up-printing returns nil, causing
>> an error in the format for the page header later.
>>
>> ps-n-up-printing being set to 1
>>
>> This quick workaround fixes this for me:
>>     
>
> --- ps-print.el.~1.219.~    2008-05-20 00:03:17.000000000 +0200
> +++ ps-print.el 2008-10-10 20:28:05.000000000 +0200
> @@ -5256,7 +5256,8 @@
>      (and the-list
>      (while (> ps-n-up-printing (caar the-list))
>        (setq the-list (cdr the-list))))
> -    (car the-list)))
> +    (or (car the-list)
> +        '(1   nil 1  1  0))))
>  
>  
>  (defconst ps-n-up-filling-database
>
>   
>> However you might want to apply a more general fix for the
>> distribution.
>>     

Well, the right thing to do is to add new entries into ps-n-up-database, 
like:

(defconst ps-n-up-database
   '(......
    (shipping
     (100 nil 1  1  0))
    (topcoated
     (100 nil 1  1  0)))
...)

Please, try the change above and let me know the results.

Does it make sense to have ps-n-up-printing > 1 for these 2 new entries??

ps-print does not deal with paper sizes which only can have 1 n-up, but 
it's possible to change this if this is the case.


Thanks for your contribution,


Vinicius







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

* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
  2008-10-16  1:11 ` Vinicius Jose Latorre
@ 2008-10-16 11:58   ` Friedrich Delgado Friedrichs
  2008-10-17  2:05     ` Vinicius Jose Latorre
  0 siblings, 1 reply; 7+ messages in thread
From: Friedrich Delgado Friedrichs @ 2008-10-16 11:58 UTC (permalink / raw)
  To: Vinicius Jose Latorre; +Cc: Chong Yidong, 1138

Hi.

Vinicius Jose Latorre schrieb:
> Ok, it seems ok to add these two new entries into  
> ps-page-dimensions-database.

Well, it's customisable, so I customised it according to my paper size
:)

Would there be another way to print a small page from emacs?

> Well, the right thing to do is to add new entries into ps-n-up-database,  
> like:

> (defconst ps-n-up-database
>   '(......
>    (shipping
>     (100 nil 1  1  0))
>    (topcoated
>     (100 nil 1  1  0)))
> ...)

Label printers support lots of unusual small paper sizes.

The Seiko SLP-440 I'm using has

8mmSpine 35mmSlide AddressLarge AddressSmall Diskette EuroFolderNarrow
EuroFolderWide EuroNameBadge FileFolder Jewelry MediaBadge
MultiPurpose Shipping VHSFace VHSSpine ZipDisk CutHanging13
CutHanging15 EuroFileFolder RetailLabel EuroNameBadgeLarge
TopCoatedPaper Custom

And Custom allows me to specify completely arbitrary values.

(If you're interested in the exact dimensions for all of those, I can
quote them from the ppd, but:)

Does it really make sense to add all those unusual sizes to
ps-n-up-database, especially since it's not configurable, but
ps-page-dimensions-database is?

> Please, try the change above and let me know the results.

I can try this later at home, but I don't really like the approach
here. I think it doesn't scale. When I go and buy differently sized
labels, I need to touch ps-n-up-database again, adding the same value
'(100 nil 1 1 0).

> Does it make sense to have ps-n-up-printing > 1 for these 2 new entries??

Not really. Most content needs to be specially sized to even fit on
one page. We're talking about 5.4mm x 150mm, i.e. a long receipt and
5.4mm x 100mm, a large address label here.

> ps-print does not deal with paper sizes which only can have 1 n-up, but  
> it's possible to change this if this is the case.

As a user, I'd prefer it if a sane default for 1 n-up would be chosen
if the page size is smaller than, say, A6.


-- 
        Friedrich Delgado Friedrichs <friedel@nomaden.org>






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

* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
  2008-10-16 11:58   ` Friedrich Delgado Friedrichs
@ 2008-10-17  2:05     ` Vinicius Jose Latorre
  0 siblings, 0 replies; 7+ messages in thread
From: Vinicius Jose Latorre @ 2008-10-17  2:05 UTC (permalink / raw)
  To: friedel; +Cc: Chong Yidong, 1138

Friedrich Delgado Friedrichs wrote:
> Hi.
>
> Vinicius Jose Latorre schrieb:
>   
>> Ok, it seems ok to add these two new entries into  
>> ps-page-dimensions-database.
>>     
>
> Well, it's customisable, so I customised it according to my paper size
> :)
>   

:)

> Would there be another way to print a small page from emacs?
>
>   
>> Well, the right thing to do is to add new entries into ps-n-up-database,  
>> like:
>>     
>
>   
>> (defconst ps-n-up-database
>>   '(......
>>    (shipping
>>     (100 nil 1  1  0))
>>    (topcoated
>>     (100 nil 1  1  0)))
>> ...)
>>     
>
> Label printers support lots of unusual small paper sizes.
>
> The Seiko SLP-440 I'm using has
>
> 8mmSpine 35mmSlide AddressLarge AddressSmall Diskette EuroFolderNarrow
> EuroFolderWide EuroNameBadge FileFolder Jewelry MediaBadge
> MultiPurpose Shipping VHSFace VHSSpine ZipDisk CutHanging13
> CutHanging15 EuroFileFolder RetailLabel EuroNameBadgeLarge
> TopCoatedPaper Custom
>
> And Custom allows me to specify completely arbitrary values.
>
> (If you're interested in the exact dimensions for all of those, I can
> quote them from the ppd, but:)
>   

Well, I think it could be a good thing to have these dimensions, if you 
can, please, send them back to me.

> Does it really make sense to add all those unusual sizes to
> ps-n-up-database, especially since it's not configurable, but
> ps-page-dimensions-database is?
>   

Hmmm, as you said (below), it does not make sense to have n-up > 1 for 
these sizes, so your patch seems suitable to deal with this situation 
without having to add entries into ps-n-up-database.


>> Please, try the change above and let me know the results.
>>     
>
> I can try this later at home, but I don't really like the approach
> here. I think it doesn't scale. When I go and buy differently sized
> labels, I need to touch ps-n-up-database again, adding the same value
> '(100 nil 1 1 0).
>
>   
>> Does it make sense to have ps-n-up-printing > 1 for these 2 new entries??
>>     
>
> Not really. Most content needs to be specially sized to even fit on
> one page. We're talking about 5.4mm x 150mm, i.e. a long receipt and
> 5.4mm x 100mm, a large address label here.
>
>   
>> ps-print does not deal with paper sizes which only can have 1 n-up, but  
>> it's possible to change this if this is the case.
>>     
>
> As a user, I'd prefer it if a sane default for 1 n-up would be chosen
> if the page size is smaller than, say, A6.
>   

Ok, it seems that your patch does this.







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

* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
@ 2008-11-08 17:22 Chong Yidong
  2008-11-10  0:33 ` Vinicius Jose Latorre
  0 siblings, 1 reply; 7+ messages in thread
From: Chong Yidong @ 2008-11-08 17:22 UTC (permalink / raw)
  To: Vinicius Jose Latorre; +Cc: 1138, friedel

Hi guys,

Can we get this discussion moving again?  Vinicius, do we need to make
any changes to ps-print?






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

* bug#1138: 23.0.60; ps-print.el error with unusual page sizes
  2008-11-08 17:22 bug#1138: 23.0.60; ps-print.el error with unusual page sizes Chong Yidong
@ 2008-11-10  0:33 ` Vinicius Jose Latorre
  0 siblings, 0 replies; 7+ messages in thread
From: Vinicius Jose Latorre @ 2008-11-10  0:33 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 1138, friedel

Hi Chong,


> Hi guys,
>
> Can we get this discussion moving again?  Vinicius, do we need to make
> any changes to ps-print?
>   

ps-print was updated at 2008-10-23 to deal with some label printer page 
size (sent by Friedrich).

Does this change have any problem?


Vinicius







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

end of thread, other threads:[~2008-11-10  0:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-08 17:22 bug#1138: 23.0.60; ps-print.el error with unusual page sizes Chong Yidong
2008-11-10  0:33 ` Vinicius Jose Latorre
  -- strict thread matches above, loose matches on Subject: below --
2008-10-11 21:38 Chong Yidong
2008-10-16  1:11 ` Vinicius Jose Latorre
2008-10-16 11:58   ` Friedrich Delgado Friedrichs
2008-10-17  2:05     ` Vinicius Jose Latorre
2008-10-10 18:47 Friedrich Delgado Friedrichs

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).