emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix verbatim block fontification to end blocks on headlines


From: Tom Gillespie
Subject: Re: [PATCH] Fix verbatim block fontification to end blocks on headlines
Date: Fri, 13 Dec 2019 15:25:17 -0800

Adam Porter <address@hidden> writes:

> May I recommend using the rx macro for regexps?  They are much easier
> for humans to parse, which helps reduce errors like the ones mentioned
> here.  And they are about to gain some very useful new features
> in Emacs 27.

Yep. I'll switch the regex in over to use rx.


An unrelated question.

I've written some basic tests for this and I couldn't find any other
tests that seemed to deal with fontification at all. In order to get
fontification tests to work I added a call to `font-lock-ensure' inside
`org-test-with-temp-text' (see excerpted patch bit below). Given how
frequently `org-test-with-temp-text' is used, does it make sense to
create a separate version of that macro just for testing with
fontification? I have no idea what the performance impact would be, so
any guidance is appreciated.

diff --git a/testing/org-test.el b/testing/org-test.el
index c3e21eb30..e97e2eaa4 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -198,7 +198,8 @@ otherwise place the point at the beginning of the
inserted text."
               (insert (replace-match "" nil nil inside-text))
               (goto-char (1+ (match-beginning 0))))
           (insert inside-text)
-          (goto-char (point-min))))
+          (goto-char (point-min)))
+        (font-lock-ensure (point-min) (point-max)))
        ,@body)))
 (def-edebug-spec org-test-with-temp-text (form body))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]