Skip to content

Current Working Directory Problems #6

Description

@nickenchev

Not sure if this has already been mentioned, but when using clang check, my current working directory doesn't change after opening a file.

in Emacs if I:

  1. cd to ~/projects/myproject
  2. open file ~/projects/myproject/src/test.cpp

My current directory still remains ~/projects/myproject
Though it should be ~/projects/myproject/src/ while looking at the test.cpp buffer. This is not a huge deal as I can just 'cd' into src, but it isn't the default emacs behaviour when dealing with current buffer working directories and causes issues with switching between h/cpp files. If my project had a more complicated src structure (as most projects do), this would be problematic as it would be a huge pain to have to 'cd' all the time after opening files.

This only becomes an issue after enabling flycheck-clangcheck and not with flycheck alone.

Read through some of the code and saw that "default-directory" is being set, is this so that the package can read compile_commands.json regardless of the current buffer? Is it not possible to keep track of the compile_commands.json directory without overwriting the default-directory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions