Discussion:
Fixing preview of modified files in browser
Andrius Rinkevicius
2014-07-12 15:56:01 UTC
Permalink
Hi all,
there were several reports regarding preview of modified files in browser.
See for example post on May 31. On MacOSX the preview does not work at all,
even with open -a Firefox %i command form.
The reason for this is that bash exits and deletes temporal file earlier
that system launches Firefox(other browsers are the same). If I comment
line 108
g_unlink(ep->tmp_in);
in external_commands.c then preview starts to operate. Obviously the
temporary files are not deleted, so it it left to OS to handle deletion. I
am not sure if this would be OK. I think it would be good to add some code
that cleans tmp directory at bluefish exit. Also, the way tmp filename is
created needs to be modified, since at the moment each tmp file is created
in new directory, so it end up with a lot of directories with one file in
it. Any comments?
Other issue with %i modifier is that when file is moved to tmp directory,
the html files are not rendered as they should since working directory was
changed. Would be there any issues if we create tmp file in the same
directory? Now we create, for example, backup files automatically and this
is OK. Would be possible to implement some kind of facility to create tmp
file in working directory and then automatically delete it? Any suggestions?
Andrius
Olivier Sessink
2014-07-13 19:55:44 UTC
Permalink
Post by Andrius Rinkevicius
Hi all,
there were several reports regarding preview of modified files in
browser. See for example post on May 31. On MacOSX the preview does
not work at all, even with open -a Firefox %i command form.
The reason for this is that bash exits and deletes temporal file
earlier that system launches Firefox(other browsers are the same). If
I comment line 108
g_unlink(ep->tmp_in);
in external_commands.c then preview starts to operate. Obviously the
temporary files are not deleted, so it it left to OS to handle
deletion. I am not sure if this would be OK. I think it would be good
to add some code that cleans tmp directory at bluefish exit. Also, the
way tmp filename is created needs to be modified, since at the moment
each tmp file is created in new directory, so it end up with a lot of
directories with one file in it. Any comments?
Other issue with %i modifier is that when file is moved to tmp
directory, the html files are not rendered as they should since
working directory was changed. Would be there any issues if we create
tmp file in the same directory? Now we create, for example, backup
files automatically and this is OK. Would be possible to implement
some kind of facility to create tmp file in working directory and then
automatically delete it? Any suggestions?
sounds like the best solution, but perhaps we should make this
configurable so a user can change it.

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-07-14 14:24:47 UTC
Permalink
This post might be inappropriate. Click to display it.
Olivier Sessink
2014-07-15 20:21:58 UTC
Permalink
Post by Andrius Rinkevicius
Olivier,
would it be OK to add in Preferences->Files->Backup&Recovery entries
Checkbox: "Create copy of modified files in current folder for
preview" and
"Remove temporal preview files after xxx seconds (0 means do not
remove files)"
Default values could be True and, say, 10 seconds.
How do You think?
or add a %P option for external commands: preview URL, equals %p for
saved files, for modified files a temporary file in the same directory
is created.

I think the lifespan of the temporary file can be a hidden option (in
the config file, but not in the preferences panel). I don't think it's
important for average users to change it away from the defaults.

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-07-19 09:09:18 UTC
Permalink
I agree. I will look into code how to add %P option for external commands.
Andrius


On Tue, Jul 15, 2014 at 11:21 PM, Olivier Sessink <
Post by Olivier Sessink
Post by Andrius Rinkevicius
Olivier,
would it be OK to add in Preferences->Files->Backup&Recovery entries
Checkbox: "Create copy of modified files in current folder for preview" and
"Remove temporal preview files after xxx seconds (0 means do not
remove files)"
Default values could be True and, say, 10 seconds.
How do You think?
or add a %P option for external commands: preview URL, equals %p for
saved files, for modified files a temporary file in the same directory
is created.
I think the lifespan of the temporary file can be a hidden option (in
the config file, but not in the preferences panel). I don't think it's
important for average users to change it away from the defaults.
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-dev" in
panel at http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Loading...