🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #88053

Re: font-lock-fontify-region doesn't seem to work right

#88053
From: Simon Marshall
Date: Fri, 05 Aug 1994 23:28
22 lines
1871 bytes
tim> Re-select the same region.  Use "ESC ESC (font-lock-fontify-region
tim> (region-beginning) (region-end)) RET" to re-fontify the region.  Note
tim> that the comment and string are underlined, but the keyword "if" is
tim> not.  I expect to see the "if" keyword underlined.  Use "M-x
tim> font-lock-fontify-buffer RET", and see that "if" becomes underlined
tim> again.

tim> Fontify-region and fontify-buffer should give the same results on the
tim> affected text, right?

No; `font-lock-unfontify-region' does indeed remove all `face' text
properties from the region, and `font-lock-fontify-buffer' does do all
fontification.  However as the doc-string (hint, hint) for the function
says, `font-lock-fontify-region' only does syntactic fontification.  The
function doing keywords is called `font-lock-hack-keywords'.

There are many mis-leading function names in font-lock, so if you delve
further into it don't be surprised if a function/variable does/doesn't do
what you thought it wouldn't/would.  Reading the doc-string would help
though.

Simon.
Technical Details
Message-ID: <9408050711.AA22810@plod.esrin.esa.it>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!sun.cais.com!io.org!uunet.ca!uunet.ca!scipio.cyberstore.ca!vanbc.wimsey.com!deep.rsoft.bc.ca!agate!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!mail.ESrin.ESa.IT!Simon.Marshall

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,e1a46b9b82d176c2
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-06 18:41:30 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!sun.cais.com!io.org!uunet.ca!uunet.ca!scipio.cyberstore.ca!vanbc.wimsey.com!deep.rsoft.bc.ca!agate!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!mail.ESrin.ESa.IT!Simon.Marshall
From: Simon.Marshall@mail.ESrin.ESa.IT (Simon Marshall)
Newsgroups: gnu.emacs.bug
Subject: Re: font-lock-fontify-region doesn't seem to work right
Date: 5 Aug 1994 19:28:54 -0400
Organization: GNUs Not Usenet
Lines: 23
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9408050711.AA22810@plod.esrin.esa.it>