Permalink
Browse files

Remove duplicated function from haskell-cabal.

  • Loading branch information...
1 parent 0a79ab8 commit da11692023a6e1d954b8dd0b0feb44690f356f0a @chrisdone chrisdone committed May 19, 2012
Showing with 1 addition and 26 deletions.
  1. +1 −26 haskell-cabal.el
View
@@ -100,32 +100,7 @@
;; (defsubst* inferior-haskell-string-prefix-p (str1 str2)
;; "Return non-nil if STR1 is a prefix of STR2"
;; (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
-
-(defun haskell-cabal-find-file ()
- "Return a buffer visiting the cabal file of the current directory, or nil."
- (catch 'found
- ;; ;; First look for it in haskell-cabal-buffers.
- ;; (dolist (buf haskell-cabal-buffers)
- ;; (if (inferior-haskell-string-prefix-p
- ;; (with-current-buffer buf default-directory) default-directory)
- ;; (throw 'found buf)))
- ;; Then look up the directory hierarchy.
- (let ((user (nth 2 (file-attributes default-directory)))
- ;; Abbreviate, so as to stop when we cross ~/.
- (root (abbreviate-file-name default-directory))
- files)
- (while (and root (equal user (nth 2 (file-attributes root))))
- (if (setq files (directory-files root 'full "\\.cabal\\'"))
- ;; Avoid the .cabal directory.
- (dolist (file files (throw 'found nil))
- (unless (file-directory-p file)
- (throw 'found (find-file-noselect file))))
- (if (equal root
- (setq root (file-name-directory
- (directory-file-name root))))
- (setq root nil))))
- nil)))
-
+4
(autoload 'derived-mode-p "derived") ; Emacs 21
(defun haskell-cabal-buffers-clean (&optional buffer)

0 comments on commit da11692

Please sign in to comment.