summaryrefslogtreecommitdiff
path: root/helm-buffers.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-11-05 05:44:33 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-11-05 05:44:33 +0100
commit16ef6c53482dc73f261663a90b19a13695a05eb4 (patch)
treef2d0cf19e30844e5f9d7f16a847ce798b792d425 /helm-buffers.el
parent233d00d413b7e9b16ac4cd878ae490703f70efdb (diff)
Make cache for buffers local to sources (#1907)
Remove now unneeded helm-buffers-list-cache. * helm-buffers.el (helm-buffers-list--init): Set candidates attribute directly with :buffer-list fn without using a global cache. (helm-source-buffers): Remove candidates slot.
Diffstat (limited to 'helm-buffers.el')
-rw-r--r--helm-buffers.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/helm-buffers.el b/helm-buffers.el
index 98cee3cb..5afeb259 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -197,15 +197,14 @@ this source is accessible and properly loaded."
map))
-(defvar helm-buffers-list-cache nil)
(defvar helm-buffer-max-len-mode nil)
(defvar helm-buffers-in-project-p nil)
(defun helm-buffers-list--init ()
(require 'dired)
;; Issue #51 Create the list before `helm-buffer' creation.
- (setq helm-buffers-list-cache (funcall (helm-attr 'buffer-list)))
- (let ((result (cl-loop for b in helm-buffers-list-cache
+ (helm-attrset 'candidates (funcall (helm-attr 'buffer-list)))
+ (let ((result (cl-loop for b in (helm-attr 'candidates)
maximize (length b) into len-buf
maximize (length (with-current-buffer b
(format-mode-line mode-name)))
@@ -224,7 +223,6 @@ this source is accessible and properly loaded."
:documentation
" A function with no arguments to create buffer list.")
(init :initform 'helm-buffers-list--init)
- (candidates :initform helm-buffers-list-cache)
(multimatch :initform nil)
(match :initform 'helm-buffers-match-function)
(persistent-action :initform 'helm-buffers-list-persistent-action)