summaryrefslogtreecommitdiff
path: root/lisp/dabbrev.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1998-09-23 21:56:59 +0000
committerKarl Heuer <kwzh@gnu.org>1998-09-23 21:56:59 +0000
commita73a57bca1820e6c723601798e4f83f0b97680a9 (patch)
tree6080e725af14a7de41314f64cfb0d3dc45ef8e76 /lisp/dabbrev.el
parent0cf950b1a93ba7d22628af2829156c328a0fa1c0 (diff)
downloademacs-a73a57bca1820e6c723601798e4f83f0b97680a9.tar.gz
(dabbrev--find-expansion): Don't scan the current buffer
over again.
Diffstat (limited to 'lisp/dabbrev.el')
-rw-r--r--lisp/dabbrev.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 11da3b68e75..371037312e2 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -768,14 +768,16 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
(append dabbrev--friend-buffer-list
non-friend-buffer-list)))))
;; Move buffers that are visible on the screen
- ;; to the front of the list.
- (if dabbrev--friend-buffer-list
- (let ((w (next-window (selected-window))))
- (while (not (eq w (selected-window)))
- (setq dabbrev--friend-buffer-list
- (cons (window-buffer w)
- (delq (window-buffer w) dabbrev--friend-buffer-list)))
- (setq w (next-window w)))))
+ ;; to the front of the list. Remove the current buffer.
+ (when dabbrev--friend-buffer-list
+ (let ((w (next-window (selected-window))))
+ (while (not (eq w (selected-window)))
+ (setq dabbrev--friend-buffer-list
+ (cons (window-buffer w)
+ (delq (window-buffer w) dabbrev--friend-buffer-list)))
+ (setq w (next-window w))))
+ (setq dabbrev--friend-buffer-list
+ (delq (current-buffer) dabbrev--friend-buffer-list)))
;; Walk through the buffers
(while (and (not expansion) dabbrev--friend-buffer-list)
(setq dabbrev--last-buffer