   "Get or create the stack buffer for this current directory and
 the given targets."
   (let* ((root (intero-project-root))
+         (package-name (intero-package-name))
+         (buffer-name (intero-buffer-name worker))
          (default-directory root))
     (with-current-buffer
-        (get-buffer-create (intero-buffer-name worker))
+        (get-buffer-create buffer-name)
+      (setq intero-package-name package-name)
       (cd root)
       (current-buffer))))
 

(defun intero-package-name ()
  "Get the current package name from a nearby .cabal file. If
there is none, return empty string."
  (let ((cabal-file (intero-cabal-find-file)))
    (if cabal-file
        (replace-regexp-in-string
         ".cabal$" ""
         (file-name-nondirectory (intero-cabal-find-file)))
      "")))

(defun intero-cabal-find-file (&optional dir)
  "Search for package description file upwards starting from DIR.

(defvar intero-project-root nil
  "The project root of the current buffer.")
(make-variable-buffer-local 'intero-project-root)

(defvar intero-package-name nil
  "The package name associated with the current buffer.")
(make-variable-buffer-local 'intero-package-name)

(defvar intero-deleting nil
  "The process of the buffer is being deleted.")
