branch: elpa/swift-mode commit c8cdb8123652d21e1c9c692ece228395cd9ed1af Author: ap4y <l...@pisem.net> Commit: ap4y <l...@pisem.net>
Shortcut linked sources flycheck logic when corresponding variable is nil --- swift-mode.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/swift-mode.el b/swift-mode.el index 20e2c42..1a39e24 100644 --- a/swift-mode.el +++ b/swift-mode.el @@ -501,14 +501,15 @@ ;; We also don't want a hidden emacs interlock files. (eval (let (source file) - (setq source (car (flycheck-substitute-argument 'source 'swift))) - (setq file (file-name-nondirectory source)) - (cl-remove-if-not - #'(lambda (path) - (and - (eq (string-match ".#" path) nil) - (eq (string-match file path) nil))) - (file-expand-wildcards flycheck-swift-linked-sources)))) + (when flycheck-swift-linked-sources + (setq source (car (flycheck-substitute-argument 'source 'swift))) + (setq file (file-name-nondirectory source)) + (cl-remove-if-not + #'(lambda (path) + (and + (eq (string-match ".#" path) nil) + (eq (string-match file path) nil))) + (file-expand-wildcards flycheck-swift-linked-sources))))) "-primary-file" source) :error-patterns ((error line-start (file-name) ":" line ":" column ": "