From: Kaushal Modi <kaushal.modi@gmail.com>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, Emacs developers <emacs-devel@gnu.org>
Subject: Re: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer?
Date: Mon, 22 Feb 2016 11:35:58 -0500 [thread overview]
Message-ID: <CAFyQvY2Cyh6h15pHAyzHz9goKraXmKmbTzjipn3XuHEvpkvjBA@mail.gmail.com> (raw)
In-Reply-To: <56CB3756.6000906@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
On Mon, Feb 22, 2016 at 11:29 AM, Clément Pit--Claudel <
clement.pit@gmail.com> wrote:
> In any case where font-lock-fontified is nil font-lock-fontify-buffer will
> properly refontify the whole buffer, but font-lock-flush and font-lock
> ensure will not do anything. I don't know what causes that variable to be
> nil in the first place, though.
I am not sure if this is related. But in order for hi-lock-file-patterns to
work in a text-mode buffer, I need to do the below because
font-lock-fontified is nil for text-mode (as technically there are no
comments or keywords to highlight in that major mode).
;; Enable `hi-lock-mode' in `text-mode' too
;; The hi-lock fontification will not be visible (the
`font-lock-keywords'
;; variable will not be updated unless `font-lock-fontified' is already
`t'.
;; This was derived by studying the definition of
`hi-lock-font-lock-hook'
;; function.
(defun modi/hi-lock-enable-in-text-mode ()
(setq-local font-lock-fontified t))
(add-hook 'text-mode-hook #'modi/hi-lock-enable-in-text-mode)
--
Kaushal Modi
[-- Attachment #2: Type: text/html, Size: 1939 bytes --]
next prev parent reply other threads:[~2016-02-22 16:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 4:55 What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer? Clément Pit--Claudel
2016-02-22 8:56 ` Anders Lindgren
2016-02-22 13:49 ` Clément Pit--Claudel
2016-02-22 15:53 ` Anders Lindgren
2016-02-22 16:13 ` Eli Zaretskii
2016-02-22 16:29 ` Clément Pit--Claudel
2016-02-22 16:35 ` Kaushal Modi [this message]
2016-02-22 16:40 ` Eli Zaretskii
2016-02-22 17:28 ` Clément Pit--Claudel
2016-02-23 16:57 ` Eli Zaretskii
2016-02-23 18:08 ` Clément Pit--Claudel
2016-02-24 3:52 ` Stefan Monnier
2016-02-24 17:12 ` Eli Zaretskii
2016-02-24 18:55 ` Stefan Monnier
2016-02-24 19:17 ` Eli Zaretskii
2016-02-24 20:09 ` Stefan Monnier
2016-04-09 18:59 ` Clément Pit--Claudel
2016-04-09 19:37 ` Eli Zaretskii
2016-04-09 19:54 ` Clément Pit--Claudel
2016-04-10 20:10 ` Stefan Monnier
[not found] ` <<jwv1t829byc.fsf-monnier+emacs@gnu.org>
[not found] ` <<838u29hq9x.fsf@gnu.org>
2016-02-24 19:20 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFyQvY2Cyh6h15pHAyzHz9goKraXmKmbTzjipn3XuHEvpkvjBA@mail.gmail.com \
--to=kaushal.modi@gmail.com \
--cc=clement.pit@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.