emacs-devel
[Top][All Lists]
Advanced

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

Re: hexl-find-file is sloooow


From: Masatake YAMATO
Subject: Re: hexl-find-file is sloooow
Date: Tue, 21 Dec 2004 20:47:09 +0900 (JST)

> >> hexl-find-file is quite slow -- loading a 4MByte font takes more than
> >> half a minute on my laptop...
> >> 
> >> I ask to add progress information while hexl-find-file is running.
> >> 
> >> Of course, this isn't something urgent, but perhaps it can be added to
> >> the post-release TODO list.
> >
> > It seems that fontification takes long time.
> > As far as I can remember the area fontification is introduced by me.
> > Do you want to turn off the fortification?
> 
> Maybe it could be turned off for large files?
> Or it could at least ask for confirmation to fontify a large buffer.

Thank you for your suggestion.
Before implementing your idea, I'd like to try my idea.

In the fontification code, `re-search-forward' is used:

    (save-excursion
      (goto-char (point-min))
      (while (re-search-forward "^[0-9a-f]+:" nil t)
        (put-text-property (match-beginning 0) (match-end 0)
                           'font-lock-face 'hexl-address-area))
      (goto-char (point-min))
      (while (re-search-forward "  \\(.+$\\)" nil t)
        (put-text-property (match-beginning 1) (match-end 1) 
                           'font-lock-face 'hexl-ascii-area)))

I think it is possible to do the same thing without `re-search-forward'.
If `re-search-forward' takes longer time than `put-text-property', 
the fontification code will be faster with my idea.

Masatake YAMATO




reply via email to

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