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

Fix pet.el to work on tramp #20

Closed
wants to merge 0 commits into from

Conversation

egelja
Copy link
Contributor

@egelja egelja commented Mar 25, 2023

  • Sets the remote parameter of executable-find to t (only works in Emacs 27+)
  • Uses process-file instead of call-process
  • Checks if there is a remote connection when finding the bin directory
  • Also fixes arguments to dasel

Closes #19

@egelja
Copy link
Contributor Author

egelja commented Jun 20, 2023

@wyuenho Could you please take a look at this?

@wyuenho
Copy link
Owner

wyuenho commented Jun 20, 2023

Hi sorry for the delay. I don't use tramp, and I honestly have no idea how to set up an environment to test this. Is this about using dev containers like the cool kids do these day? If so, can you please provide me with some detailed instructions so I can play around with this PR? Thanks.

@egelja
Copy link
Contributor Author

egelja commented Jun 21, 2023

I don't use it for dev containers. Just for editing files on a remote server. To do so, just use C-x C-f /ssh:<SERVER>:<PATH>. Then you can check if pet is working with pet-verify-setup.

@egelja
Copy link
Contributor Author

egelja commented Jul 7, 2023

Just updated with the current main branch.

Copy link
Owner

@wyuenho wyuenho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better. Do you mind writing some tests after fixing some minor issues and the conflict?

pet.el Outdated
(if (eq system-type 'windows-nt) "Scripts" "bin"))
(if (eq (if (file-remote-p default-directory)
(tramp-get-connection-property (tramp-dissect-file-name default-directory)
"uname" 'windows-nt)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this property defaulting to windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only machines without uname installed are windows.

pet.el Outdated
@@ -378,19 +383,19 @@ This variable is an alist where the key is the absolute path to a

Returns the path to the `pre-commit' executable."
(and (pet-pre-commit-config)
(or (executable-find "pre-commit")
(or (executable-find "pre-commit" t)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes PET incompatible with Emacs < 27

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality that enables this PR was added in Emacs 27.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what I have in mind. Give it a shot, turn on GitHub Actions on your fork to see how that goes on Emacs 26 :)

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

Successfully merging this pull request may close these issues.

Doesn't work on remotes over TRAMP
2 participants