Optimization: buffer-local-value instead of with-current-buffer

This commit is contained in:
Henrik Lissner 2016-06-17 16:01:07 -04:00
parent b46a75bfe0
commit 85f3c14b2f
3 changed files with 8 additions and 8 deletions

View file

@ -86,7 +86,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
;;;###autoload
(defun doom/get-buffers-in-modes (modes &optional buffer-list)
"Get a list of buffers whose major-mode is one of MODES"
(--filter (with-current-buffer it (memq major-mode modes))
(--filter (memq (buffer-local-value 'major-mode it) modes)
(or buffer-list (doom/get-buffers))))
;;;###autoload