🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87448

font-lock still causing excessive redisplay

#87448
From: dbrooks
Date: Thu, 15 Sep 1994 20:14
53 lines
2598 bytes
In GNU Emacs 19.26.1 (hppa1.1-hp-hpux9) of Thu Sep 15 1994 on cobra

The 19.26 version of font-lock calls save-restriction/narrow-to-region,
which both set clip_changed, which is tested in redisplay, which sets
all_windows and calls clear_face_vector.

So, every time you type a character in a comment, the graphic contexts get
freed and new ones allocated.

I still think that clear_face_vector is called too readily, but I haven't
looked too hard for a decent place to call it (maybe every time a window
displays a new buffer or is destroyed).

Note that, even with this patch, if you have the same buffer in two
different windows (like just after ^X-2), you still get the face vector
cleared on every keystroke.  But this makes it a lot better.

David Brooks
ICS

*** font-lock.el.orig	Thu Sep 15 15:52:47 1994
--- font-lock.el	Wed Sep 14 13:26:57 1994
***************
*** 191,205 ****
  	      ;; We found a real comment start.
  	      (let ((beg (match-beginning 0)))
  		(goto-char beg)
! 		(save-restriction
! 		  (narrow-to-region (point-min) end)
! 		  (condition-case nil
! 		      (progn
! 			(forward-comment 1)
! 			;; forward-comment skips all whitespace,
! 			;; so go back to the real end of the comment.
! 			(skip-chars-backward " \t"))
! 		    (error (goto-char end))))
  		(put-text-property beg (point) 'face font-lock-comment-face)
  		(setq state (parse-partial-sexp here (point) nil nil state)))
  	    (if (nth 3 state)
--- 191,203 ----
  	      ;; We found a real comment start.
  	      (let ((beg (match-beginning 0)))
  		(goto-char beg)
! 		(condition-case nil
! 		    (progn
! 		      (forward-comment 1)
! 		      (skip-chars-backward " \t")
! 		      (if (> (point) end)
! 			  (goto-char end)))
! 		  (error (goto-char end)))
  		(put-text-property beg (point) 'face font-lock-comment-face)
  		(setq state (parse-partial-sexp here (point) nil nil state)))
  	    (if (nth 3 state)
Technical Details
Message-ID: <9409152002.AA18904@cobra>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!ics.com!dbrooks

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,477db97a58fec60a,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-09-16 09:48:21 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!ics.com!dbrooks
From: dbrooks@ics.com
Newsgroups: gnu.emacs.bug
Subject: font-lock still causing excessive redisplay
Date: 15 Sep 1994 16:14:06 -0400
Organization: GNUs Not Usenet
Lines: 53
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9409152002.AA18904@cobra>