- (when other-buffers
- (dolist (buffer (delq (current-buffer) (buffer-list)))
- (and (or (eq other-buffers 'all)
- (eq (buffer-local-value 'major-mode buffer) major-mode))
- (with-current-buffer buffer
- (setq symbols
- (company-dabbrev--search-buffer regexp nil symbols start
- limit ignore-comments))))
+ (when other-buffer-modes
+ (cl-dolist (buffer (delq (current-buffer) (buffer-list)))
+ (with-current-buffer buffer
+ (when (if (eq other-buffer-modes 'all)
+ (not (string-match-p company-dabbrev-ignore-buffers
+ (buffer-name)))
+ (apply #'derived-mode-p other-buffer-modes))
+ (setq symbols
+ (company-dabbrev--search-buffer regexp nil symbols start
+ limit ignore-comments))))