From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Inefficient redisplay
Date: Mon, 12 Apr 2010 15:28:22 -0400 [thread overview]
Message-ID: <jwvd3y4schx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83y6gsy4i0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Apr 2010 20:17:43 +0300")
>> One related problem (which can be witnessed firsthand from Elisp) is
>> that all the text between point-min and the window's point is jit-locked
>> (even though only the text visible in the window should need to be
>> jit-locked).
> I believe this is because of the following heuristics in jit-lock.el:
> ;; Decide which range of text should be fontified.
> ;; The problem is that START and NEXT may be in the
> ;; middle of something matched by a font-lock regexp.
> ;; Until someone has a better idea, let's start
> ;; at the start of the line containing START and
> ;; stop at the start of the line following NEXT.
> (goto-char next) (setq next (line-beginning-position 2))
> (goto-char start) (setq start (line-beginning-position))
No, the trace I showed was for jit-lock-function which comes before this
piece of code (jit-lock-function calls jit-lock-fontify-now).
And even if that had some impact, it wouldn't explain the behavior,
since line-beginning-position works fine: it find the buffer's \n chars
and stops there, oblivious to the fact that they have a `display'
property which makes them appear differently.
>> This makes nhexl-mode completely unusable except on small buffers
> I suggest, first of all, to understand why the display engine misses
> the newlines you say you have in the before-strings.
Given my lack of understanding of the redisplay code, this is
more difficult.
> The Emacs display code is known to behave very unfriendly when lines
> are too long, so my first advice would be not to do what hurts.
The buffer's actual text doesn't have long lines, and the display
doesn't have long lines either, so it really *should* work fine.
And of course there isn't much I can do about it: the whole point of the
exercise is to make a hexl-mode variant which works only by modifying
the display but not the buffer's text (so it doesn't mess with the
undo-list, etc...).
Stefan
next prev parent reply other threads:[~2010-04-12 19:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 4:34 Inefficient redisplay Stefan Monnier
2010-04-12 17:17 ` Eli Zaretskii
2010-04-12 19:28 ` Stefan Monnier [this message]
2010-04-12 20:53 ` Eli Zaretskii
2010-04-12 21:46 ` Stefan Monnier
2010-04-13 20:05 ` Eli Zaretskii
2010-04-14 18:13 ` Eli Zaretskii
2010-04-15 4:38 ` Stefan Monnier
2010-04-15 11:05 ` Eli Zaretskii
2010-04-15 17:34 ` Stefan Monnier
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=jwvd3y4schx.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--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.