aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen2007-08-22 19:47:53 +0000
committerThien-Thi Nguyen2007-08-22 19:47:53 +0000
commit7daa3523acb6ffcbaf309d400e5887719e285f05 (patch)
tree5b0689d0393500386007cb89155f74b7304b6338
parent561c44e8491d42f51aa76f843f6e50e3546c02a0 (diff)
downloademacs-7daa3523acb6ffcbaf309d400e5887719e285f05.tar.gz
emacs-7daa3523acb6ffcbaf309d400e5887719e285f05.zip
(dabbrev--progress-reporter): New variable.
(dabbrev--scanning-message): Delete func. (dabbrev--find-expansion): Use a progress reporter instead of dabbrev--scanning-message.
-rw-r--r--lisp/dabbrev.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 929844c06a0..20f6fea23db 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -332,6 +332,9 @@ this list."
332;; The regexp for recognizing a character in an abbreviation. 332;; The regexp for recognizing a character in an abbreviation.
333(defvar dabbrev--abbrev-char-regexp nil) 333(defvar dabbrev--abbrev-char-regexp nil)
334 334
335;; The progress reporter for buffer-scanning progress.
336(defvar dabbrev--progress-reporter nil)
337
335;;---------------------------------------------------------------- 338;;----------------------------------------------------------------
336;; Macros 339;; Macros
337;;---------------------------------------------------------------- 340;;----------------------------------------------------------------
@@ -711,10 +714,6 @@ If IGNORE-CASE is non-nil, accept matches which differ in case."
711 (setq all-expansions (cons expansion all-expansions)))) 714 (setq all-expansions (cons expansion all-expansions))))
712 all-expansions)) 715 all-expansions))
713 716
714(defun dabbrev--scanning-message ()
715 (unless (window-minibuffer-p (selected-window))
716 (message "Scanning `%s'" (buffer-name (current-buffer)))))
717
718(defun dabbrev--ignore-buffer-p (buffer) 717(defun dabbrev--ignore-buffer-p (buffer)
719 "Return non-nil if BUFFER should be ignored by dabbrev." 718 "Return non-nil if BUFFER should be ignored by dabbrev."
720 (let ((bn (buffer-name buffer))) 719 (let ((bn (buffer-name buffer)))
@@ -740,8 +739,7 @@ of the start of the occurrence."
740 ;; If we were scanning something other than the current buffer, 739 ;; If we were scanning something other than the current buffer,
741 ;; continue scanning there. 740 ;; continue scanning there.
742 (when dabbrev--last-buffer 741 (when dabbrev--last-buffer
743 (set-buffer dabbrev--last-buffer) 742 (set-buffer dabbrev--last-buffer))
744 (dabbrev--scanning-message))
745 (or 743 (or
746 ;; ------------------------------------------ 744 ;; ------------------------------------------
747 ;; Look backward in current buffer. 745 ;; Look backward in current buffer.
@@ -773,15 +771,20 @@ of the start of the occurrence."
773 ;; If we have just now begun to search other buffers, 771 ;; If we have just now begun to search other buffers,
774 ;; determine which other buffers we should check. 772 ;; determine which other buffers we should check.
775 ;; Put that list in dabbrev--friend-buffer-list. 773 ;; Put that list in dabbrev--friend-buffer-list.
776 (or dabbrev--friend-buffer-list 774 (unless dabbrev--friend-buffer-list
777 (setq dabbrev--friend-buffer-list 775 (setq dabbrev--friend-buffer-list
778 (dabbrev--make-friend-buffer-list)))) 776 (dabbrev--make-friend-buffer-list))
777 (setq dabbrev--progress-reporter
778 (make-progress-reporter
779 "Scanning for dabbrevs..."
780 (- (length dabbrev--friend-buffer-list)) 0 0 1 1.5))))
779 ;; Walk through the buffers till we find a match. 781 ;; Walk through the buffers till we find a match.
780 (let (expansion) 782 (let (expansion)
781 (while (and (not expansion) dabbrev--friend-buffer-list) 783 (while (and (not expansion) dabbrev--friend-buffer-list)
782 (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list)) 784 (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list))
783 (set-buffer dabbrev--last-buffer) 785 (set-buffer dabbrev--last-buffer)
784 (dabbrev--scanning-message) 786 (progress-reporter-update dabbrev--progress-reporter
787 (- (length dabbrev--friend-buffer-list)))
785 (setq dabbrev--last-expansion-location (point-min)) 788 (setq dabbrev--last-expansion-location (point-min))
786 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case))) 789 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case)))
787 expansion))))) 790 expansion)))))