emacs-devel
[Top][All Lists]
Advanced

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

Re: Display slowness that is painful


From: Kim F. Storm
Subject: Re: Display slowness that is painful
Date: Fri, 03 Feb 2006 10:55:29 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, address@hidden (Kim F. Storm) writes:
>
> I think another reason of the slowness is this part (in
> set_iterator_to_next):
>
>     case GET_FROM_DISPLAY_VECTOR:
> [...]
>       /* Restore face of the iterator to what they were before the
>          display vector entry (these entries may contain faces).  */
>       it->face_id = it->saved_face_id;
>
>       if (it->dpvec + it->current.dpvec_index == it->dpend)
>       {
> [...]
>         /* Recheck faces after display vector */
>         it->stop_charpos = IT_CHARPOS (*it);
>       }
>       break;
>
> Because of this, it seems that handle_stop is called for
> every character after an eight bit character.  Isn't it
> possible to tune it?  First of all, why should we recheck
> faces after display vector?

2004-12-13  Kim F. Storm  <address@hidden>

        * xdisp.c (set_iterator_to_next): Reset stop_charpos after display
        vector.

It was made to fix the following bug:

> From:         Stefan Monnier
> Subject:      Incorrect faces on display
> Date:         Thu, 09 Dec 2004 17:15:31 -0500
> User-agent:   Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)
>
> I started seeing recently problems where elisp code gets displayed with the
> font-lock-comment-face even though it's not a comment.
>
> This always shows up right after an invisible piece of text (I use
> outline-minor-mode in elisp).
>
> I first thought it was some funny bug in font-lock or jit-lock, but a quick
> C-u C-x = shows that the text-properties are correct: the problem is in
> the redisplay.
>
> I finally came up with a recipe to reproduce it:
>
>    emacs -Q -f global-font-lock-mode -f outline-minor-mode
>
>    (; RET a RET (foobar C-u 1000 M-x hide-sublevels
>
> If all goes well, you'll see that the second line displays "(foobar" using
> font-lock-comment-face.


The following addition to my previous patch changes this to only
recheck after ellipsis.  It does indeed speed up redisplay even
more.

I cannot say whether this will break other redisplay cases though:



*** xdisp.c     24 Jan 2006 09:30:15 +0100      1.1073
--- xdisp.c     03 Feb 2006 10:28:21 +0100      
***************
*** 5694,5699 ****
--- 5714,5721 ----
  
        if (it->dpvec + it->current.dpvec_index == it->dpend)
        {
+         int recheck_faces = it->ellipsis_p;
+ 
          if (it->s)
            it->method = GET_FROM_C_STRING;
          else if (STRINGP (it->string))
***************
*** 5716,5723 ****
              set_iterator_to_next (it, reseat_p);
            }
  
!         /* Recheck faces after display vector */
!         it->stop_charpos = IT_CHARPOS (*it);
        }
        break;
  
--- 5738,5746 ----
              set_iterator_to_next (it, reseat_p);
            }
  
!         /* Maybe recheck faces after display vector */
!         if (recheck_faces)
!           it->stop_charpos = IT_CHARPOS (*it);
        }
        break;
  


--
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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