unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eduard Wiebe <ew@pusto.de>
To: harven <harven@free.fr>
Cc: Vinicius Jose Latorre <viniciusjl@ig.com.br>, 5254@debbugs.gnu.org
Subject: bug#5254: ps-print and faces specified as strings
Date: Wed, 23 Dec 2009 17:03:14 +0100	[thread overview]
Message-ID: <86eimloeyl.fsf@nirvana.pusto.de> (raw)
In-Reply-To: <m2ljgx2ud0.fsf@univ-brest.fr> (harven@free.fr's message of "Sun\, 20 Dec 2009 22\:44\:43 +0100")

harven <harven@free.fr> 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






  reply	other threads:[~2009-12-23 16:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-20 21:44 bug#5254: ps-print and faces specified as strings harven
2009-12-23 16:03 ` Eduard Wiebe [this message]
2009-12-23 22:35   ` Vinicius Jose Latorre
2009-12-24 13:52     ` Eduard Wiebe
     [not found]   ` <mailman.107.1261609640.18930.bug-gnu-emacs@gnu.org>
2009-12-24 11:21     ` harven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86eimloeyl.fsf@nirvana.pusto.de \
    --to=ew@pusto.de \
    --cc=5254@debbugs.gnu.org \
    --cc=harven@free.fr \
    --cc=viniciusjl@ig.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).