embark icon indicating copy to clipboard operation
embark copied to clipboard

Actions on file selected relative to project path is attempted on a path relative to the file of the open buffer

Open magthe opened this issue 10 months ago • 1 comments

I observe some unexpected behaviour when trying to embark-act on files found using consult-projectile-find-file. Is the following a bug, something I've missed in my configuration? (I'm hoping it's not an unreasonable expectation.)

Steps

  1. Open a file in a project (I'm using projectile), e.g. <proj root>/.github/workflows/test.yaml.
  2. Run consult-projectile-find-file and find a file in another part of the project, e.g. <proj root>/tests/e2e-tests/runtest.sh.
  3. Run embark-act on the file, and choose to delete it, i.e. pressing d (in my setup at least).
  4. Answer the question Run delete-file on tests/e2e-tests/runtest.sh? (y or n) with 'y'.

Expected behaviour

The file <proj root>/tests/e2e-tests/runtest.sh is deleted from the filesystem.

Observed behaviour

What I get is a the following in the *Messages* buffer:

embark PCH: (error "Cannot <proj root>/.github/workflows/tests/e2e-tests/viswiz.sh to trash: Permission denied")

magthe avatar Mar 04 '25 08:03 magthe

I thought embark had some fancy footwork with default-directory to avoid this problem. I'll look into it. I have a vague recollection of testing this with project.el, maybe projectile does something different (or maybe I'm wrong about this working with project.el).

oantolin avatar Mar 04 '25 20:03 oantolin