From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stefan-W. Hahn" Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Fontification of org code block not printed Date: Mon, 28 Jul 2014 18:02:32 +0200 Organization: -no organization- Message-ID: <20140728160232.GG17977@pille.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1406563436 18882 80.91.229.3 (28 Jul 2014 16:03:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2014 16:03:56 +0000 (UTC) To: emacs-orgmode@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Mon Jul 28 18:03:48 2014 Return-path: Envelope-to: geo-emacs-orgmode@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XBnOt-0000bf-Gq for geo-emacs-orgmode@m.gmane.org; Mon, 28 Jul 2014 18:03:47 +0200 Original-Received: from localhost ([::1]:40652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBnOt-0006Nx-3G for geo-emacs-orgmode@m.gmane.org; Mon, 28 Jul 2014 12:03:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBnO6-0005ka-Dh for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 12:03:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBnNy-0001e0-SU for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 12:02:58 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.130]:63357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBnNl-0001YM-DK; Mon, 28 Jul 2014 12:02:37 -0400 Original-Received: from pille.home (port-92-192-54-27.dynamic.qsc.de [92.192.54.27]) by mrelayeu.kundenserver.de (node=mreue006) with ESMTP (Nemesis) id 0Ln0qf-1WZhP41RHR-00hQyM; Mon, 28 Jul 2014 18:02:35 +0200 Original-Received: from pille.home (localhost [127.0.0.1]) by pille.home (8.14.4/8.14.4/Debian-4) with ESMTP id s6SG2XLb014533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Jul 2014 18:02:33 +0200 Original-Received: (from hs@localhost) by pille.home (8.14.4/8.14.4/Submit) id s6SG2Wek014529; Mon, 28 Jul 2014 18:02:32 +0200 X-Authentication-Warning: pille.home: hs set sender to stefan.hahn@s-hahn.de using -f Content-Disposition: inline X-Mailer: Mutt http://www.mutt.org/ X-Editor: GNU Emacs http://www.gnu.org/ X-Accept-Language: de en X-Location: Europe, Germany, Wolfenbuettel X-GPG-Public-Key: gpg --keyserver keys.gnupg.net --recv-keys E4FCD563 X-GPG-Fingerprint: 0xE4FCD563 / EF09 97BB 3731 7DC7 25BA 5C39 185C F986 E4FC D563 User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V02:K0:/9ddEFzsdVE0tfzJzcN5oRjdo/3n2QxBbk2r1HR8d/G o/KGVhVqdSM6QKlEUdkEF1Cf0/zjsEv3gBsrXgUZcV3se4Cr3V X52bL2bo3C+bpVaQ4+CFs4Akx0JUGI1l2LGnlckOEKgkk0DbE9 79Dz0K/ZvBYhpYDvNkY0FEGZKLpFpA+kLW7GJZFqzXZD3v6JsG YuOcfcY+2oCnKLEamk2etr9mVQDc3usAR/2B47aC44GPKCRIvu WBWWnCpgqtuqAurQE7RBWVJglxkcw4IKVUUunsWI89EpZ/OnDN F2Ll2W4i0esJMT5ME377N2XBFjum5+uZYduoLlsL12rEXSJlSz XFOm1ooKuME2zewPzS3Q= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.126.130 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Original-Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.orgmode:88984 gmane.emacs.devel:173215 Archived-At: Hello, I'm using org-mode and have had some trouble with printing with faces, which has been solved in emacs. Currently I'm using the following version: commit 59b20d77aec5055417eeec039af84de88cda12b2 Author: Stefan Monnier Date: Mon Jun 30 22:25:52 2014 -0400 * lisp/ps-def.el (ps-generate-postscript-with-faces1): Don't mess with buffer-invisibility-spec. When using org blocks like: (from org.el) #+BEGIN_SRC elisp (defun org-fontify-meta-lines-and-blocks-1 (limit) "Fontify #+ lines and blocks." .. (cond ((and lang (not (string= lang "")) org-src-fontify-natively) (org-src-font-lock-fontify-block lang block-start block-end) ;; remove old background overlays (mapc (lambda (ov) (if (eq (overlay-get ov 'face) 'org-block-background) (delete-overlay ov))) (overlays-at (/ (+ beg1 block-end) 2))) ;; add a background overlay (setq ovl (make-overlay beg1 block-end)) (overlay-put ovl 'face 'org-block-background) (overlay-put ovl 'evaporate t)) ;; make it go away when empty .. #+END_SRC The text between #+BEGIN_SRC and #+END_SRC gets fontified with the fontification of the given mode, in this case elisp. A describe-text-properties at position of 'd' of defun gives: #+BEGIN_QUOTE Text content at position 858: There is an overlay here: From 857 to 1499 evaporate t face org-block-background There are text properties here: face font-lock-keyword-face font-lock-fontified t font-lock-multiline t fontified t #+END_QUOTE This all is correct and fontified visible in the emacs buffer. But if this part is going to be postscript printed the fontifiying _is_ not to be printed. The face for printing is retrieved in ps-generate-postscript-with-faces1 (from ps-def.el) with 'get-char-property'. (from ps-def.el) #+BEGIN_SRC elisp (defun ps-generate-postscript-with-faces1 (from to) .. (while (< from to) (and (< property-change to) ; Don't search for property change ; unless previous search succeeded. (setq property-change (next-property-change from nil to))) (and (< overlay-change to) ; Don't search for overlay change ; unless previous search succeeded. (setq overlay-change (min (next-overlay-change from) to))) (setq position (min property-change overlay-change) before-string nil after-string nil) (setq face (cond ((invisible-p from) 'emacs--invisible--face) ((get-char-property from 'face)) (t 'default))) .. #+END_SRC The call to get-char-property gives for every position the face of the overlay, which is org-block-background, and not the face of the propertized text. I think this will be the same for all such #+BEGIN/#+END blocks in org-mode. I'm sure that this is not what I expect but I'm not sure if this is a fault in ps-def.el or org.el. Because of this I send this to both mailing lists to get help before sending an error report. With kind regards, Stefan -- Stefan-W. Hahn It is easy to make things. It is hard to make things simple.