aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Colascione2018-06-18 20:41:25 -0700
committerDaniel Colascione2018-06-19 07:34:07 -0700
commite5a15ee1c2153da0676b29680dcc003ea368e272 (patch)
tree6e277a132f30eeb4fa45fe81770dc9d812899346
parent3057260b476a5c8efde523d0e5e72202b96ed9d1 (diff)
downloademacs-e5a15ee1c2153da0676b29680dcc003ea368e272.tar.gz
emacs-e5a15ee1c2153da0676b29680dcc003ea368e272.zip
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.
-rw-r--r--lisp/dabbrev.el21
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.