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

feature request/suggestion: announce directory changes #260

Open
nobrowser opened this issue Oct 12, 2017 · 1 comment
Open

feature request/suggestion: announce directory changes #260

nobrowser opened this issue Oct 12, 2017 · 1 comment

Comments

@nobrowser
Copy link

Compared to some other open issues, this one should be easy.

ocamlbuild should say

Entering directory `/foo/bar/baz'

and

Leaving directory `/foo/bar/baz'

just like gmake does. This is not just a frill, which would be very out of character for a Unix family developer tool. It exists (or so I think) to help emacs [1] locate files mentioned in error messages, to enable making them into hyperlinks. Without this trick, when one wants to start a compile process, there are two choices:

  1. Always make sure emacs current directory is the top project directory. This usually means opening a file in this directory, or switching to a buffer where such a file is already open.

  2. Just start it, and after you click on an error message deal with the annoying prompt "Locate this error in: " or something like that. And you have to deal with it every time you click, emacs doesn't remember the relation between its current directory and the one you answered.

I got so sick of this today that I put together this [2] shell hack. It really shouldn't be necessary.

[1]
And maybe vi too, but I never start builds from vi, or edit Ocaml with it for that matter.

[2]
Gist

@gasche
Copy link
Member

gasche commented Oct 12, 2017

I was not aware that Emacs was using this to set the reference working directory. This is related to #218. The hack you propose is irritating because I don't think it is standard among builder (that solves the problem for Emacs users, but what about the others?) -- I have no strong opinion on integrating it or letting you use your own script for it. The feature of #218, or an automated way to find the root project as done in your script (and as eg. Merlin does), could maybe be combined with improvements in ocaml-distribution tooling, such as the ability to pass a directory prefix to add to Location.filename when reporting error messages. (There is the subtlety that ocamlbuild runs actually happen in a _build/ copy of the project path tree, and you want to direct the users to the source file, not its build copy, so just asking ocamlc to give absolute paths would not be good enough.)

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

2 participants