Re: [O] [PATCH] Re: links-9.0 v3

2016-08-07 Thread Robert Klein
Hi,

attached are Patches for contrib except ox-bibtex.el and
org-velocity.el.

Some files are spitting out errors during compile, some of those
probably vanish if you require the stuff they depend on.

I modified Matt's patch to also open eww links with eww (but this could
also be something with `browse-url').

The last patch also updates the replacement for org-add-link-type in
org-compat.el.

Best regards
Robert

On Sun, 07 Aug 2016 20:12:21 -0400
John Kitchin  wrote:

> That looks like the correct fix for org-eww.el.
> 
> What is the protocol for fixing the contrib packages? I can take a
> pass at doing it if it is ok.
> 
> 
> 
> Matt Lundin writes:
> 
> > Thanks, John, for improving link functionality in org-mode!
> >
> > I just discovered that this change breaks the contrib files that use
> > org-store-link-functions and org-add-link-type.
> >
> > I'm not familiar enough with the details of org-link-set-parameters
> > to fix all of the contrib files, but I am including a simple patch
> > to update a contrib file that I use regularly: org-eww.el.
> >
> > Thanks,
> > Matt  
> 
> 

>From 5c56aab31caff84241856cb019d496bee2376937 Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Mon, 8 Aug 2016 03:24:09 +0200
Subject: [PATCH 01/14] Update bookmark link definition

* contrib/lisp/org-bookmark.el ("bookmark"):

Update to use org-link-set-parameters.
---
 contrib/lisp/org-bookmark.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-bookmark.el b/contrib/lisp/org-bookmark.el
index 40c7cd0..f042467 100644
--- a/contrib/lisp/org-bookmark.el
+++ b/contrib/lisp/org-bookmark.el
@@ -47,8 +47,9 @@ Otherwise prompt the user for the right bookmark to use."
   :group 'org-bookmark
   :type 'boolean)
 
-(org-add-link-type "bookmark" 'org-bookmark-open)
-(add-hook 'org-store-link-functions 'org-bookmark-store-link)
+(org-link-set-parameters "bookmark"
+			 :follow #'org-bookmark-open
+			 :store #'org-bookmark-store-link)
 
 (defun org-bookmark-open (bookmark)
   "Visit the bookmark BOOKMARK."
-- 
2.9.2

>From 76518d2668e274b48c5b67ad698cb6c5d1659627 Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Mon, 8 Aug 2016 03:24:23 +0200
Subject: [PATCH 02/14] Update tel link definition

* contrib/lisp/org-contacts.el ("contacts"):

Update to use org-link-set-parameters.
---
 contrib/lisp/org-contacts.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 309b9b9..2cadd1d 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1107,8 +1107,7 @@ link string and return the pure link target."
 
 ;; Add the link type supported by org-contacts-strip-link
 ;; so everything is in order for its use in Org files
-(org-add-link-type "tel")
-
+(org-link-set-parameters "tel")
 
 (defun org-contacts-split-property (string  separators omit-nulls)
   "Custom version of `split-string'.
-- 
2.9.2

>From a1d89751290a6594d559dd3ccf5ac957f31c30e0 Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Mon, 8 Aug 2016 03:24:23 +0200
Subject: [PATCH 03/14] Update ebib link definition

* contrib/lisp/org-ebib.el ("ebib"):

Update to use org-link-set-parameters.
---
 contrib/lisp/org-ebib.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/org-ebib.el b/contrib/lisp/org-ebib.el
index 2136a13..4ed5e50 100644
--- a/contrib/lisp/org-ebib.el
+++ b/contrib/lisp/org-ebib.el
@@ -22,9 +22,9 @@
 
 (require 'org)
 
-(org-add-link-type "ebib" 'org-ebib-open)
-
-(add-hook 'org-store-link-functions 'org-ebib-store-link)
+(org-link-set-parameters "ebib"
+			 :follow #'org-ebib-open
+			 :store #'org-ebib-store-link)
 
 (defun org-ebib-open (key)
   "Open Ebib and jump to KEY."
-- 
2.9.2

>From aafd21ba551dd87959eba47e89b402ef7e53826f Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Mon, 8 Aug 2016 03:24:23 +0200
Subject: [PATCH 04/14] Update elisp-symbol link definition

* contrib/lisp/org-elisp-symbol.el ("elisp-symbol"):

Update to use org-link-set-parameters.
---
 contrib/lisp/org-elisp-symbol.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-elisp-symbol.el b/contrib/lisp/org-elisp-symbol.el
index cdf868b..7c98962 100644
--- a/contrib/lisp/org-elisp-symbol.el
+++ b/contrib/lisp/org-elisp-symbol.el
@@ -78,8 +78,9 @@
 
 (require 'org)
 
-(org-add-link-type "elisp-symbol" 'org-elisp-symbol-open)
-(add-hook 'org-store-link-functions 'org-elisp-symbol-store-link)
+(org-link-set-parameters "elisp-symbol"
+			 :follow #'org-elisp-symbol-open
+			 :store #'org-elisp-symbol-store-link)
 
 (defun org-elisp-symbol-open (path)
   "Visit the emacs-lisp elisp-symbol at PATH."
-- 
2.9.2

>From 6bae91b2ddfe6691c7615c16bb1cab3722f9625a Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Mon, 8 Aug 2016 03:24:23 +0200
Subject: 

[O] Reanalyzing archived TO-DOs

2016-08-07 Thread Avery Chan
Hey all,

First I want to apologize for emailing this group. I tried searching the mail 
archives, but:

• Gmane is down.
• The lists.gnu.org  search is broken; using the keyword 
‘archive’ as the search string leads to 0 references.

I also did the prerequisite Google and search on Stackoverflow and Reddit.

I use org-mode as a TO-DO list: I setup a list of things to do, assign time 
estimates to them, schedule them, and clock-in/clock-out. One of my goals is to 
see how much time is actually spent on my to-dos versus the amount of time I 
allocate to them. 

One problem is what to do with completed tasks. They clutter up my todo list so 
I usually archive them to another file. My problem is that after archiving 
them, I can't compare the 'effort' with the actual 'clock time' easily (i.e. 
using `C-c C-x C-c (org-agenda-columns)` doesn't return the same results in 
my original org file as it does in the archived file.)

**What's a workflow that will allow me to open up my archived TO-DOs to 
evaluate them?**

Thank you!

Avery

Re: [O] Bug: MobileOrg pull broken

2016-08-07 Thread Ian Dunn
Nicolas Goaziou  writes:

> Hello,
>
> Ian Dunn  writes:
>
>> I stepped through org-mobile-apply using Edebug and found that the
>> problem is with "(eval cmd)" in org-mobile.el, line 889. It fails with
>> the error "(void-variable data)". I don't know why this is happening,
>> but I've included a simple fix for this that passes the `data', `old',
>> and `new' variables as a lexical environment to `eval'. This may not
>> work if `org-mobile-action-alist' is modified.
>
> Actually `org-mobile-action-alist' is not meant to be modified, per its
> docstring. Anyway I replaced the action sexp with a function. Does it
> solve the problem ?
>
> Regards,

  It almost worked, but your change to `org-mobile-action-alist' doesn't need 
the function quote.

-- 
Ian Dunn

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 93b1481..f7ae0a9 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -228,7 +228,7 @@ capture file `mobileorg.org' back to the WebDAV directory, 
for example
 using `rsync' or `scp'.")
 
 (defconst org-mobile-action-alist
-  '(("edit" . #'org-mobile-edit))
+  '(("edit" . org-mobile-edit))
   "Alist with flags and actions for mobile sync.
 When flagging an entry, MobileOrg will create entries that look like



[O] ox-md.el: Export TOC and Footnotes as Markdown rather than HTML

2016-08-07 Thread Jake Romer
Hi all,

I notice that in Org 8.3, `org-md-export-as-markdown` and
`org-md-export-to-markdown` render a document's Table of Contents and
Footnotes sections as HTML rather than Markdown.

I have a couple of patches that change this behavior so that both are
rendered as Markdown. I'd love to hear any thoughts or suggestions for
improvement if you think this would be useful to include in ox-md.el.

A description of the changes is attached in the accompanying Org doc.

Thanks!


render-toc-and-fn-as-md.org
Description: Binary data


render-toc-and-fn-as-md.patch
Description: Binary data


Re: [O] [PATCH] Re: links-9.0 v3

2016-08-07 Thread John Kitchin
That looks like the correct fix for org-eww.el.

What is the protocol for fixing the contrib packages? I can take a pass
at doing it if it is ok.



Matt Lundin writes:

> Thanks, John, for improving link functionality in org-mode!
>
> I just discovered that this change breaks the contrib files that use
> org-store-link-functions and org-add-link-type.
>
> I'm not familiar enough with the details of org-link-set-parameters to
> fix all of the contrib files, but I am including a simple patch to
> update a contrib file that I use regularly: org-eww.el.
>
> Thanks,
> Matt


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Scaling of image previews in org-mode

2016-08-07 Thread John Kitchin
I use this code here:
https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L957

to provide inline scaling in Emacs when it is not built with imagemagick.

Johannes Brauer writes:

> Hi!
>
> If I insert a jpg in my org-mode document, I can preview it but not scale its 
> width, like so:
>
> Add the following code to my init.el file:
> (setq org-image-actual-width nil)
>
> Then insert this code in my document, where I want the image to appear:
> #+ATTR_ORG: :width 20
> [[./test.jpg]]
>
> No matter which value I give for the width argument the image appears in the 
> buffer always in its original size.
>
> However, scaling for html export with #+attr_html works fine.

Export is not the same as the inline scaling. I am not sure what happens
with export, but the browser may be doing the scaling.

>
> What is going wrong?
>
> (Org-mode version 8.3.4 (8.3.4-99-ga8e4a3-elpa @ 
> /Users/johannes/Library/Preferences/Aquamacs 
> Emacs/Packages/elpa/org-20160704/)
>
> Johannes


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Bug: MobileOrg pull broken

2016-08-07 Thread Nicolas Goaziou
Hello,

Ian Dunn  writes:

> I stepped through org-mobile-apply using Edebug and found that the
> problem is with "(eval cmd)" in org-mobile.el, line 889. It fails with
> the error "(void-variable data)". I don't know why this is happening,
> but I've included a simple fix for this that passes the `data', `old',
> and `new' variables as a lexical environment to `eval'. This may not
> work if `org-mobile-action-alist' is modified.

Actually `org-mobile-action-alist' is not meant to be modified, per its
docstring. Anyway I replaced the action sexp with a function. Does it
solve the problem ?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: clock table report hang when using :tags [8.2.10 (release_8.2.10 @ c:/Program Files/emacs/share/emacs/24.5/lisp/org/)]

2016-08-07 Thread Nicolas Goaziou
Hello,

Yichao Woo  writes:

> Using command org-dblock-update in the following piece of org-mode text
> result in emacs hanging (but can exit using C-g key combo). The primary
> reason I found for the issue is the use of ‘:tags “hello”. If I remove
> it, the report will be generated.
>
> here is the text resulting the hanging of command org-dblock-update
>
> ** hh
> #+BEGIN: clocktable :maxlevel 5 :scope subtree :tags "hello"
>
> #+END:
> *** gogogo:hello:
> :LOGBOOK:
> CLOCK: [2016-07-26 Tue 12:45]--[2016-07-26 Tue 13:45] =>  1:00
> :END:
>
> Emacs : GNU Emacs 24.5.1 (i686-pc-mingw32)
> of 2015-04-11 on LEG570
> Package: Org-mode version 8.2.10 (release_8.2.10 @ c:/Program
> Files/emacs/share/emacs/24.5/lisp/org/)

You need to update Org to the latest stable release.

Regards,

-- 
Nicolas Goaziou



[O] bibliography html export

2016-08-07 Thread Johannes Brauer
Using ox-bibtex for bibliography html export I always get the complete content 
of my .bib file under the headline References. How can I achieve that the 
bibliography contains only the references cited in the org file?

Johannes


Re: [O] Error with inline image resizing

2016-08-07 Thread John Kitchin
You could try this approach
https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L957  to
line 1109. It uses the external ImageMagick command mogrify to
resize the images. It monkeypatches org-display-inline-images to do
that.


Takeshi Teshima writes:

> Hi all,
>
> When I try to show inline images automatically resized in an org-mode
> buffer, the thumbnail doesn't show (a big blank box shows where the resized
> image should be) and the following errors are echoed in the "*Messages*"
> buffer.
>
> ```
> ImageMagick error: no decode delegate for this image format `JPEG' @
> error/constitute.c/ReadImage/504
> ```
>
> The image types I have tried are JPG and PNG.
> When tried with a PNG file, the error message changes to
> ```
> ImageMagick error: no decode delegate for this image format `PNG' @
> error/constitute.c/ReadImage/504
> ```
>
> * [Related settings]:
>
> ** init.el
>
> `(setq org-image-actual-width nil)`
>
> ** the org-mode file
>
> ```
>
> #+ATTR_LATEX: :width 300pt
>
> [[file:20160802-142357_2016-08-02_13.35.28-1.jpg]]
>
> ```
>
> I tried this with Emacs running in the safe mode, i.e. running with "-q"
> option.
>
> The inline image shows correctly (with the original size) until I set
> `org-image-actual-width` to `nil`, after which I don't see the image in the
> buffer
>
>  (A big blank box appears where the image should be. I also see the errors
> mentioned above in the "*Messages*" buffer.).
>
> * [Current workaround I use]:
> It doesn't occur when I use the snippet in this SO answer.
> http://stackoverflow.com/questions/17637685/configuring-emacs-for-showing-fixed-width-inline-images
> It basically rewrites org-display-inline-images function.
>
> * [Environmental information]:
> ** (i) I built my Emacs using the following tool:
> https://github.com/renard/emacs-build-macosx
> by running `./build-emacs emacs-24.5`.
> It was built with ImageMagick, and I can correctly export LaTeX formula
> with it.
> Also it works fine when I don't use the resize feature, i.e.
> `org-image-actual-width` is set to `t`.
>
> ** (ii) Versions
> *** Emacs:  emacs-24.5.50.1
> *** Mac OS X: El Capitan 10.11.6(15G31).
>
> *** $ convert --version
>
> Version: ImageMagick 6.9.5-1 Q16 x86_64 2016-07-15
> http://www.imagemagick.org
>
> Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
>
> License: http://www.imagemagick.org/script/license.php
>
> Features: Cipher DPC Modules
>
> Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff webp xml
> zlib
>
>
> Thank you very much in advance.
>
> diadochos


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Documentclass for latex preview images

2016-08-07 Thread John Kitchin
See the variable org-format-latex-header.


Maik Schünemann writes:

> Hi,
>
> Is there an option to set the documentclass that is used in temporary files
> to create latex preview images?
>
> I am writing math texts with org mode and am using amsthm for theorems etc
> and let them be counted by chapter:
>
> #+LATEX_HEADER: \usepackage{amsthm}
> #+LATEX_HEADER: \newtheorem{thm}{Theorem}[chapter]
> #+LATEX_HEADER: \newtheorem{defn}{Definition}[chapter]
> #+LATEX_HEADER: \newtheorem{prop}{Proposition}[chapter]
>
> After I put these lines in my .org file, latex preview images stopped
> working although latex export still did. The problem is that in the
> temporary files used to generate the preview images, the documentclass
> article is used which doesn't define the counter chapter.
>
> I managed to resolve this issue for me by checking for presence of the
> counter.
> #+LATEX_HEADER: \makeatletter
> #+LATEX_HEADER: \newcommand\ifcounter[3]{\@ifundefined{c@#1}{#3}{#2}}
> #+LATEX_HEADER: \makeatother
> #+LATEX_HEADER: \ifcounter{chapter}{
> #+LATEX_HEADER: \newtheorem{thm}{Theorem}[chapter]
> #+LATEX_HEADER: \newtheorem{defn}{Definition}[chapter]
> #+LATEX_HEADER: \newtheorem{prop}{Proposition}[chapter]
> #+LATEX_HEADER: }{}
>
>
> Is there a downside to using the same document class as the org file
> specifies for export to create the preview images?
>
> Thanks,
> Maik


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Two small org-src patches

2016-08-07 Thread Clément Pit--Claudel
In 2016-08-07 15:16, Clément Pit--Claudel wrote:
> The two attached patches add this feature.

There was a small mistake in the first patch; I have reattached both of them.
From 41263e53a58fe43a123e00b5ee2ce459f1b1274e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Pit--Claudel?= 
Date: Sun, 7 Aug 2016 14:59:05 -0400
Subject: [PATCH 1/2] Use font-lock-append-text-property to apply org-src faces

* lisp/org-src.el (org-src-font-lock-fontify-block): Replace anonymous
  faces with inheritance by lists of faces constructed by
  `font-lock-add-text-property`.  This properly deals with cases when
  the source buffer's `face' property is already a list.
---
 lisp/org-src.el | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 892c52e..5906721 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -492,10 +492,7 @@ as `org-src-fontify-natively' is non-nil."
 (when (fboundp lang-mode)
   (let ((string (buffer-substring-no-properties start end))
 	(modified (buffer-modified-p))
-	(org-buffer (current-buffer))
-	(block-faces (let ((face-name (intern (format "org-block-%s" lang
-			   (append (and (facep face-name) (list face-name))
-   '(org-block)
+	(org-buffer (current-buffer)))
 	(remove-text-properties start end '(face nil))
 	(with-current-buffer
 	(get-buffer-create
@@ -509,14 +506,14 @@ as `org-src-fontify-natively' is non-nil."
 	(while (setq next (next-single-property-change pos 'face))
 	  (let ((new-face (get-text-property pos 'face)))
 		(put-text-property
-		 (+ start (1- pos)) (1- (+ start next)) 'face
-		 (list :inherit (append (and new-face (list new-face))
-	block-faces))
+		 (+ start (1- pos)) (1- (+ start next)) 'face new-face
 		 org-buffer))
-	  (setq pos next))
-	;; Add the face to the remaining part of the text.
-	(put-text-property (1- (+ start pos)) end 'face
-			   (list :inherit block-faces) org-buffer)))
+	  (setq pos next
+	;; Add org faces
+	(let ((face-name (intern (format "org-block-%s" lang
+	  (when (facep face-name)
+	(font-lock-append-text-property start end 'face face-name))
+	  (font-lock-append-text-property start end 'face 'org-block))
 	(add-text-properties
 	 start end
 	 '(font-lock-fontified t fontified t font-lock-multiline t))
-- 
2.7.4

From f764ad7379a98ea31b9e492dfa5bd447a2135314 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Pit--Claudel?= 
Date: Sun, 7 Aug 2016 15:03:55 -0400
Subject: [PATCH 2/2] Copy all font-lock properties in org-src, not just face

* lisp/org-src (org-src-font-lock-fontify-block): Loop over
  `font-lock-extra-managed-props', thus copying other properties that
  might be applied using font-lock.  An example is composition, applied
  by `prettify-symbols-mode'.
---
 lisp/org-src.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 5906721..04f5f62 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -503,11 +503,12 @@ as `org-src-fontify-natively' is non-nil."
 	  (unless (eq major-mode lang-mode) (funcall lang-mode))
 	  (org-font-lock-ensure)
 	  (let ((pos (point-min)) next)
-	(while (setq next (next-single-property-change pos 'face))
-	  (let ((new-face (get-text-property pos 'face)))
-		(put-text-property
-		 (+ start (1- pos)) (1- (+ start next)) 'face new-face
-		 org-buffer))
+	(while (setq next (next-property-change pos))
+	  (dolist (prop (cons 'face font-lock-extra-managed-props))
+		(let ((new-prop (get-text-property pos prop)))
+		  (put-text-property
+		   (+ start (1- pos)) (1- (+ start next)) prop new-prop
+		   org-buffer)))
 	  (setq pos next
 	;; Add org faces
 	(let ((face-name (intern (format "org-block-%s" lang
-- 
2.7.4



signature.asc
Description: OpenPGP digital signature


[O] Two small org-src patches

2016-08-07 Thread Clément Pit--Claudel
Hi emacs-orgmode,

I use prettify-symbols-mode heavily, and prettification isn't currently copied 
by org-src's native fontification. The two attached patches add this feature. 
You can test them by enabling global-prettify-symbols-mode and creating an 
emacs-lisp code block in org-mode. I already have FSF papers on file.

The first one is not strictly necessary, but it makes the second one easier to 
write, and it fixes (what I think is) a bug in the current implementation (if 
the 'face in the fontified buffer is already a list, say '(a b), then org-src 
will construct an invalid face '(:inherit (a b) org-block)) instead of 
(:inherit (a b org-block))—which could really just be (a b org-block), as done 
by patch 1). 

Cheers,
Clément.
From 1ee0c94dba1519d7a32161a826421b455cea75b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Pit--Claudel?= 
Date: Sun, 7 Aug 2016 14:59:05 -0400
Subject: [PATCH 1/2] Use font-lock-append-text-property to apply org-src faces

* lisp/org-src.el (org-src-font-lock-fontify-block): Replace anonymous
  faces with inheritance by lists of faces constructed by
  `font-lock-add-text-property`.  This properly deals with cases when
  the source buffer's `face' property is already a list.
---
 lisp/org-src.el | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 892c52e..9392e58 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -492,10 +492,7 @@ as `org-src-fontify-natively' is non-nil."
 (when (fboundp lang-mode)
   (let ((string (buffer-substring-no-properties start end))
 	(modified (buffer-modified-p))
-	(org-buffer (current-buffer))
-	(block-faces (let ((face-name (intern (format "org-block-%s" lang
-			   (append (and (facep face-name) (list face-name))
-   '(org-block)
+	(org-buffer (current-buffer)))
 	(remove-text-properties start end '(face nil))
 	(with-current-buffer
 	(get-buffer-create
@@ -509,14 +506,14 @@ as `org-src-fontify-natively' is non-nil."
 	(while (setq next (next-single-property-change pos 'face))
 	  (let ((new-face (get-text-property pos 'face)))
 		(put-text-property
-		 (+ start (1- pos)) (1- (+ start next)) 'face
-		 (list :inherit (append (and new-face (list new-face))
-	block-faces))
+		 (+ start (1- pos)) (1- (+ start next)) 'face new-face
 		 org-buffer))
-	  (setq pos next))
-	;; Add the face to the remaining part of the text.
-	(put-text-property (1- (+ start pos)) end 'face
-			   (list :inherit block-faces) org-buffer)))
+	  (setq pos next
+	;; Add org faces
+	(let ((face-name (intern (format "org-block-%s" lang
+	  (when face-name
+	(font-lock-append-text-property start end 'face face-name))
+	  (font-lock-append-text-property start end 'face 'org-block))
 	(add-text-properties
 	 start end
 	 '(font-lock-fontified t fontified t font-lock-multiline t))
-- 
2.7.4

From 6a586ffca728f78d9a0dbb5b27eb3388e5fdd49f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Pit--Claudel?= 
Date: Sun, 7 Aug 2016 15:03:55 -0400
Subject: [PATCH 2/2] Copy all font-lock properties in org-src, not just face

* lisp/org-src (org-src-font-lock-fontify-block): Loop over
  `font-lock-extra-managed-props', thus copying other properties that
  might be applied using font-lock.  An example is composition, applied
  by `prettify-symbols-mode'.
---
 lisp/org-src.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 9392e58..33eee4b 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -503,11 +503,12 @@ as `org-src-fontify-natively' is non-nil."
 	  (unless (eq major-mode lang-mode) (funcall lang-mode))
 	  (org-font-lock-ensure)
 	  (let ((pos (point-min)) next)
-	(while (setq next (next-single-property-change pos 'face))
-	  (let ((new-face (get-text-property pos 'face)))
-		(put-text-property
-		 (+ start (1- pos)) (1- (+ start next)) 'face new-face
-		 org-buffer))
+	(while (setq next (next-property-change pos))
+	  (dolist (prop (cons 'face font-lock-extra-managed-props))
+		(let ((new-prop (get-text-property pos prop)))
+		  (put-text-property
+		   (+ start (1- pos)) (1- (+ start next)) prop new-prop
+		   org-buffer)))
 	  (setq pos next
 	;; Add org faces
 	(let ((face-name (intern (format "org-block-%s" lang
-- 
2.7.4



signature.asc
Description: OpenPGP digital signature