From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sean O'Rourke" Newsgroups: gmane.emacs.devel Subject: Re: remove dabbrev--scanning-message? Date: Mon, 23 Jul 2007 17:40:29 -0700 Message-ID: References: <87abtm4slu.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1185237684 25188 80.91.229.12 (24 Jul 2007 00:41:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Jul 2007 00:41:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thien-Thi Nguyen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 24 02:41:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ID8So-00018B-IX for ged-emacs-devel@m.gmane.org; Tue, 24 Jul 2007 02:41:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ID8So-0008To-4h for ged-emacs-devel@m.gmane.org; Mon, 23 Jul 2007 20:41:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ID8Sg-0008Rc-Kg for emacs-devel@gnu.org; Mon, 23 Jul 2007 20:41:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ID8Sd-0008Pk-5Q for emacs-devel@gnu.org; Mon, 23 Jul 2007 20:41:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ID8Sc-0008Pd-RJ for emacs-devel@gnu.org; Mon, 23 Jul 2007 20:41:10 -0400 Original-Received: from outbound2.ucsd.edu ([132.239.1.206]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ID8Sc-0000F6-4K for emacs-devel@gnu.org; Mon, 23 Jul 2007 20:41:10 -0400 Original-Received: from smtp.ucsd.edu (smtp.ucsd.edu [132.239.1.49]) by outbound2.ucsd.edu (8.13.6/8.13.6) with ESMTP id l6O0eYAO039168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Jul 2007 17:40:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=2007001; d=ucsd.edu; c=simple; q=dns; b=qrOeZ6pck7Ie0wx2+1lk3mzar0V0Q+rqbkOCpMXuh0hPYDGz1yipxEfB3NpZ3xgg0 QqbYDrUNIlh0HmmvO+kyA== Original-Received: from mister-foo.local (0-16-cb-b9-d7-be.dynamic.ucsd.edu [128.54.54.202]) by smtp.ucsd.edu (8.13.6/8.13.4) with ESMTP id l6O0eXIB023581; Mon, 23 Jul 2007 17:40:34 -0700 (PDT) In-Reply-To: <87abtm4slu.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Tue\, 24 Jul 2007 01\:18\:05 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) X-detected-kernel: FreeBSD 6.x (1) 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: news.gmane.org gmane.emacs.devel:75428 Archived-At: --=-=-= Thien-Thi Nguyen writes: > () "Sean O'Rourke" > () Mon, 23 Jul 2007 15:58:56 -0700 > > (1) Replace the messages with a progress-reporter (assuming > it's faster), since the filenames probably go by too fast > to read anyways. > (2) Provide a user option `dabbrev-report-progress', true by > default, to enable/disable this feedback. > > a progress reporter displays nothing until a certain threshold is > reached (arg MIN-TIME to make-progress-reporter). Thanks for the info. Here's a patch that does this with a 1.5-sec delay. I left out the current window-minibuffer-p check, because it seems like the progress-reporter-* functions should control this behavior. 2007-07-22 Sean O'Rourke * dabbrev.el (dabbrev--scanning-message): removed. (dabbrev--find-expansion): use a progress reporter instead of dabbrev--scanning-message. (dabbrev--progress-reporter): new variable. /s --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Index: dabbrev.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/dabbrev.el,v retrieving revision 1.85 diff -u -r1.85 dabbrev.el --- dabbrev.el 16 May 2007 13:13:20 -0000 1.85 +++ dabbrev.el 24 Jul 2007 00:40:05 -0000 @@ -332,6 +332,9 @@ ;; The regexp for recognizing a character in an abbreviation. (defvar dabbrev--abbrev-char-regexp nil) +;; The progress reporter for buffer-scanning progress. +(defvar dabbrev--progress-reporter nil) + ;;---------------------------------------------------------------- ;; Macros ;;---------------------------------------------------------------- @@ -711,10 +714,6 @@ (setq all-expansions (cons expansion all-expansions)))) all-expansions)) -(defun dabbrev--scanning-message () - (unless (window-minibuffer-p (selected-window)) - (message "Scanning `%s'" (buffer-name (current-buffer))))) - (defun dabbrev--ignore-buffer-p (buffer) "Return non-nil if BUFFER should be ignored by dabbrev." (let ((bn (buffer-name buffer))) @@ -740,8 +739,7 @@ ;; If we were scanning something other than the current buffer, ;; continue scanning there. (when dabbrev--last-buffer - (set-buffer dabbrev--last-buffer) - (dabbrev--scanning-message)) + (set-buffer dabbrev--last-buffer)) (or ;; ------------------------------------------ ;; Look backward in current buffer. @@ -773,15 +771,20 @@ ;; If we have just now begun to search other buffers, ;; determine which other buffers we should check. ;; Put that list in dabbrev--friend-buffer-list. - (or dabbrev--friend-buffer-list - (setq dabbrev--friend-buffer-list - (dabbrev--make-friend-buffer-list)))) + (unless dabbrev--friend-buffer-list + (setq dabbrev--friend-buffer-list + (dabbrev--make-friend-buffer-list)) + (setq dabbrev--progress-reporter + (make-progress-reporter + "Scanning for dabbrevs..." + (- (length dabbrev--friend-buffer-list)) 0 0 1 1.5)))) ;; Walk through the buffers till we find a match. (let (expansion) (while (and (not expansion) dabbrev--friend-buffer-list) (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list)) (set-buffer dabbrev--last-buffer) - (dabbrev--scanning-message) + (progress-reporter-update dabbrev--progress-reporter + (- (length dabbrev--friend-buffer-list))) (setq dabbrev--last-expansion-location (point-min)) (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case))) expansion))))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--