arion icon indicating copy to clipboard operation
arion copied to clipboard

should be more robust about unexpected files

Open mwotton opened this issue 10 years ago • 10 comments

Emacs tends to litter the directory with lockfiles if you don't turn it off (which is not recommended anyway, as you could end up editing the same file in different buffers.)

unfortunately this conflicts with arion: when i start arion with one of these files, I get this:

arion: app/.#SmokeMain.hs: canonicalizePath: does not exist (No such file or directory)

orb ➜  ~/projects/meanpath/smokesignal git:(master) ✗ ls -alrt app/.\#SmokeMain.hs
lrwxrwxrwx 1 mark mark 24 Apr 12 12:14 app/.#SmokeMain.hs -> [email protected]:1427791825

Instead of bombing out on these files, could we just ignore them (or issue a complaint but continue)?

mwotton avatar Apr 12 '15 05:04 mwotton

I'll look at this. I am a vi user so I don't know much about lockfiles that emacs creates. Is there a pattern to those file names? May be once we find all the haskell files using filemanip's find function we can filter out the lockfiles before computing the canonicalized paths.

karun012 avatar Apr 12 '15 17:04 karun012

I think it might be more robust to just catch the exception on opening, have a bit of a whinge on stdout and continue.

On Mon, 13 Apr 2015 12:17 am Karun [email protected] wrote:

I'll look at this. I am a vi user so I don't know much about lockfiles that emacs creates. Is there a pattern to those file names? May be once we find all the haskell files using filemanip's find function we can filter out the lockfiles before computing the canonicalized paths.

— Reply to this email directly or view it on GitHub https://github.com/karun012/arion/issues/30#issuecomment-92088993.

mwotton avatar Apr 12 '15 23:04 mwotton

Currently experiencing the same problem. Lock files seem to start with ".#". I tried the following but still had the same issues... Although the pattern seems to fit.

findHaskellFiles :: String -> IO [String]
findHaskellFiles = find always ((extension ==? ".hs" ||? extension ==? ".lhs") &&? predEmacsFiles)

predEmacsFiles :: FilterPredicate
predEmacsFiles = fileName /~? ".#?"

marcelbuesing avatar Jun 13 '15 11:06 marcelbuesing

@marcelbuesing @mwotton May be this will fix it 2a2b88ce896cd9d6e648650eac9b61005389167f

karun012 avatar Jun 13 '15 17:06 karun012

@karun012 awesome, that seems to solve the problem!

marcelbuesing avatar Jun 14 '15 14:06 marcelbuesing

hm. still getting this:

/home/mark/projects/meanpath/Perspective/src/Net/Perspective/.#Meanpath.hs changed /home/mark/projects/meanpath/Perspective/src/Net/Perspective/.#Meanpath.hs does not have any associated tests...

mwotton avatar Jun 22 '15 18:06 mwotton

I'll take a look.

karun012 avatar Jun 23 '15 15:06 karun012

@mwotton ff8dacb2245427ff75ad58ac2ef17f8b5f08b67f - The event processor ignores emacs lock files now.

karun012 avatar Jun 24 '15 03:06 karun012

If this is good, can we close the issue?

karun012 avatar Jun 24 '15 20:06 karun012

Yes

On Wed, 24 Jun 2015 4:36 pm Karun [email protected] wrote:

If this is good, can we close the issue?

— Reply to this email directly or view it on GitHub https://github.com/karun012/arion/issues/30#issuecomment-115003688.

mwotton avatar Jun 24 '15 21:06 mwotton