Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-18-2013, 08:13 AM   #1
exaltedwombat
Evangelist
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 433
Karma: 1703930
Join Date: Nov 2011
Device: none
Sigil 0.7 Pretty print

I applaud the new ability to Save despite badly formed code, allowing a problem to be put on hold until the next session.

But Pretty Print, unless globally disabled, still tries to tidy up. Code isn't saved "as is".

I suggest that, where Save would have thrown up an error message, refusing to proceed until malformed code is corrected, it should instead warn that the code will be saved "as is" and Pretty Print should be automatically disabled for that Save.


To see what I mean, edit the first "p" out of:

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce orci turpis, ultrices vel vehicula a, fermentum sed tellus. Ut sit amet dolor sed quam laoreet pellentesque</p>

Now Save. See what Pretty Print does? You don't get back your faulty code "as is" ready to continue working on, you get a "corrected" version. Not useful.
exaltedwombat is offline   Reply With Quote
Old 02-18-2013, 12:56 PM   #2
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
If you have Pretty Print Tidy set to on, and to run when you Save, then that's what it will do.

If you turn off Pretty Print Tidy on Save, then it won't run when you save. But if you then open the file it will run if you have Pretty Print on Open set, so you might as well turn it off altogether.

So, if you find you need to save invalid code, turn off Clean Source, save, then open later.

I assume what you want is to be warned, like you are warned about invalid code when switching to Book View, or even when running Reports. Otherwise your code is unexpectedly changed.

Seem's reasonable. It would probably just be an error message saying the file can't be saved as the code is invalid and Clean Source is turned on. You would then have to either fix the code or turn Clean Source off. If its just turned off automatically on save, then when you open the file it will be 'fixed'. And you would have to remember to turn Pretty Print Tidy back on after.
meme is offline   Reply With Quote
Old 02-18-2013, 08:48 PM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
The issue with a warning is you can have invalid code in unopened files due to a replace in all files. To do a warning every single file needs to be checked which is slow.

Also, in the case of replace in all files if you have pretty print on open set and you then open the invalid file because of the warning it will be run though your tidy setting and thus you will be right back to your complaint. At that point your settings are being honored. If you routinely deal with invalid code then turn auto off completely and just use the manual right click settings.
user_none is offline   Reply With Quote
Old 02-19-2013, 07:28 AM   #4
exaltedwombat
Evangelist
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 433
Karma: 1703930
Join Date: Nov 2011
Device: none
I've been thinking this through.

Pretty Print is good to have. Generally we want it turned on. Agreed?

It's very useful to be able to save bad code "as-is" and come back to it later. But it's only an occasional requirement.

Many of us have developed a Ctrl-S reflex while working in Sigil, or any other program. When the phone rings, nature calls or just because a few minutes have passed since we last did it - save the file!

This sensible and universally-recommended action has become dangerous. Before, if there was bad code it just wouldn't save. Now it WILL, but it changes the code.

Suggestion. Bring back the old warning when Save of malformed code is attempted. (It's still there, when switching from Code to Page view.) But add one further option. Alongside "Fix manually" and "Fix automatically" put "Save as-is. Pretty Print and HTML Tidy will be disabled. Switch them back on if required."

Last edited by exaltedwombat; 02-19-2013 at 07:31 AM.
exaltedwombat is offline   Reply With Quote
Old 02-19-2013, 08:06 AM   #5
Turtle91
Guru
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
That might work. You would need to add a check when Sigil first starts up. If Pretty Print/Tidy are disabled give a warning box that allows the user to enable before opening a file.
Turtle91 is offline   Reply With Quote
Old 02-19-2013, 08:16 AM   #6
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Modifying settings isn't going to happen. The solution, again, is to disable automatic cleaning and only run it manually. Future versions won't even allow automatic cleaning.

The proposed solution only accounts for a book saved with Sigil being opened again with Sigil and not having opened anything else in the mean time. Say you save a file and the pretty print settings are disabled and you get a warning about it. Then a few days later you need to make a tweak to another book. You open Sigil get yet another warning and choose to reenable pretty print. Then a few days after that you open the file you had saved. Your setting are back to pretty print and you run into this issue.

The second and larger issues is the proposed solution doesn't take into account books that are produced outside of Sigil that are invalid. Those files will be cleaned based on your settings and you are in the same situation. Sigil has happily "fixed" these files.

The automatic cleaning has issues. You've only noticed the issue because saving and reopening your own content has made it easier to see.
user_none is offline   Reply With Quote
Old 02-19-2013, 08:31 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,757
Karma: 39465375
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I think trying to come up with a way to save malformed code in an epub (and to consequently open that same malformed code and leave it malformed) through manipulation (auto or otherwise) of the existing Clean Source settings is akin to trying to pick up a turd by the clean end. There just is no easy, all encompassing, automatic method that will make it user friendly and intuitive for everyone.

I've mentioned this before. I think the best solution (if there even has to be a solution) would be to have an alternate file type. You get a warning message when trying to save; "Code not Well-Formed! Click here to fix automatically, click here to return and fix it manually, and click here to save it as a *.garbage file."

Opening a *.garbage file never involves Clean Source or Pretty Print. You get what you get. Opening an existing .*ePub containing errors could give you the option of opening as a *garbage file or auto-correction. You never have to worry about making sure the settings are "just right" before opening a project you may have saved in a "less than optimal" state. When you have the code fixed... save it as an epub. Lather, rinse, repeat as necessary.

Anything that involves a user remembering to make sure certain features are disabled before saving (and consequently opening) an epub are doomed to cause confusion (but is probably the least intrusive). Scenarios that automatically disable settings will cause confusion and anger.

Last edited by DiapDealer; 02-19-2013 at 08:37 AM.
DiapDealer is online now   Reply With Quote
Old 02-19-2013, 08:35 AM   #8
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 2,862
Karma: 2714881
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
I support the idea of DiapDealer.
Toxaris is offline   Reply With Quote
Old 02-19-2013, 08:42 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,757
Karma: 39465375
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Toxaris View Post
I support the idea of DiapDealer.
Keep in mind that I don't really see the need to "emergency save" invalid code as being very critical at all (as a Sigil feature). Just throwing out ideas in case such a feature is deemed necessary.
DiapDealer is online now   Reply With Quote
Old 02-19-2013, 08:44 AM   #10
exaltedwombat
Evangelist
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 433
Karma: 1703930
Join Date: Nov 2011
Device: none
Quote:
Originally Posted by user_none View Post
Modifying settings isn't going to happen. The solution, again, is to disable automatic cleaning and only run it manually. Future versions won't even allow automatic cleaning.

The proposed solution only accounts for a book saved with Sigil being opened again with Sigil and not having opened anything else in the mean time. Say you save a file and the pretty print settings are disabled and you get a warning about it. Then a few days later you need to make a tweak to another book. You open Sigil get yet another warning and choose to reenable pretty print. Then a few days after that you open the file you had saved. Your setting are back to pretty print and you run into this issue.

The second and larger issues is the proposed solution doesn't take into account books that are produced outside of Sigil that are invalid. Those files will be cleaned based on your settings and you are in the same situation. Sigil has happily "fixed" these files.

The automatic cleaning has issues. You've only noticed the issue because saving and reopening your own content has made it easier to see.
OK, fair enough. So the recommendation is now to turn all automatic cleanup permanently off? The manual says: "Pretty Print Tidy: ...<snip>... This is the recommended option for most users." Needs changing?

(But why wouldn't meme's suggestion, a few posts back in this thread, work?)

How do I run Pretty Print manually?

Last edited by exaltedwombat; 02-19-2013 at 08:47 AM.
exaltedwombat is offline   Reply With Quote
Old 02-19-2013, 09:44 AM   #11
Turtle91
Guru
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
Quote:
Originally Posted by DiapDealer View Post
is akin to trying to pick up a turd by the clean end.
ewwww!

But I actually like the idea of a separate filetype rather than turning off autocorrect.

You're so smart Diap!
Turtle91 is offline   Reply With Quote
Old 02-19-2013, 10:29 AM   #12
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,244
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by DiapDealer View Post
Keep in mind that I don't really see the need to "emergency save" invalid code as being very critical at all (as a Sigil feature). Just throwing out ideas in case such a feature is deemed necessary.
The Lights just went OUT and I have 15 minutes (tops)of UPS time to save and shut down (FWIW hibernate take longer than a shut down on XP)


I am also known also do frequent ctrl-S, usually just before a tricky 'Replace All' Load file: Discard (current)
theducks is offline   Reply With Quote
Old 02-19-2013, 10:54 AM   #13
Turtle91
Guru
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
Quote:
Originally Posted by theducks View Post
The Lights just went OUT and I have 15 minutes (tops)of UPS time to save and shut down (FWIW hibernate take longer than a shut down on XP)
What, you are still using a desktop!! This is the 2nd Decade of the 21st Century...get with the program....get a laptop!!!
Turtle91 is offline   Reply With Quote
Old 02-19-2013, 11:53 AM   #14
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,244
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Turtle91 View Post
What, you are still using a desktop!! This is the 2nd Decade of the 21st Century...get with the program....get a laptop!!!
The Cat you see sleeps on the Laptop (I do have a Cat pillow protecting it) when it is on my desk. Would you have me reported to the SPCA for being cruel?

I mainly use my laptop in the field and use Multiple 21" monitors on the desktop
theducks is offline   Reply With Quote
Old 02-19-2013, 12:20 PM   #15
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by exaltedwombat View Post
OK, fair enough. So the recommendation is now to turn all automatic cleanup permanently off? The manual says: "Pretty Print Tidy: ...<snip>... This is the recommended option for most users." Needs changing?

(But why wouldn't meme's suggestion, a few posts back in this thread, work?)

How do I run Pretty Print manually?
Right-click in Code View and select Reformat HTML - and choose your option.

The recommendation, and default setting, is Pretty Print Tidy - because most people want their code cleaned up and reformatted. Whether that will have to change in the future is a good question.

I think its clear that something needs to be done to address the issue of saving potentially causing some loss of data for invalid files. What and when are yet more questions
meme is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Not Working (nor print to PDF) foxglove Calibre 5 03-02-2012 10:05 AM
Sigil 0.3.4 / Sigil 0.4.0 RC1 / Cover in Nook Color Bertrand Sigil 13 08-06-2011 04:06 AM
Sigil 0.3.4 / Problème CSS entre Sigil et iPad Grivels Software 10 07-03-2011 09:06 AM
Print vs Pixel: retailers experiment with print/ebook bundles DMcCunney General Discussions 42 09-15-2010 11:29 AM
Print from Sigil? Or viable alternative? Hitch Sigil 31 07-13-2010 04:31 PM


All times are GMT -4. The time now is 09:13 AM.


MobileRead.com is a privately owned, operated and funded community.