From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kyle Meyer Newsgroups: gmane.emacs.bugs Subject: bug#22399: org-mode fontification Date: Tue, 19 Jan 2016 13:04:15 -0500 Message-ID: <87d1sx8mzk.fsf__35146.023767493$1453226722$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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1453226722 26758 80.91.229.3 (19 Jan 2016 18:05:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Jan 2016 18:05:22 +0000 (UTC) To: 22399@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 19 19:05:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aLaeU-0000Jx-U7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 19:05:11 +0100 Original-Received: from localhost ([::1]:38670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLaeU-0006Pw-5Y for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 13:05:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLaeQ-0006Pr-1j for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 13:05:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLaeM-0008Fs-1z for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 13:05:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLaeL-0008Fa-V7; Tue, 19 Jan 2016 13:05:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aLaeL-0006uE-L9; Tue, 19 Jan 2016 13:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kyle Meyer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Tue, 19 Jan 2016 18:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22399 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: X-Debbugs-Original-To: emacs-orgmode@gnu.org X-Debbugs-Original-Cc: 22399@debbugs.gnu.org Original-Received: via spool by 22399-submit@debbugs.gnu.org id=B22399.145322666526494 (code B ref 22399); Tue, 19 Jan 2016 18:05:01 +0000 Original-Received: (at 22399) by debbugs.gnu.org; 19 Jan 2016 18:04:25 +0000 Original-Received: from localhost ([127.0.0.1]:53984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLadk-0006tG-KI for submit@debbugs.gnu.org; Tue, 19 Jan 2016 13:04:24 -0500 Original-Received: from pb-smtp0.int.icgroup.com ([208.72.237.35]:59500 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLadi-0006t8-DO for 22399@debbugs.gnu.org; Tue, 19 Jan 2016 13:04:23 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp0.pobox.com (Postfix) with ESMTP id E75A73BC52; Tue, 19 Jan 2016 13:04:21 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=HObKEM2syj+Ful8zlcBmW/EoM/s=; b=M058bX 3Ffz3UzdpmvXgpwqXas01g6lEmVdqyY1+68oYE8cIUSJYycvrhNkJiS/JKASvz+B nhzsQiGua/ktWqP31gBcXDBvEAJApRPThvlVqJCmyUAnuIQTTzBNZer4OYVoh5pb dwjJ7g5tAME7cxWtDtpT6Nij2CtawJMJDyAkc= Original-Received: from pb-smtp0.int.icgroup.com (unknown [127.0.0.1]) by pb-smtp0.pobox.com (Postfix) with ESMTP id DDA163BC51; Tue, 19 Jan 2016 13:04:21 -0500 (EST) Original-Received: from localhost (unknown [130.132.173.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp0.pobox.com (Postfix) with ESMTPSA id 8146E3BC50; Tue, 19 Jan 2016 13:04:21 -0500 (EST) X-Attribution: Kyle In-Reply-To: <87wpr5zirr.fsf@kyleam.com> (Kyle Meyer's message of "Tue, 19 Jan 2016 10:33:12 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Pobox-Relay-ID: 10E5C530-BED7-11E5-A54C-6BD26AB36C07-24757444!pb-smtp0.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111756 Archived-At: --=-=-= 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 --=-=-=--