# How to Correctly Enable Flycheck in Babel Source Blocks

If you already have Flycheck turned on then you already have it running your babel source block buffers, but, it isn’t working how you expect it. That buffer hasn’t got a file name. Flycheck can’t be smart about helping you out here. Via this post, the solution follows.

(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
(let ((file-name (buffer-file-name))) ;; (1)