dirs in Emacs/Vim in Cabal

Dear Haskellers, I am in the process of creating a cabal HaRe and I have run into a minor problem. I have an emacs and a vim script that HaRe uses to invoke the refactorer from the two editors. In those scripts, I point HaRe to a directory containing some libraries it needs to chase the imports of the modules. Cabal installs these libraries as data files into whatever prefix the user requests at install time. However, the problem I have is that it then requires a manual user intervention to manually configure emacs/vim to point to this new directory in the 'customizable' panel of HaRe. My question is: Is it possible to allow the emacs/vim scripts that I have know where this directory is automatically? I hope someone can help, Kindest regards, Chris Brown.

On 2010-06-30 18:38, Chris BROWN wrote:
My question is: Is it possible to allow the emacs/vim scripts that I have know where this directory is automatically?
Maybe you could adapt the approach taken by Agda. Agda's Emacs mode is installed using Cabal plus a small script: 1) The Emacs Lisp sources are installed as data files, using Cabal. 2) A small program called agda-mode is compiled and installed, using Cabal. 3) If the user runs "agda-mode setup", then the following code is copied into the user's .emacs (unless it is already there): (load-file (let ((coding-system-for-read 'utf-8)) (shell-command-to-string "agda-mode locate"))) The .emacs file is found by querying Emacs. 4) The command "agda-mode locate" prints out the path to a file which sets up the Agda mode (using the Paths_<package name> module). Note that if a newer version of Agda is installed, then Emacs will (after being restarted) automatically make use of the new version of the Agda mode. The source of agda-mode can be found in Agda's darcs repository: http://code.haskell.org/Agda/src/agda-mode/Main.hs -- /NAD
participants (2)
-
Chris BROWN
-
Nils Anders Danielsson