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

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

bug#16866: 24.3.50; printing region gives non colorized output


From: Stefan-W. Hahn
Subject: bug#16866: 24.3.50; printing region gives non colorized output
Date: Sun, 16 Mar 2014 15:22:27 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Mail von Stefan-W. Hahn, Tue, 25 Feb 2014 at 17:40:16 +0100:
> Mail von Stefan-W. Hahn, Mon, 24 Feb 2014 at 17:45:17 +0100:

Good day,

> > if printing a buffer with postscript the out is colorized. If printing
> > a region of the same buffer the output is bw.

I think the reason for changing this compared to emacs 23.4 is the change in
simple.el when defining an overlay for displaying a region.

(See
commit c95b9f291924ec20eb7bd3ac7ad8995b409aa4ad
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Tue Oct 29 12:11:50 2013 -0400
)

With this change the function ps-generate-postscript-with-faces1 gets the
wrong face for printing, the face of the region and not the face of the
underlying text.

The following change to lisp/ps-def.el tries to corrects this:

From 3f683fbd43e604af2a20303f84b82fe6e031bf1f Mon Sep 17 00:00:00 2001
From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
Date: Sun, 16 Mar 2014 15:11:26 +0100
Subject: [PATCH] Postscript print region colorized again (bug#16866)

After changing the region handling the region itself is defined by an
overlay with a face.

When print a region the code for assembling the postscript data now gets the
face of the overlay instead of the face of the text to print. This results
in an BW printing instead of a colored printing.

This patch changes this by testing if the handled overlay is the region
overlay and ignoring the face of it. The region overlay is detected by
reading the window parameter 'internal-region-overlay of the selected window.

TINY CHANGE.

Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>
---
 lisp/ps-def.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ps-def.el b/lisp/ps-def.el
index 06cef75..d9d8eaa 100644
--- a/lisp/ps-def.el
+++ b/lisp/ps-def.el
@@ -323,6 +323,7 @@ (defvar ps-italic-faces)
     (let ((face 'default)
          (position to)
          ;; Emacs
+          (rol (window-parameter (selected-window) 'internal-region-overlay))
          (property-change from)
          (overlay-change from)
          (save-buffer-invisibility-spec buffer-invisibility-spec)
@@ -364,7 +365,8 @@ (defvar ps-italic-faces)
                    (overlay-get overlay 'invisible))
                   (overlay-priority
                    (or (overlay-get overlay 'priority) 0)))
-             (and (> overlay-priority face-priority)
+             (and (not (and rol (eq rol overlay)))
+                   (> overlay-priority face-priority)
                   (setq before-string
                         (or (overlay-get overlay 'before-string)
                             before-string)
-- 
1.8.3.2.733.gf8abaeb

With kind regards,
Stefan

-- 
Stefan-W. Hahn                          It is easy to make things.
                                        It is hard to make things simple.





reply via email to

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