From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: hexl-find-file is sloooow Date: Tue, 21 Dec 2004 17:50:09 +0900 (JST) Message-ID: <20041221.175009.221966310.jet@gyve.org> References: <20041221.081752.05872292.wl@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1103619389 7640 80.91.229.6 (21 Dec 2004 08:56:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Dec 2004 08:56:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 21 09:56:19 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CgfoY-0002pR-00 for ; Tue, 21 Dec 2004 09:56:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cgfz2-0002fP-W4 for ged-emacs-devel@m.gmane.org; Tue, 21 Dec 2004 04:07:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cgfy7-0002dl-JV for emacs-devel@gnu.org; Tue, 21 Dec 2004 04:06:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cgfy2-0002bi-VZ for emacs-devel@gnu.org; Tue, 21 Dec 2004 04:06:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cgfy2-0002aQ-Ba for emacs-devel@gnu.org; Tue, 21 Dec 2004 04:06:06 -0500 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CgfmS-00073z-O1; Tue, 21 Dec 2004 03:54:09 -0500 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iBL8s663016972; Tue, 21 Dec 2004 03:54:06 -0500 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iBL8rxr06070; Tue, 21 Dec 2004 03:54:00 -0500 Original-Received: from localhost (gls07.tokyo.redhat.com [172.16.32.104]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id iBL8ruqa026196; Tue, 21 Dec 2004 17:53:57 +0900 Original-To: wl@gnu.org In-Reply-To: <20041221.081752.05872292.wl@gnu.org> X-Mailer: Mew version 4.0.62 on Emacs 21.3.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:31303 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31303 > 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? Anyway, here is a progress reporter. If there is no objection, I will install this patch in a day. Regards, Masatake YAMATO 2004-12-21 Masatake YAMATO * hexl.el (hexlify-buffer): Report fontification progress. Index: hexl.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/hexl.el,v retrieving revision 1.90 diff -u -r1.90 hexl.el --- hexl.el 21 Nov 2004 00:38:34 -0000 1.90 +++ hexl.el 21 Dec 2004 08:46:23 -0000 @@ -680,19 +680,26 @@ ;; Don't decode text in the ASCII part of `hexl' program output. (let ((coding-system-for-read 'raw-text) (coding-system-for-write buffer-file-coding-system) - (buffer-undo-list t)) + (buffer-undo-list t) + progress pmax) (apply 'call-process-region (point-min) (point-max) (expand-file-name hexl-program exec-directory) t t nil (split-string hexl-options)) + (setq pmax (point-max) + progress (make-progress-reporter "Hexl Buffer Fontification " + (point-min) (* 2 pmax))) (save-excursion (goto-char (point-min)) (while (re-search-forward "^[0-9a-f]+:" nil t) + (progress-reporter-update progress (point)) (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) + (progress-reporter-update progress (+ pmax (point))) (put-text-property (match-beginning 1) (match-end 1) 'font-lock-face 'hexl-ascii-area))) + (progress-reporter-done progress) (if (> (point) (hexl-address-to-marker hexl-max-address)) (hexl-goto-address hexl-max-address))))