Have Prudence ignore editor autosaves

9 views
Skip to first unread message

Peter O'Malley

unread,
Jan 15, 2014, 12:42:21 PM1/15/14
to prudence-...@googlegroups.com
I'm just getting started with sincerity/prudence/diligence. Seems great so far.

Is there any way I can get prudence to ignore backup files created by the text editor, e.g., when I edit a file "api.m.py" I also get an autosave "api.m.py~". When my route is "/api/* : /api/" then for some reason it tries to load api.m.py~ and scripturian throws a fit. I can manually delete the ~ file, and then I get a 404 until I restart prudence, after which it works... until I edit the file again. As a workaround I suppose I can disable the autosave but generally I like to have something autosaving my work.

Ideas? Or is there a different place I should post this?

Thanks,
Peter

Tal Liron

unread,
Jan 15, 2014, 12:46:48 PM1/15/14
to prudence-...@googlegroups.com
Hm, Scripturian will explicitly ignore system-hidden files, but it seems your text editor doesn't save these backups as hidden. The reason Scripturian doesn't specifically ignore these is because it's meant to support many languages: it has no idea that ".py~" is not a filename extension for a programming language.

Could you open a bug on this in Google Code? Until I get to finding a workaround, I suggest looking at your text editor's settings -- there might be a way to have the backup files saved in a different directory.
--
You received this message because you are subscribed to the Google Groups "Prudence Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prudence-commun...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Peter O'Malley

unread,
Jan 15, 2014, 1:43:47 PM1/15/14
to prudence-...@googlegroups.com
Wow, thanks for the quick reply! I'll see about setting my editor's
autosave thing to a hidden file (I use gedit). I understand the issue
and I agree the correct solution should be to have the editor create
hidden files for autosaves, because, you know, that makes sense. I
suppose you could also somewhere have a set of "ignore" extensions if
you wanted to make Scripturian deal with silly editors.

Here's the issue: http://code.google.com/p/prudence/issues/detail?id=30

Thanks!
Peter
> You received this message because you are subscribed to a topic in the
> Google Groups "Prudence Community" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/prudence-community/lFOjs-1BmAY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Tal Liron

unread,
Jan 15, 2014, 1:49:50 PM1/15/14
to prudence-...@googlegroups.com
Yes, an "ignore" is exactly what I had in mind. I'll need to give this some design thought: I'm thinking that it might actually best be a Sincerity-level feature, because the bug could affect anything running in the container, even if it's not a Prudence application.

It seems the file location and pattern is hardcoded in GEdit. May I suggest you give Geany a try? It's a truly wonderful programming editor.

Tal Liron

unread,
Jan 15, 2014, 1:52:18 PM1/15/14
to prudence-...@googlegroups.com
BTW, in Geany you want to enable the "Save Actions" plugin, which gives you lots of control over exactly where the backup files are saved.

-Tal

Peter O'Malley

unread,
Jan 15, 2014, 1:55:16 PM1/15/14
to prudence-community
Actually I use Geany at work, and haven't got around to installing it
at home. I guess this gives me a reason to! The only issues I have
with it were that I couldn't quite get all the plugins to behave just
how I wanted. Specifically the highlight all occurrences and the code
folding features are a little wonky (or at least not how the behave in
notepad++ which I love).

Tal Liron

unread,
Mar 9, 2014, 4:42:25 AM3/9/14
to prudence-...@googlegroups.com
Peter, support for ignoring certain extensions has been committed, and will be available in Scripturian 1.1.2 (included in the next Sincerity beta release).

It works by setting the SCRIPTURIAN_IGNORE_POSTFIXES environment var to a comma-separated list of extensions. For example:

SCRIPTURIAN_IGNORE_POSTFIXES=~ sincerity install
Reply all
Reply to author
Forward
0 new messages