Skip to content

Commit

Permalink
Merge branch 'aki2o-get-array-buffers-smartly'
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwanami committed Aug 17, 2014
2 parents c44eac1 + 274a1ee commit 4726d78
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion e2wm.el
Expand Up @@ -3516,6 +3516,8 @@ Do not select the buffer."
"\\*\\(scratch\\|Messages\\)\\*"
bn))))))

(defvar e2wm:c-array-smart-buffers-functions nil) ; 最初にバッファのリストを返したものが有効

(defun e2wm:dp-array-make-recipe (cols rows)
;; cols x rows の recipe を作る
(let* ((sz-summary 0.12)
Expand Down Expand Up @@ -3615,7 +3617,7 @@ Do not select the buffer."
:leave 'e2wm:dp-array-leave))

(defvar e2wm:dp-array-buffers-function
'e2wm:dp-array-get-recordable-buffers) ; この関数を切り替える
'e2wm:dp-array-get-smart-buffers) ; この関数を切り替える

(defvar e2wm:dp-array-buffers-function-backup nil) ; toggleする際のバックアップ

Expand Down Expand Up @@ -3682,6 +3684,22 @@ Do not select the buffer."
do (push b ret))
(nreverse ret)))

(defun e2wm:dp-array-get-smart-buffers ()
(loop for f in e2wm:c-array-smart-buffers-functions
for ret = (funcall f)
if ret return ret
finally return (e2wm:dp-array-get-recordable-buffers)))

(defun e2wm:dp-array-get-same-mode-buffers ()
(loop with mmode = (buffer-local-value 'major-mode (current-buffer))
for b in (buffer-list)
if (eq (buffer-local-value 'major-mode b) mmode)
collect b))

(defun e2wm:dp-array-get-same-mode-buffers-if-not-recordable ()
(when (not (e2wm:history-recordable-p (current-buffer)))
(e2wm:dp-array-get-same-mode-buffers)))

(defun e2wm:dp-array-popup (buf)
(e2wm:message "#DP ARRAY popup : %s" buf)
(let ((wm (e2wm:pst-get-wm)))
Expand Down

0 comments on commit 4726d78

Please sign in to comment.