Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't ask to 'create new project' with the same name #124

Closed
lightquake opened this issue Feb 15, 2013 · 14 comments
Closed

Don't ask to 'create new project' with the same name #124

lightquake opened this issue Feb 15, 2013 · 14 comments

Comments

@lightquake
Copy link
Contributor

I keep getting prompted to create a new project or load an existing one for each file in my project, since it doesn't 'guess' that it should just use the existing one with the same name.

@ivan-m
Copy link
Contributor

ivan-m commented Feb 18, 2013

Is this a Cabal-based project? The only time I've had something like this occur is when I'm hacking on something that doesn't have a .cabal file...

@Mikolaj
Copy link
Member

Mikolaj commented Feb 18, 2013

I confirm the bug, on emacs 23 and 24. I never once experienced automatic assignment to a project and it always first asks about creating a new project, only then about adding to an existing one.

@lightquake
Copy link
Contributor Author

@ivan-m It is a cabalized project.

@ivan-m
Copy link
Contributor

ivan-m commented Feb 18, 2013

Huh, interesting; it always seems to work for me. What have the two of you got in your haskell-mode configuration?

@Mikolaj
Copy link
Member

Mikolaj commented Feb 18, 2013

That's the config for emacs 23:

Mikolaj/mydotflies@9c7bde7

@ivan-m
Copy link
Contributor

ivan-m commented Feb 19, 2013

I can't see anything drastically different/wrong there compared to my own config; the main difference is is that I'm using Emacs-24...

@lightquake
Copy link
Contributor Author

Here's mine; nothing out of the ordinary, I don't think.

edit: weird, it seems to have fixed itself.

@Mikolaj
Copy link
Member

Mikolaj commented Feb 20, 2013

I've just pulled newest haskell-mode and tried emacs 24.2.1. No luck. It asks me to start a new process for each file that I run C-cC-c for the first time on. I tried with and without 'make compile' for haskell mode. I can try with minimal emacs config if that's helpful. BTW, here are my extra changes for 24.2.1, though just a couple of them tweaks haskell-mode: Mikolaj/mydotflies@21e4e3e. Edit: also, it's the same on 3 different projects I tried (all with cabal files, I tried both cabal and cabal-dev).

@ivan-m
Copy link
Contributor

ivan-m commented Feb 21, 2013

I wonder whether it's because of you saying you're running C-c C-c on it; does the same thing happen if you try to load the new file into ghci?

Alternatively, does this issue happen if you use the example init.el file (i.e. emacs -Q --load examples/init.el)?

Do you have a custom ~/.ghci file that could be doing something?

Or maybe it's something to do with the project you're working on :/

@Mikolaj
Copy link
Member

Mikolaj commented Feb 21, 2013

I tried exactly the same sequence of module loads in various setups and here are the results.

I wonder whether it's because of you saying you're running C-c C-c on it; does the same thing happen if you try to load the new file into ghci?

Yes, it's the same when I do C-cC-l instead, if that's what you mean. Except that, additionally, I apparently need to load module in a proper order or I get things like

/mikolaj/r/LambdaHack/Game/LambdaHack/Action.hs:31:8: Could not find module `Game.LambdaHack.Utils.Assert' …
    It is a member of the hidden package `LambdaHack-0.2.7.1'.
    Perhaps you need to add `LambdaHack' to the build-depends in your .cabal file.

(No such problems with C-cC-c.)

Alternatively, does this issue happen if you use the example init.el file (i.e. emacs -Q --load examples/init.el)?

Yes, no change here. When I do

emacs -Q --load examples/init.el /mikolaj/r/LambdaHack/Game/LambdaHack/*.hs

and then C-cC-c (or C-cC-l) on files, it always asks me to start a new project.
Normally I use ~/.emacs.desktop and that's where my files come from.

But when I just run

emacs -Q --load examples/init.el

and load files manually before C-cC-c it does not ask me to open a new project. It's a paradise. Except that I need to load dozens of files into buffers manually, that is.

Do you have a custom ~/.ghci file that could be doing something?

I don't have any ~/.ghci.

Or maybe it's something to do with the project you're working on :/

Probably not, since it works OK if I don't load files in bulk via command line or emacs.desktop. The project above is just

https://github.com/kosmikus/LambdaHack

with nothing very special in it.

@ivan-m
Copy link
Contributor

ivan-m commented Feb 21, 2013

Ahhh, I think the issue is that you're opening the files all at once,
whereas I open one file, start the project, then proceed.

Try this:

  • load one file (maybe the .cabal file) and start the project.
  • Then load the other files.
    On Feb 21, 2013 5:30 PM, "Mikolaj Konarski" notifications@github.com
    wrote:

I tried exactly the same sequence of module loads in various setups and
here are the results.

I wonder whether it's because of you saying you're running C-c C-c on it;
does the same thing happen if you try to load the new file into ghci?

Yes, it's the same when I do C-cC-l instead, if that's what you mean.
Except that, additionally, I apparently need to load module in a proper
order or I get things like

/mikolaj/r/LambdaHack/Game/LambdaHack/Action.hs:31:8: Could not find module Game.LambdaHack.Utils.Assert' … It is a member of the hidden packageLambdaHack-0.2.7.1'.
Perhaps you need to add `LambdaHack' to the build-depends in your .cabal file.

(No such problems with C-cC-c.)

Alternatively, does this issue happen if you use the example init.el file
(i.e. emacs -Q --load examples/init.el)?

Yes, no change here. When I do

emacs -Q --load examples/init.el /mikolaj/r/LambdaHack/Game/LambdaHack/*.hs

and then C-cC-c (or C-cC-l) on files, it always asks me to start a new
project.
Normally I use ~/.emacs.desktop and that's where my files come from.

But when I just run

emacs -Q --load examples/init.el

and load files manually before C-cC-c it does not ask me to open a new
project. It's a paradise. Except that I need to load dozens of files into
buffers manually, that is.

Do you have a custom ~/.ghci file that could be doing something?

I don't have any ~/.ghci.

Or maybe it's something to do with the project you're working on :/

Probably not, since it works OK if I don't load files in bulk via command
line or emacs.desktop. The project above is just

https://github.com/kosmikus/LambdaHack

with nothing very special in it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/124#issuecomment-13875150.

@Mikolaj
Copy link
Member

Mikolaj commented Feb 21, 2013

I tried what you proposed and it worked, but this gave me an idea and then it fixed itself altogether. It turns out I have some symbolic links in my home directory. Both my emacs.desktop file and the directory I used when loading files from the command line were behind symbolic links. I now use the unlinked paths and it works perfectly. Thank you very much. I'm now a very happy hacker. :)

@ivan-m
Copy link
Contributor

ivan-m commented Feb 23, 2013

@lightquake if it seems to be working for you now, can you close the issue?

@lightquake
Copy link
Contributor Author

Sure, I can't replicate it any more so I'll just close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants