From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: remove dabbrev--scanning-message? Date: Wed, 22 Aug 2007 03:35:47 +0200 Message-ID: <87y7g473m4.fsf@ambire.localdomain> References: <87abtm4slu.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187746620 28707 80.91.229.12 (22 Aug 2007 01:37:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2007 01:37:00 +0000 (UTC) Cc: Sean O'Rourke To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 22 03:36:59 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 1INf9V-0004F2-HX for ged-emacs-devel@m.gmane.org; Wed, 22 Aug 2007 03:36:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INf9T-0007Uz-Tq for ged-emacs-devel@m.gmane.org; Tue, 21 Aug 2007 21:36:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INf9P-0007Rm-Dd for emacs-devel@gnu.org; Tue, 21 Aug 2007 21:36:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INf9N-0007Oa-9p for emacs-devel@gnu.org; Tue, 21 Aug 2007 21:36:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INf9N-0007OK-1B for emacs-devel@gnu.org; Tue, 21 Aug 2007 21:36:49 -0400 Original-Received: from ppp-239-33.21-151.libero.it ([151.21.33.239] helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1INf9M-0006El-Ii for emacs-devel@gnu.org; Tue, 21 Aug 2007 21:36:48 -0400 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1INf8N-0003OT-Id; Wed, 22 Aug 2007 03:35:47 +0200 In-Reply-To: (Sean O'Rourke's message of "Mon\, 23 Jul 2007 17\:40\:29 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Genre and OS details not recognized. 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:76926 Archived-At: () "Sean O'Rourke" () Mon, 23 Jul 2007 17:40:29 -0700 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. i would like to install this. rms, is this (see below) suitable for immediate ("tiny change") installation or should we ask for copyright assignment? thi ____________________________________________________________ --- 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)))))