From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.bugs Subject: bug#5254: ps-print and faces specified as strings Date: Wed, 23 Dec 2009 20:35:34 -0200 Message-ID: <4B329B36.9080105@ig.com.br> References: <86eimloeyl.fsf@nirvana.pusto.de> Reply-To: Vinicius Jose Latorre , 5254@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1261609651 2587 80.91.229.12 (23 Dec 2009 23:07:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Dec 2009 23:07:31 +0000 (UTC) Cc: 5254@debbugs.gnu.org, harven To: Eduard Wiebe Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 24 00:07:23 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 1NNaIc-000707-Qz for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Dec 2009 00:07:23 +0100 Original-Received: from localhost ([127.0.0.1]:35154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNaId-000120-2q for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Dec 2009 18:07:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNaIY-00011n-HJ for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 18:07:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNaIR-00011L-Uy for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 18:07:17 -0500 Original-Received: from [199.232.76.173] (port=56677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNaIR-00011I-QT for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 18:07:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41677) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NNaIR-0002zE-Cy for bug-gnu-emacs@gnu.org; Wed, 23 Dec 2009 18:07:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NNZqE-00032I-HZ; Wed, 23 Dec 2009 17:38:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Vinicius Jose Latorre , 5254@debbugs.gnu.org Resent-From: Vinicius Jose Latorre 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 22:38: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.126160786411653 (code B ref 5254); Wed, 23 Dec 2009 22:38:02 +0000 Original-Received: (at 5254) by debbugs.gnu.org; 23 Dec 2009 22:37:44 +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 1NNZpw-00031u-2t for submit@debbugs.gnu.org; Wed, 23 Dec 2009 17:37:44 -0500 Original-Received: from mail-qy0-f182.google.com ([209.85.221.182]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NNZmd-00030H-9J for 5254@debbugs.gnu.org; Wed, 23 Dec 2009 17:34:19 -0500 Original-Received: by qyk12 with SMTP id 12so1894224qyk.21 for <5254@debbugs.gnu.org>; Wed, 23 Dec 2009 14:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=rSIeGZpOsFVxVhUQLtnyExIyPo+ELQD39bRDYEfUk8U=; b=rWd17LEf+Mob0Ohd8JKxzdvxL59wuwvbrc0IpibKyE+NwrVhWQ89XGayNToQyGSFUk 4d/YetkVAValHYg582S+3OLiuLprXrQWzkCXwyvzq+jqmIJ+FWFDvZi5jJswk4XvldX7 sWwsCImvvBG5BvajvYhwywpm2/irJbRod/Zr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=htsTBb5nC8i/L8SHbYNJslbGVHhDvOnzjNZA8IRyU0eFP/7dRZYe+CYVGQwGag70MV VEcDREUTtk7qNcudo+wMBYCCQ4ww8xYT57Yf1NA1xTptW2jGYoa5xH/lsphNFZsn5Fw8 JnHHEDTw+SeMr3oQ0PcSDlboURZFmFxySl/0Q= Original-Received: by 10.224.17.225 with SMTP id t33mr5581805qaa.150.1261607655040; Wed, 23 Dec 2009 14:34:15 -0800 (PST) Original-Received: from ?192.168.0.101? ([201.82.139.225]) by mx.google.com with ESMTPS id 7sm21639734qwf.24.2009.12.23.14.34.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 23 Dec 2009 14:34:14 -0800 (PST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.6) Gecko/20091206 SeaMonkey/2.0.1 In-Reply-To: <86eimloeyl.fsf@nirvana.pusto.de> X-Spam-Score: -0.0 (/) X-Mailman-Approved-At: Wed, 23 Dec 2009 17:37:43 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -0.0 (/) Resent-Date: Wed, 23 Dec 2009 17:38:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:33732 Archived-At: Hi all, Maybe this patch is better: *** 6249,6254 **** --- 6249,6255 ---- return the attribute vector. If FACE is not a valid face name, use default face." + (and (stringp face) (facep face) (setq face (intern face))) (cond (ps-black-white-faces-alist (or (and (symbolp face) Thanks for your report, Vinicius Eduard Wiebe wrote: > 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))