all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 16866@debbugs.gnu.org
Subject: bug#16866: 24.3.50; printing region gives non colorized output
Date: Wed, 19 Mar 2014 17:24:40 +0100	[thread overview]
Message-ID: <20140319162440.GE12819@pille.home> (raw)
In-Reply-To: <jwvpplj9t0j.fsf-monnier+emacsbugs@gnu.org>

Mail von Stefan Monnier, Tue, 18 Mar 2014 at 16:04:17 -0400:

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.
> 
> Indeed.  Maybe we should call deactivate-mark explicitly from ps-print,
> and change deactivate-mark to call redisplay--update-region-highlight?

I tried following patch. It looks like it works. (I'm not so deep in code
to see if this has other side effects.)

From d38260efdc20ae4964a7768099d38d423c0510a2 Mon Sep 17 00:00:00 2001
From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
Date: Wed, 19 Mar 2014 17:05:20 +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.

As suggested by Stefan Monnier this patch changes deactivate-mark to
unhighlight an activated region and then calling deactivate-mark
before printing.

TINY CHANGE.

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

diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 6251a6c..3959c28 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -6429,6 +6429,7 @@ (defun ps-generate-postscript-with-faces (from to)
   (save-restriction
     (narrow-to-region from to)
     (ps-print-ensure-fontified from to)
+    (deactivate-mark)
     (ps-generate-postscript-with-faces1 from to)))
 
 (defun ps-generate-postscript (from to)
diff --git a/lisp/simple.el b/lisp/simple.el
index d847082..df8279e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4386,7 +4386,8 @@ (defun deactivate-mark (&optional force)
       (if (eq (car-safe transient-mark-mode) 'only)
 	  (setq transient-mark-mode (cdr transient-mark-mode)))
       (setq mark-active nil)
-      (run-hooks 'deactivate-mark-hook))))
+      (run-hooks 'deactivate-mark-hook)
+      (redisplay--update-region-highlight (selected-window)))))
 
 (defun activate-mark (&optional no-tmm)
   "Activate the mark.
-- 
1.9.0

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-19 16:24 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
2014-03-18 20:04     ` Stefan Monnier
2014-03-19 16:24       ` Stefan-W. Hahn [this message]
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

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

  git send-email \
    --in-reply-to=20140319162440.GE12819@pille.home \
    --to=stefan.hahn@s-hahn.de \
    --cc=16866@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 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.