all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#5254: ps-print and faces specified as strings
@ 2009-12-20 21:44 harven
  2009-12-23 16:03 ` Eduard Wiebe
  0 siblings, 1 reply; 5+ messages in thread
From: harven @ 2009-12-20 21:44 UTC (permalink / raw)
  To: bug-gnu-emacs

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. 
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.


In GNU Emacs 22.1.1 (i386-apple-darwin8.10.1, X toolkit) of 2007-08-13
Windowing system distributor `The X.Org Foundation', version 11.0.60802000

also

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ VErsion 2.18.2)) 
of 2009-11-02 on raven, modified by Debian
Windowing System distributor  `The X.Org Foundation', version 11.0.10605000







^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#5254: ps-print and faces specified as strings
  2009-12-20 21:44 bug#5254: ps-print and faces specified as strings harven
@ 2009-12-23 16:03 ` Eduard Wiebe
  2009-12-23 22:35   ` Vinicius Jose Latorre
       [not found]   ` <mailman.107.1261609640.18930.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Eduard Wiebe @ 2009-12-23 16:03 UTC (permalink / raw)
  To: harven; +Cc: Vinicius Jose Latorre, 5254

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






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#5254: ps-print and faces specified as strings
  2009-12-23 16:03 ` Eduard Wiebe
@ 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>
  1 sibling, 1 reply; 5+ messages in thread
From: Vinicius Jose Latorre @ 2009-12-23 22:35 UTC (permalink / raw)
  To: Eduard Wiebe; +Cc: 5254, harven

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<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))






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bug#5254: ps-print and faces specified as strings
       [not found]   ` <mailman.107.1261609640.18930.bug-gnu-emacs@gnu.org>
@ 2009-12-24 11:21     ` harven
  0 siblings, 0 replies; 5+ messages in thread
From: harven @ 2009-12-24 11:21 UTC (permalink / raw)
  To: bug-gnu-emacs

Hi,

both patches work, thanks.

Harven


^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#5254: ps-print and faces specified as strings
  2009-12-23 22:35   ` Vinicius Jose Latorre
@ 2009-12-24 13:52     ` Eduard Wiebe
  0 siblings, 0 replies; 5+ messages in thread
From: Eduard Wiebe @ 2009-12-24 13:52 UTC (permalink / raw)
  To: Vinicius Jose Latorre; +Cc: 5254

Vinicius Jose Latorre <viniciusjl@ig.com.br> writes:

> 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)
>

I agree.

-- 
Eduard Wiebe






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-24 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-20 21:44 bug#5254: ps-print and faces specified as strings harven
2009-12-23 16:03 ` Eduard Wiebe
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.