|
26 | 26 | (require 'helm-help) |
27 | 27 | (require 'helm-occur) |
28 | 28 |
|
29 | | -(declare-function ido-make-buffer-list "ido" (default)) |
30 | 29 | (declare-function ido-add-virtual-buffers-to-list "ido") |
31 | 30 | (declare-function helm-comp-read "helm-mode") |
32 | 31 | (declare-function helm-browse-project "helm-files") |
@@ -383,18 +382,29 @@ Note that this variable is buffer-local.") |
383 | 382 | . helm-open-file-externally)))) |
384 | 383 |
|
385 | 384 |
|
386 | | -(defvar ido-use-virtual-buffers) |
387 | | -(defvar ido-ignore-buffers) |
| 385 | +(defun helm-buffers-get-visible-buffers () |
| 386 | + "Returns buffers visibles on current frame." |
| 387 | + (let (result) |
| 388 | + (walk-windows |
| 389 | + (lambda (x) |
| 390 | + (push (buffer-name (window-buffer x)) result)) |
| 391 | + nil 'visible) |
| 392 | + result)) |
| 393 | + |
| 394 | +(defun helm-buffer-list-1 (&optional visibles) |
| 395 | + (delq nil |
| 396 | + (mapcar (lambda (b) |
| 397 | + (let ((bn (buffer-name b))) |
| 398 | + (unless (member bn visibles) |
| 399 | + bn))) |
| 400 | + (buffer-list)))) |
| 401 | + |
388 | 402 | (defun helm-buffer-list () |
389 | 403 | "Return the current list of buffers. |
390 | | -Currently visible buffers are put at the end of the list. |
391 | | -See `ido-make-buffer-list' for more infos." |
392 | | - (require 'ido) |
393 | | - (let ((ido-process-ignore-lists t) |
394 | | - ido-ignored-list |
395 | | - ido-ignore-buffers |
396 | | - ido-use-virtual-buffers) |
397 | | - (ido-make-buffer-list nil))) |
| 404 | +Currently visible buffers are put at the end of the list." |
| 405 | + (let* ((visibles (helm-buffers-get-visible-buffers)) |
| 406 | + (others (helm-buffer-list-1 visibles))) |
| 407 | + (nconc others visibles))) |
398 | 408 |
|
399 | 409 | (defun helm-buffer-size (buffer) |
400 | 410 | "Return size of BUFFER." |
|
0 commit comments