emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master e5a15ee: Unbreak dabbrev


From: Daniel Colascione
Subject: [Emacs-diffs] master e5a15ee: Unbreak dabbrev
Date: Tue, 19 Jun 2018 10:34:34 -0400 (EDT)

branch: master
commit e5a15ee1c2153da0676b29680dcc003ea368e272
Author: Daniel Colascione <address@hidden>
Commit: Daniel Colascione <address@hidden>

    Unbreak dabbrev
    
    This commit partially reverts
    edb1f85a27817a3fac38bb85752671414819203b, which results in dabbev
    expansion failing due to trying to switch to the null buffer.
    
    * lisp/dabbrev.el (dabbrev--progress-reporter): Restore variable.
    (dabbrev--find-expansion): Restore original code.
---
 lisp/dabbrev.el | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 4af22e6..57ee9a5 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -327,6 +327,9 @@ this list."
 ;; 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
 ;;----------------------------------------------------------------
@@ -736,19 +739,21 @@ of the start of the occurrence."
         ;; Put that list in dabbrev--friend-buffer-list.
         (unless dabbrev--friend-buffer-list
            (setq dabbrev--friend-buffer-list
-                 (dabbrev--make-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)
-        (dolist-with-progress-reporter
-            (_ dabbrev--friend-buffer-list)
-            (make-progress-reporter
-             "Scanning for dabbrevs..."
-             0 (length dabbrev--friend-buffer-list) 0 1 1.5)
+        (while (and (not expansion) dabbrev--friend-buffer-list)
           (setq dabbrev--last-buffer (pop dabbrev--friend-buffer-list))
           (set-buffer dabbrev--last-buffer)
+           (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))
-          (unless expansion (setq dabbrev--friend-buffer-list '())))
+          (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case)))
+        (progress-reporter-done dabbrev--progress-reporter)
         expansion)))))
 
 ;; Compute the list of buffers to scan.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]