bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5254: ps-print and faces specified as strings


From: Vinicius Jose Latorre
Subject: bug#5254: ps-print and faces specified as strings
Date: Wed, 23 Dec 2009 20:35:34 -0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.6) Gecko/20091206 SeaMonkey/2.0.1

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<address@hidden>  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))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]