Emacs creates directories named '~' at the project root directory when using haskell-interactive #113

Closed
nurpax opened this Issue Jan 16, 2013 · 2 comments

Projects

None yet

2 participants

@nurpax
Contributor
nurpax commented Jan 16, 2013

Emacs keeps creating ~ directories under my project roots when I load a .cabal file into Emacs with haskell-interactive. These are bit painful as a) I've instructed my Emacs to never create any back up files or such so these shouldn't be created either and b) these are tricky, if not outright dangerous to remove (for fear of nuking your own HOME dir!).

Steps to reproduce:

  1. git clone git://github.com:nurpax/hstodo.git

  2. cd hstodo

  3. cabal-dev install

  4. load hstodo.cabal into Emacs

  5. C-c C-c, 'y' and enter on the haskell interactive project questions, let Emacs load & build the project

  6. BOOM:

    janne@nurpax:~/dev/hstodo$ ls -la
    total 48
    drwxr-xr-x 3 janne janne 4096 Jan 16 18:07 ~

@nurpax
Contributor
nurpax commented Jan 16, 2013

My Emacs haskell-extras file looks like:

;; Sample file for the new session/process stuff
;; Based on my own configuration. Well, it IS my configuration.
;;
;; NOTE: If you don't have cabal-dev, or you don't want to use it, you
;; should change haskell-process-type (see below) to 'ghci.
;;
;; To merely TRY this mode (and for debugging), do the below:
;;
;;     cd into haskell-mode's directory, and run
;;     $ emacs --load examples/init.el
;;
;; To get started, open a .hs file in one of your projects, and hit…
;;
;;   1. F5 to load the current file (and start a repl session), or
;;   2. C-` to just start a REPL associated with this project, or
;;   3. C-c C-c to build the cabal project (and start a repl session).

;; Customization
(custom-set-variables
 ;; Use cabal-dev for the GHCi session. Ensures our dependencies are in scope.
 '(haskell-process-type 'cabal-dev)

 ;; Use notify.el (if you have it installed) at the end of running
 ;; Cabal commands or generally things worth notifying.
 '(haskell-notify-p t)

 '(haskell-interactive-mode-hide-multi-line-errors nil)

 ;; To enable tags generation on save.
 '(haskell-tags-on-save t)
)

(add-hook 'haskell-mode-hook 'haskell-hook)
(add-hook 'haskell-cabal-mode-hook 'haskell-cabal-hook)

;; Haskell main editing mode key bindings.
(defun haskell-hook ()
;; TRY this someday?
;;  ;; Use simple indentation.
;;  (turn-on-haskell-simple-indent)
;;  (define-key haskell-mode-map (kbd "<return>") 'haskell-simple-indent-newline-same-col)
;;  (define-key haskell-mode-map (kbd "C-<return>") 'haskell-simple-indent-newline-indent)

  ;; Load the current file (and make a session if not already made).
  (define-key haskell-mode-map [?\C-c ?\C-l] 'haskell-process-load-file)
  (define-key haskell-mode-map [f5] 'haskell-process-load-file)

  ;; Switch to the REPL.
  (define-key haskell-mode-map [?\C-c ?\C-z] 'haskell-interactive-switch)
  ;; “Bring” the REPL, hiding all other windows apart from the source
  ;; and the REPL.
  (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)

  ;; Build the Cabal project.
  (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
  ;; Interactively choose the Cabal command to run.
  (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)

  ;; Get the type and info of the symbol at point, print it in the
  ;; message buffer.
  (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
  (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)

  ;; Contextually do clever things on the space key, in particular:
  ;;   1. Complete imports, letting you choose the module name.
  ;;   2. Show the type of the symbol after the space.
  (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)

  ;; Jump to the imports. Keep tapping to jump between import
  ;; groups. C-u f8 to jump back again.
  (define-key haskell-mode-map [f8] 'haskell-navigate-imports)

  ;; Jump to the definition of the current symbol.
  (define-key haskell-mode-map (kbd "M-.") 'haskell-mode-tag-find)
)
;;  ;; Indent the below lines on columns after the current column.
;;  (define-key haskell-mode-map (kbd "C-<right>")
;;    (lambda ()
;;      (interactive)
;;      (haskell-move-nested 1)))
;;  ;; Same as above but backwards.
;;  (define-key haskell-mode-map (kbd "C-<left>")
;;    (lambda ()
;;      (interactive)
;;      (haskell-move-nested -1))))

;; Useful to have these keybindings for .cabal files, too.
(defun haskell-cabal-hook ()
  (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
  (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)
  (define-key haskell-cabal-mode-map (kbd "C-`") 'haskell-interactive-bring)
  (define-key haskell-cabal-mode-map [?\C-c ?\C-z] 'haskell-interactive-switch))
@chrisdone chrisdone was assigned May 19, 2013
@chrisdone
Member

Cannot reproduce. Still doing it?

@chrisdone chrisdone closed this Jun 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment