Package: haskell-mode
Version: 2.4-1
Severity: normal

Hi,

If "Foo.cabal" buffer is killed, `C-c C-l'
(`inferior-haskell-load-file') displays "Selecting deleted buffer"
error message and loads nothing.

This .cabal buffer is created by the first (successful) `C-c C-l' call.
After the buffer is killed (by user's mistake), source file cannot be
loaded without [elisp-fu or] restarting Emacs.

I've traced the problem down to `inferior-haskell-cabal-of-buf'
function.

    inferior-haskell-load-file
     \_ inferior-haskell-find-project-root
         \_ inferior-haskell-cabal-of-buf   ==>  #<killed buffer>

The patched file [1d8b319dc2abe5ede1cf6007866eef68  inf-haskell.el]
belongs Debian's haskell-mode_2.4-1 and corresponds to the "Latest
release" (2.4) in upstream[*].  (CVS version differs, but I cannot
access it at the moment -- I'm behind a proxied LAN.)

  [*] http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode

-----BEGIN CHANGELOG ENTRY-----
2009-08-19  Valery V. Vorotyntsev  <[email protected]>

        * inf-haskell.el (inferior-haskell-cabal-of-buf):
          - check whether `inferior-haskell-cabal-buffer' is killed
          - create or reset `inferior-haskell-cabal-buffer' when needed

        * inf-haskell.el: delete trailing whitespace

-----END CHANGELOG ENTRY-----

-- 
Best wishes,
vvv

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages haskell-mode depends on:
ii  emacs [emacsen]               23.1+1-2   The GNU Emacs editor (metapackage)
ii  emacs22 [emacsen]             22.3+1-1.1 The GNU Emacs editor
ii  emacs23 [emacsen]             23.1+1-2   The GNU Emacs editor

Versions of packages haskell-mode recommends:
ii  ghc6                          6.10.4-1   GHC - the Glasgow Haskell Compilat

haskell-mode suggests no packages.

-- no debconf information
--- inf-haskell.el.orig	2007-11-11 15:43:50.000000000 +0200
+++ inf-haskell.el	2009-08-19 16:07:04.040553838 +0300
@@ -210,10 +210,12 @@
 (defun inferior-haskell-cabal-of-buf (buf)
   (require 'haskell-cabal)
   (with-current-buffer buf
-    (or inferior-haskell-cabal-buffer
-        (and (not (local-variable-p 'inferior-haskell-cabal-buffer))
-             (set (make-local-variable 'inferior-haskell-cabal-buffer)
-                  (haskell-cabal-find-file))))))
+    (if (and inferior-haskell-cabal-buffer                ; not `nil'
+	     (buffer-name inferior-haskell-cabal-buffer)) ; not killed
+	inferior-haskell-cabal-buffer
+      (unless (local-variable-p 'inferior-haskell-cabal-buffer)
+	(make-local-variable 'inferior-haskell-cabal-buffer))
+      (set 'inferior-haskell-cabal-buffer (haskell-cabal-find-file)))))
 
 (defun inferior-haskell-find-project-root (buf)
   (with-current-buffer buf
@@ -261,8 +263,6 @@
                     (message "Ignoring inconsistent `module' info: %s in %s"
                              module buffer-file-name)
                     nil)))))))))
-                    
-                    
 
 ;;;###autoload
 (defun inferior-haskell-load-file (&optional reload)
@@ -446,8 +446,8 @@
 
 ;;; Functions to find the documentation of a given function.
 ;;
-;; TODO for this section: 
-;; 
+;; TODO for this section:
+;;
 ;; * Support fetching of local Haddock docs pulled directly from source files.
 ;; * Display docs locally? w3m?
 
@@ -492,7 +492,7 @@
   "Fetch the module in which SYM is defined."
   (let ((info (inferior-haskell-info sym)))
     (unless (string-match inferior-haskell-module-re info)
-      (error 
+      (error
        "No documentation information available. Did you forget to C-c C-l?"))
     (match-string-no-properties 1 info)))
 

Reply via email to