unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
To: 16866@debbugs.gnu.org
Subject: bug#16866: 24.3.50; printing region gives non colorized output
Date: Sun, 16 Mar 2014 15:22:27 +0100	[thread overview]
Message-ID: <20140316142227.GD20925@scotty.home> (raw)
In-Reply-To: <20140225164015.GF22548@pille.home>

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	other threads:[~2014-03-16 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 16:45 bug#16866: 24.3.50; printing region gives non colorized output Stefan-W. Hahn
2014-02-24 17:33 ` Eli Zaretskii
2014-02-24 20:09   ` Stefan-W. Hahn
2014-02-25 16:40 ` Stefan-W. Hahn
2014-03-16 14:22   ` Stefan-W. Hahn [this message]
2014-03-18 20:04     ` Stefan Monnier
2014-03-19 16:24       ` Stefan-W. Hahn
2014-03-19 19:13         ` Stefan

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=20140316142227.GD20925@scotty.home \
    --to=stefan.hahn@s-hahn.de \
    --cc=16866@debbugs.gnu.org \
    /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).