]> git.eshelyaron.com Git - emacs.git/commitdiff
(dabbrev--find-expansion): Move buffers that are visible on the screen
authorRichard M. Stallman <rms@gnu.org>
Fri, 20 Oct 1995 20:48:00 +0000 (20:48 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 20 Oct 1995 20:48:00 +0000 (20:48 +0000)
to the front of the list to be searched.

lisp/dabbrev.el

index 8dbe0629239ce3c6222b2e3e081fc42ec1021263..234f83f24b3e167a663ad8221fb756ee15466302 100644 (file)
@@ -711,6 +711,15 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
                        dabbrev--friend-buffer-list
                        (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)))))
        ;; Walk through the buffers
        (while (and (not expansion) dabbrev--friend-buffer-list)
          (setq dabbrev--last-buffer