- (case command
- ('interactive (company-begin-backend 'company-dabbrev-code))
- ('prefix (and (or (eq t company-dabbrev-code-modes)
- (apply 'derived-mode-p company-dabbrev-code-modes))
- (not (company-in-string-or-comment))
- (or (company-grab-symbol) 'stop)))
- ('candidates (let ((completion-ignore-case nil))
- (company-dabbrev--search
- (company-dabbrev-code--make-regexp arg)
- company-dabbrev-code-time-limit
- company-dabbrev-code-other-buffers t)))
- ('duplicates t)))
+ (cl-case command
+ (interactive (company-begin-backend 'company-dabbrev-code))
+ (prefix (and (or (eq t company-dabbrev-code-modes)
+ (apply #'derived-mode-p company-dabbrev-code-modes))
+ (or company-dabbrev-code-everywhere
+ (not (company-in-string-or-comment)))
+ (or (company-grab-symbol) 'stop)))
+ (candidates (let ((case-fold-search company-dabbrev-code-ignore-case))
+ (company-dabbrev--search
+ (company-dabbrev-code--make-regexp arg)
+ company-dabbrev-code-time-limit
+ (pcase company-dabbrev-code-other-buffers
+ (`t (list major-mode))
+ (`code company-dabbrev-code-modes)
+ (`all `all))
+ t)))
+ (ignore-case company-dabbrev-code-ignore-case)
+ (duplicates t)))