           (m) -> m
       upi.setMessages messages.map(setHighlighter), types
 
+    unless atom.config.get 'haskell-ghc-mod.useLinter'
+      @disposables.add atom.commands.add 'atom-text-editor[data-grammar~="haskell"]',
+        'haskell-ghc-mod:check-file': ({target}) =>
+          editor = target.getModel()
+          @process.doCheckBuffer(editor.getBuffer()).then (res) ->
+            setMessages res, ['error', 'warning']
+        'haskell-ghc-mod:lint-file': ({target}) =>
+          editor = target.getModel()
+          @process.doLintBuffer(editor.getBuffer()).then (res) ->
+            setMessages res, ['lint']
+
     @disposables.add atom.commands.add 'atom-text-editor[data-grammar~="haskell"]',
-      'haskell-ghc-mod:check-file': ({target}) =>
-        editor = target.getModel()
-        @process.doCheckBuffer(editor.getBuffer()).then (res) ->
-          setMessages res, ['error', 'warning']
-      'haskell-ghc-mod:lint-file': ({target}) =>
-        editor = target.getModel()
-        @process.doLintBuffer(editor.getBuffer()).then (res) ->
-          setMessages res, ['lint']
       'haskell-ghc-mod:show-type': ({target, detail}) ->
         upi.showTooltip
           editor: target.getModel()

    return unless atom.config.get 'haskell-ghc-mod.useLinter'
    [
      func: 'doCheckBuffer'
      lintOnFly: false
      scopes: ['source.haskell', 'text.tex.latex.haskell']
    ,
      func: 'doLintBuffer'
      lintOnFly: true
      scopes: ['source.haskell']
    ].map ({func, scopes, lintOnFly}) =>
      grammarScopes: scopes
      scope: 'file'
      lintOnFly: lintOnFly
      lint: (textEditor) =>
        return unless @process?
        return if textEditor.isEmpty()
        @process[func](textEditor.getBuffer(), lintOnFly).then (res) ->
          res.map ({uri, position, message, severity}) ->
            [message, messages...] = message.split /^(?!\s)/gm
            {
              type: severity
              text: message
              multiline: true
              filePath: uri
              range: [position, position.translate [0, 1]]
              trace: messages.map (text) ->
                type: 'trace'
                text: text
                multiline: true
            }

        @process.doLintBuffer(buffer, fast).then (res) ->
          setMessages res, ['lint']

    unless atom.config.get 'haskell-ghc-mod.useLinter'
      @disposables.add upi.onDidSaveBuffer (buffer) ->
        checkLint buffer, 'Save'

      @disposables.add upi.onDidStopChanging (buffer) ->
        checkLint buffer, 'Change', true


    @disposables.add @process.onBackendActive ->
