From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#1138: 23.0.60; ps-print.el error with unusual page sizes Date: Sat, 11 Oct 2008 17:38:13 -0400 Message-ID: <87r66mg6d6.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 1138@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223761821 25627 80.91.229.12 (11 Oct 2008 21:50:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Oct 2008 21:50:21 +0000 (UTC) Cc: 1138@emacsbugs.donarmstrong.com To: Vinicius Jose Latorre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 11 23:51:19 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KomMo-00039u-9B for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Oct 2008 23:51:18 +0200 Original-Received: from localhost ([127.0.0.1]:45442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KomLk-00008R-0J for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Oct 2008 17:50:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KomLf-000085-DG for bug-gnu-emacs@gnu.org; Sat, 11 Oct 2008 17:50:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KomLc-00007Z-5M for bug-gnu-emacs@gnu.org; Sat, 11 Oct 2008 17:50:05 -0400 Original-Received: from [199.232.76.173] (port=35055 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KomLb-00007W-Vj for bug-gnu-emacs@gnu.org; Sat, 11 Oct 2008 17:50:04 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:36808) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KomLb-0002gp-BB for bug-gnu-emacs@gnu.org; Sat, 11 Oct 2008 17:50:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9BLnwa7019053; Sat, 11 Oct 2008 14:49:58 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9BLj2Zs017921; Sat, 11 Oct 2008 14:45:02 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 11 Oct 2008 21:45:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1138 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1138-submit@emacsbugs.donarmstrong.com id=B1138.122376097716670 (code B ref 1138); Sat, 11 Oct 2008 21:45:02 +0000 Original-Received: (at 1138) by emacsbugs.donarmstrong.com; 11 Oct 2008 21:36:17 +0000 Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9BLaEL6016664 for <1138@emacsbugs.donarmstrong.com>; Sat, 11 Oct 2008 14:36:15 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 54EDF57E0BD; Sat, 11 Oct 2008 17:38:13 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 11 Oct 2008 17:50:05 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21407 Archived-At: 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 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.