Skip to content

Commit

Permalink
Change the persp-generate-frame-buffer-predicate to fix the performan…
Browse files Browse the repository at this point in the history
…ce issue with with-temp-buffer macro.
  • Loading branch information
Bad-ptr committed Apr 26, 2016
1 parent a425e09 commit 6449c85
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions persp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1883,25 +1883,27 @@ Return `NAME'."
(if opt
`(function
(lambda (b)
,(typecase opt
(function
`(funcall ,opt b))
(number
`(let ((*persp-restrict-buffers-to* ,opt))
(memq b (persp-buffer-list-restricted
(selected-frame) ,opt
persp-restrict-buffers-to-if-foreign-buffer t))))
(symbol
(case opt
('nil t)
('restricted-buffer-list
'(memq b (persp-buffer-list-restricted
(selected-frame)
*persp-restrict-buffers-to*
persp-restrict-buffers-to-if-foreign-buffer
t)))
(t '(memq b (safe-persp-buffers (get-current-persp))))))
(t t))))
(if (string-prefix-p " " (buffer-name (current-buffer)))
t
,(typecase opt
(function
`(funcall ,opt b))
(number
`(let ((*persp-restrict-buffers-to* ,opt))
(memq b (persp-buffer-list-restricted
(selected-frame) ,opt
persp-restrict-buffers-to-if-foreign-buffer t))))
(symbol
(case opt
('nil t)
('restricted-buffer-list
'(memq b (persp-buffer-list-restricted
(selected-frame)
*persp-restrict-buffers-to*
persp-restrict-buffers-to-if-foreign-buffer
t)))
(t '(memq b (safe-persp-buffers (get-current-persp))))))
(t t)))))
nil)))

(defun persp-set-frame-buffer-predicate (frame &optional off)
Expand Down

0 comments on commit 6449c85

Please sign in to comment.