From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: bug#22399: org-mode fontification Date: Wed, 20 Jan 2016 12:18:42 -0500 Message-ID: <87ziw0goel.fsf_-___12357.4601755992$1453310399$gmane$org@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> <871t9d4cg3.fsf@gmx.us> <874me8pjii.fsf__7050.42196573249$1453290031$gmane$org@russet.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLwPX-0003VN-GE for emacs-orgmode@gnu.org; Wed, 20 Jan 2016 12:19:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLwPW-0002Hb-8T for emacs-orgmode@gnu.org; Wed, 20 Jan 2016 12:19:11 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <874me8pjii.fsf__7050.42196573249$1453290031$gmane$org@russet.org.uk> (Phillip Lord's message of "Wed, 20 Jan 2016 11:39:33 +0000") 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: Phillip Lord Cc: 22399@debbugs.gnu.org, Stefan Monnier , Rasmus --=-=-= Content-Type: text/plain phillip.lord@russet.org.uk (Phillip Lord) writes: > Rasmus writes: >> >> 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. >> >> Looks good, thanks. > > > Just checking whether on who is going to apply the patches! They don't > seem to be on emacs-25 yet. I have copyright assignment with the FSF (for Org mode contributions), but I haven't contributed to Emacs directly before. I'm cc'ing Stefan because these patches are touching his changes. I've re-attached the most recent set of patches (http://permalink.gmane.org/gmane.emacs.bugs/111756). --=-=-= 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 --=-=-=--