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

Can't prevent sos from triggering on emacs lock files #40

Open
Martinsos opened this issue Feb 5, 2020 · 5 comments
Open

Can't prevent sos from triggering on emacs lock files #40

Martinsos opened this issue Feb 5, 2020 · 5 comments

Comments

@Martinsos
Copy link

Martinsos commented Feb 5, 2020

Hi!
I have emacs creating files like .#myfile.txt when I am editing a file, and sos triggers on those (runs the command). This is not the behaviour I want, so I tried using -e to exclude those, but I just can't get it to work!
I tried following:

-e "#"
-e "\.#"
-e ".*\.#.*"

and non of those excludes the files in question from triggering sos.

The message I get is Added: foo/bar/.#yourfile.txt. So it seems to be triggering only on adding the emacs lock file, not modifying it. Is it possible that -e matches only modified files and not added ones?

Am I doing smth wrong? Thank you!

Btw. I am on Archlinux, I am running sos on a directory, and sos version is 2.0.2.

@Prillan
Copy link

Prillan commented Feb 6, 2020

Related: #12

@schell
Copy link
Owner

schell commented Feb 6, 2020

Thanks @Martinsos - I'll look into it.

@schell
Copy link
Owner

schell commented Feb 6, 2020

Try -e \# and tell me if that helps. I typically use a number of .sosrc files for my projects and they all look a bit like this (where ... is replaced with your specific patterns and commands):

- pattern: ...
  excludes: 
  - \# 
  - flycheck 
  commands: 
  - stack exec ...

@Martinsos
Copy link
Author

@schell Thanks for the suggestion, but it does not work!
I tried -e \# and -e "\#" and none of those worked.
I did this in command line, not from .sosrc.

@peterbecich
Copy link
Collaborator

peterbecich commented Dec 4, 2022

@Martinsos , what about this

sos . -p ".*\.hs" -e ".*\#.*\.hs" -c "echo 'hello'"

I have tested it to watch all hs files in a directory, and ignore all hs Emacs lock files; I believe it works:
https://github.com/peterbecich/halogen-chess/blob/7e67a560d7482e35ff19c6eb29426147b8135819/flake.nix#L211

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

4 participants