From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eduard Wiebe Newsgroups: gmane.emacs.bugs Subject: bug#5254: ps-print and faces specified as strings Date: Wed, 23 Dec 2009 17:03:14 +0100 Message-ID: <86eimloeyl.fsf@nirvana.pusto.de> References: Reply-To: Eduard Wiebe , 5254@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261633639 15752 80.91.229.12 (24 Dec 2009 05:47:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Dec 2009 05:47:19 +0000 (UTC) Cc: Vinicius Jose Latorre , 5254@debbugs.gnu.org To: harven Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 24 06:47:11 2009 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 1NNgXL-0001cP-Mw for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Dec 2009 06:47:00 +0100 Original-Received: from localhost ([127.0.0.1]:50502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNgXL-0003H7-Ug for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Dec 2009 00:46:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNVCF-00063H-1A for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 12:40:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNVCA-00061j-F4 for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 12:40:26 -0500 Original-Received: from [199.232.76.173] (port=55675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNVCA-00061g-CE for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 12:40:22 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47523) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NNVCA-0001gt-5A for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 12:40:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NNV62-00088m-EN; Wed, 23 Dec 2009 12:34:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Eduard Wiebe , 5254@debbugs.gnu.org Resent-From: Eduard Wiebe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Dec 2009 17:34:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5254 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5254-submit@debbugs.gnu.org id=B5254.126158960331280 (code B ref 5254); Wed, 23 Dec 2009 17:34:02 +0000 Original-Received: (at 5254) by debbugs.gnu.org; 23 Dec 2009 17:33:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NNV5O-00088T-Ct for submit@debbugs.gnu.org; Wed, 23 Dec 2009 12:33:23 -0500 Original-Received: from wp093.webpack.hosteurope.de ([80.237.132.100]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NNTgH-0007O8-U7 for 5254@debbugs.gnu.org; Wed, 23 Dec 2009 11:03:22 -0500 Original-Received: from f055053230.adsl.alicedsl.de ([78.55.53.230] helo=nirvana.pusto.de); authenticated by wp093.webpack.hosteurope.de running ExIM with esmtpsa (TLSv1:DES-CBC3-SHA:168) id 1NNTgC-000623-Ap; Wed, 23 Dec 2009 17:03:16 +0100 Original-Received: from ew by nirvana.pusto.de with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NNTgA-0000PQ-ES; Wed, 23 Dec 2009 17:03:14 +0100 In-Reply-To: (harven@free.fr's message of "Sun\, 20 Dec 2009 22\:44\:43 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) X-bounce-key: webpack.hosteurope.de;ew@pusto.de;1261584202;35492879; X-Mailman-Approved-At: Wed, 23 Dec 2009 12:33:21 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 23 Dec 2009 12:34:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 24 Dec 2009 00:46:19 -0500 X-BeenThere: bug-gnu-emacs@gnu.org 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:33739 Archived-At: harven writes: Hi, and thank you for your report. > ps-spool-buffer-with-faces and ps-print-buffer-with-faces report errors > if there is a face specified as a string in the buffer. > > Tested with emacs22 and emacs23 ; starting in a buffer in fundamental > mode, we type and execute the following: > > (facemenu-set-face "bold" 1 (point-max)) > > The text in the buffer becomes bold as expected. > We now try to spool the buffer using M-x ps-spool-buffer-with-faces. > This gives the error: > > ps-face-attribute-list: Wrong type argument: listp, "bold" > > A *postscript* buffer has been created, as expected, but it is empty. > It should have contained a faithful postscript image of the buffer. > The error can be reproduced with any face, not just bold. > > It seems that the problem comes from the fact that somewhere in the > ps-print-* functions, the face is expected to be a symbol -- 'bold. Indeed. > In the function given below, the face is defined by facemenu-set-face > as a string -- "bold". If we use instead > (facemenu-set-face 'bold 1 (point-max)) > to color the buffer, the error disappear. > > It may not be a bug per se, yet it would be nice (and more consistent) > if the ps-print package could handle faces specified as strings. Can you try following patch: diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 386fc14..f799926 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -6254,7 +6254,8 @@ If FACE is not a valid face name, use default face." (or (and (symbolp face) (cdr (assq face ps-black-white-faces-alist))) (vector 0 nil nil))) - ((symbolp face) + ((or (symbolp face) (facep face)) + (and (stringp face) (setq face (intern face))) (cdr (or (assq face ps-print-face-extension-alist) (assq face ps-print-face-alist) (let* ((the-face (if (facep face) face 'default)) -- Eduard Wiebe