diff options
| -rw-r--r-- | lisp/dabbrev.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 4af22e61409..57ee9a526a9 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el | |||
| @@ -327,6 +327,9 @@ this list." | |||
| 327 | ;; The regexp for recognizing a character in an abbreviation. | 327 | ;; The regexp for recognizing a character in an abbreviation. |
| 328 | (defvar dabbrev--abbrev-char-regexp nil) | 328 | (defvar dabbrev--abbrev-char-regexp nil) |
| 329 | 329 | ||
| 330 | ;; The progress reporter for buffer-scanning progress. | ||
| 331 | (defvar dabbrev--progress-reporter nil) | ||
| 332 | |||
| 330 | ;;---------------------------------------------------------------- | 333 | ;;---------------------------------------------------------------- |
| 331 | ;; Macros | 334 | ;; Macros |
| 332 | ;;---------------------------------------------------------------- | 335 | ;;---------------------------------------------------------------- |
| @@ -736,19 +739,21 @@ of the start of the occurrence." | |||
| 736 | ;; Put that list in dabbrev--friend-buffer-list. | 739 | ;; Put that list in dabbrev--friend-buffer-list. |
| 737 | (unless dabbrev--friend-buffer-list | 740 | (unless dabbrev--friend-buffer-list |
| 738 | (setq dabbrev--friend-buffer-list | 741 | (setq dabbrev--friend-buffer-list |
| 739 | (dabbrev--make-friend-buffer-list)))) | 742 | (dabbrev--make-friend-buffer-list)) |
| 743 | (setq dabbrev--progress-reporter | ||
| 744 | (make-progress-reporter | ||
| 745 | "Scanning for dabbrevs..." | ||
| 746 | (- (length dabbrev--friend-buffer-list)) 0 0 1 1.5)))) | ||
| 740 | ;; Walk through the buffers till we find a match. | 747 | ;; Walk through the buffers till we find a match. |
| 741 | (let (expansion) | 748 | (let (expansion) |
| 742 | (dolist-with-progress-reporter | 749 | (while (and (not expansion) dabbrev--friend-buffer-list) |
| 743 | (_ dabbrev--friend-buffer-list) | ||
| 744 | (make-progress-reporter | ||
| 745 | "Scanning for dabbrevs..." | ||
| 746 | 0 (length dabbrev--friend-buffer-list) 0 1 1.5) | ||
| 747 | (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list)) | 750 | (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list)) |
| 748 | (set-buffer dabbrev--last-buffer) | 751 | (set-buffer dabbrev--last-buffer) |
| 752 | (progress-reporter-update dabbrev--progress-reporter | ||
| 753 | (- (length dabbrev--friend-buffer-list))) | ||
| 749 | (setq dabbrev--last-expansion-location (point-min)) | 754 | (setq dabbrev--last-expansion-location (point-min)) |
| 750 | (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case)) | 755 | (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case))) |
| 751 | (unless expansion (setq dabbrev--friend-buffer-list '()))) | 756 | (progress-reporter-done dabbrev--progress-reporter) |
| 752 | expansion))))) | 757 | expansion))))) |
| 753 | 758 | ||
| 754 | ;; Compute the list of buffers to scan. | 759 | ;; Compute the list of buffers to scan. |