From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: bug#22399: org-mode fontification Date: Tue, 19 Jan 2016 13:04:15 -0500 Message-ID: <87d1sx8mzk.fsf@kyleam.com> References: <87oacjng36.fsf@russet.org.uk> <87ziw36khb.fsf@gmx.us> <87a8o2zrtm.fsf@russet.org.uk> <87bn8i7mha.fsf@gmx.us> <87d1syvgc7.fsf@kyleam.com> <8737tu13la.fsf__5430.1016768024$1453185240$gmane$org@kyleam.com> <87d1sy54vt.fsf@gmx.us> <87wpr5zirr.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLadm-0005nQ-OC for emacs-orgmode@gnu.org; Tue, 19 Jan 2016 13:04:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLadj-00087o-9C for emacs-orgmode@gnu.org; Tue, 19 Jan 2016 13:04:26 -0500 Received: from pb-smtp0.int.icgroup.com ([208.72.237.35]:50989 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLadj-00087W-1u for emacs-orgmode@gnu.org; Tue, 19 Jan 2016 13:04:23 -0500 In-Reply-To: <87wpr5zirr.fsf@kyleam.com> (Kyle Meyer's message of "Tue, 19 Jan 2016 10:33:12 -0500") 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 Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: 22399@debbugs.gnu.org --=-=-= Content-Type: text/plain Kyle Meyer writes: [...] > However, it's easy enough to switch to using an org-font-lock-ensure > variant that avoids these issues, so I will do that (in an updated > patch and on Org's maint). I've attached updated patches against emacs-25. If these are applied to the Emacs repo, I'll backport the new font-lock-ensure alias to Org's maint. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-compat-Fix-font-lock-ensure-alias.patch >From d9a8014e3919c328bf2b6acbe9d9127f3b06b5e1 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 19 Jan 2016 12:53:04 -0500 Subject: [PATCH 1/2] org-compat: Fix font-lock-ensure alias * lisp/org/org-compat.el (org-font-lock-ensure): Fix check for font-lock-ensure. Make compatibility function's arguments optional to match with font-lock-ensure's. (Bug#22399) --- lisp/org/org-compat.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 6403d4d..cf6aafc 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -479,9 +479,9 @@ org-no-popups (not (null pos))))) (defalias 'org-font-lock-ensure - (if (fboundp 'org-font-lock-ensure) + (if (fboundp 'font-lock-ensure) #'font-lock-ensure - (lambda (_beg _end) (font-lock-fontify-buffer)))) + (lambda (&optional _beg _end) (font-lock-fontify-buffer)))) (defun org-floor* (x &optional y) "Return a list of the floor of X and the fractional part of X. -- 2.7.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-org-src-Use-font-lock-fontify-buffer-for-blocks.patch >From 7b2e8cd23ee5326ca2b0845bed8a5d111a2a3b17 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 19 Jan 2016 12:53:22 -0500 Subject: [PATCH 2/2] org-src: Use font-lock-fontify-buffer for blocks * lisp/org/org-src.el (org-src-font-lock-fontify-block): Use font-lock-fontify-buffer because font-lock-ensure does not display source block fonts. This corresponds to 003a0f10695f035e844d844eacb1a86a6d2df934 in the Org repo. --- lisp/org/org-src.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 8e06aaa..5548f52 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el @@ -916,7 +916,9 @@ org-src-font-lock-fontify-block (delete-region (point-min) (point-max)) (insert string " ") ;; so there's a final property change (unless (eq major-mode lang-mode) (funcall lang-mode)) - (org-font-lock-ensure) + ;; Avoid `font-lock-ensure', which does not display fonts in + ;; source block. + (font-lock-fontify-buffer) (setq pos (point-min)) (while (setq next (next-single-property-change pos 'face)) (put-text-property -- 2.7.0 --=-=-= Content-Type: text/plain -- Kyle --=-=-=--