guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 246 forks source link

Ignore emacs editor temp file. #543

Closed zw963 closed 3 years ago

zw963 commented 3 years ago

Emacs will generate some temp files before save, e.g. .#app.rb, #app.rb#.

So, i thought we should add those rarely used filename to ignore list. like this:

listener.ignore /\A\.?#/
ColinDKelley commented 3 years ago

@zw963 That regexp looks a bit more general than the 2 examples you show, because it would also match #app.rb.

Does this pattern look accurate to match exactly those 2 cases? /\A.#|\A#.*#\z/?

Could you please make a PR with this change, along with specs?

zw963 commented 3 years ago

That regexp looks a bit more general than the 2 examples you show

Yes, /\A\.?#/ is a little general (though, this is my original purpose)

I just want ignore any file which prefix with .# or #, if you favor more accurate, i can exact file name like (?:^\.#|^#.+#$), will create PR later.

zw963 commented 3 years ago

@ColinDKelley PR, #546 , thank you.