Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-01

Auto session store etc.

17 messages · 9 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Florian Klämpfl

Is there any possibility that lazarus auto stores the current session (project file, source files, session information etc.) every xxxx s?

Background is that I am starting another trial to use linux as desktop system but within in a few days I have already lost changes because lazarus was just killed on shutdown (well, actually I would prefer to have linux just hibernating instead of shutdown, but this is another story).

Furthermore, is there any option to store the green bars which indicate changed sources between different runs of lazarus?

Reply by email

Mattias Gaertner
to Florian Klämpfl
Is there any possibility that lazarus auto stores the current session (project file, source files, session information etc.) every xxxx s?

No.

A simple save is easy to implement. But there are some cases which makes it difficult in general:

- If it would trigger a normal "save all" and you have just created some new files or are in the middle of a refactoring you will get suddenly save and message dialogs. I personally would hate that interruption.
- I often open a file, change something and save it as another name. An autosave would play havoc here.
- It would be better if the autosave would save the changed files in a separate location (e.g. .lazarus/autosave), which can then be restored on next start. But that requires some more work.

Show quoted text 8 lines
Background is that I am starting another trial to use linux as desktop system but within in a few days I have already lost changes because lazarus was just killed on shutdown (well, actually I would prefer to have linux just hibernating instead of shutdown, but this is another story). Furthermore, is there any option to store the green bars which indicate changed sources between different runs of lazarus?

Wouldn't that accumulate over time so that everything becomes green? You need some "reset".

Mattias

Reply by email

Florian Klämpfl
to Henry Vermaak
Henry Vermaak wrote 6 lines
On Fri, Jan 04, 2019 at 12:08:56PM +0100, Florian Klämpfl via lazarus wrote: > Is there any possibility that lazarus auto stores the current session > (project file, source files, session information etc.) every xxxx s? At the very least do an emergency save on SIGTERM and provide the option to restore the session.

This would be also an option. I don't know how linux desktop programs have to behave on shutdown (regular, by the shutdown button in the menu), but at least it may not result in a lose of unsaved work.

Reply by email

Michael Van Canneyt
to Mattias Gaertner: On Fri, 4 Jan 2019 12:08:56 +0100 No. A simple save is easy to implement. But there are…
Mattias Gaertner wrote 20 lines
On Fri, 4 Jan 2019 12:08:56 +0100 Florian Klämpfl via lazarus wrote: > Is there any possibility that lazarus auto stores the current session > (project file, source files, session information etc.) every xxxx s? No. A simple save is easy to implement. But there are some cases which makes it difficult in general: - If it would trigger a normal "save all" and you have just created some new files or are in the middle of a refactoring you will get suddenly save and message dialogs. I personally would hate that interruption. - I often open a file, change something and save it as another name. An autosave would play havoc here. - It would be better if the autosave would save the changed files in a separate location (e.g. .lazarus/autosave), which can then be restored on next start. But that requires some more work.

Well, to my big relief, I discovered that Atom does this.

It saves files that were opened but never saved. Next time I opened the project, even the unsaved files were there.

So I am all for this 'more work' :)

Michael.

Reply by email

Florian Klämpfl
to Mattias Gaertner: On Fri, 4 Jan 2019 12:08:56 +0100 No. A simple save is easy to implement. But there are…
Mattias Gaertner wrote 20 lines
On Fri, 4 Jan 2019 12:08:56 +0100 Florian Klämpfl via lazarus wrote: > Is there any possibility that lazarus auto stores the current session > (project file, source files, session information etc.) every xxxx s? No. A simple save is easy to implement. But there are some cases which makes it difficult in general: - If it would trigger a normal "save all" and you have just created some new files or are in the middle of a refactoring you will get suddenly save and message dialogs. I personally would hate that interruption. - I often open a file, change something and save it as another name. An autosave would play havoc here. - It would be better if the autosave would save the changed files in a separate location (e.g. .lazarus/autosave), which can then be restored on next start. But that requires some more work.

Well, yes. But one cannot have everything ;) I would be happy with a primitive solution which prevents losing work.

Show quoted text 13 lines
> Background is that I am starting another trial to use linux as > desktop system but within in a few days I have already lost changes > because lazarus was just killed on shutdown (well, actually I would > prefer to have linux just hibernating instead of shutdown, but this > is another story). > > Furthermore, is there any option to store the green bars which > indicate changed sources between different runs of lazarus? Wouldn't that accumulate over time so that everything becomes green? You need some "reset".

By just closing the source code tab?

Reply by email

Giuliano Colla
to Florian Klämpfl: Is there any possibility that lazarus auto stores the current session (project file,…

Il 04/01/2019 12:08, Florian Klämpfl via lazarus ha scritto:

Show quoted text 11 lines
Is there any possibility that lazarus auto stores the current session (project file, source files, session information etc.) every xxxx s? Background is that I am starting another trial to use linux as desktop system but within in a few days I have already lost changes because lazarus was just killed on shutdown (well, actually I would prefer to have linux just hibernating instead of shutdown, but this is another story). Furthermore, is there any option to store the green bars which indicate changed sources between different runs of lazarus?

I'm using linux as my desktop (and laptop) system since a very long time. Basically I never use shutdown, except for a kernel or libc update. I just leave my desktop linux running, and either suspend or hibernate my laptop.
Depending of the combination of your platform, your distro, and the Desktop you're using, you may have available both a "suspend to ram" (only if it is a laptop with battery) and a "hibernate" (=suspend to disk). But you must pick up a good distro, within the distro select a stable and tested version (the latest version is always a lottery), and select a good Desktop.
Or you may resort to command-line, which is less subject to Desktop environment bugs: depending on distro and kernel you may have available /pm-suspend/ and /pm-hibernate/ or /systemctl suspend/ and /systemctl hibernate. /If it doesn't wake up properly, you may need to google to find out the quirks required for your specific hardware.

As far as Lazarus is concerned, everything relevant is saved each time you compile (or attempt to compile) your application. Just hit F9 and you're done.
You may easily check and tune your behaviour: if, when trying to quit Lazarus, a dialogue shows "Save changes to project xxxx?" it means that some changes will be lost by a kill, if it doesn't show, it means that all relevant changes have already been saved, and that a kill wouldn't do any harm.

Giuliano

Do not do to others as you would have them do to you.They might have different tastes. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190104/f67bf9ca/attachment-0001.html>

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Well, to my big relief, I discovered that Atom does this. It saves files that were opened…
Michael Van Canneyt wrote
Well, to my big relief, I discovered that Atom does this.

EditPad Pro and jEdit also does that. Seems it is a more popular feature than first expected. ;-)

From the book "About Face 3: The Essentials of Interaction Design" (not

a direct quote):

Editors and most programs shouldn't even need an explicit Save menu option. If they auto-save everything - combined with an Undo feature
- that's all that is needed. Why bother the end-user then with an explicit Save. Many mobile apps already implement this behaviour with great success.

So I am all for this 'more work' :)

+1

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Sven Barth
to Florian Klämpfl: Well, yes. But one cannot have everything ;) I would be happy with a primitive solution…

Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus <

Show quoted text 18 lines
geschrieben: > > >> Background is that I am starting another trial to use linux as >> desktop system but within in a few days I have already lost changes >> because lazarus was just killed on shutdown (well, actually I would >> prefer to have linux just hibernating instead of shutdown, but this >> is another story). >> >> Furthermore, is there any option to store the green bars which >> indicate changed sources between different runs of lazarus? > > Wouldn't that accumulate over time so that everything becomes green? > You need some "reset". By just closing the source code tab?

Somehow I have the feeling what you really need is "show changed lines in regard to version control system" :P (at least that's what I would need...)

Regards,
Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190104/5e6739b1/attachment.html>

Reply by email

Florian Klämpfl
to Giuliano Colla: Il 04/01/2019 12:08, Florian Klämpfl via lazarus ha scritto: I'm using linux as my…
Giuliano Colla wrote
But you must pick up a good distro, within the distro select a stable and tested version (the latest version is always a lottery), and select a good Desktop.

If there had been one (seems Ubuntu and derivatives removed hibernation (!!, remember, we are in 2018, not 1998) in 18.04, I didn't ask about this feature.

As far as Lazarus is concerned, everything relevant is saved each time you compile (or attempt to compile) your application. Just hit F9 and you're done.

Well, when working on the compiler, I often do not compile for hours, but meanwhile I found the AutoSave package for Lazarus which prevents at least the worst case scenarios.

You may easily check and tune your behaviour:

It is also about X crashes and so on (and I do not like to adapt my behavior :)).

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: EditPad Pro and jEdit also does that. Seems it is a more popular feature than first…
Graeme Geldenhuys wrote 15 lines
On 04/01/2019 11:59, Michael Van Canneyt via lazarus wrote: > Well, to my big relief, I discovered that Atom does this. EditPad Pro and jEdit also does that. Seems it is a more popular feature than first expected. ;-) From the book "About Face 3: The Essentials of Interaction Design" (not a direct quote): Editors and most programs shouldn't even need an explicit Save menu option. If they auto-save everything - combined with an Undo feature - that's all that is needed. Why bother the end-user then with an explicit Save. Many mobile apps already implement this behaviour with great success.

I read that too. But here I don't agree 100%.

Of course you need an explicit 'save' for an editor. You need to give a name to your file. And what if I want to rename my file ?

Imagine every editor just auto saves under Documents with a GUID as a name. Or you need to memorize the filesystem iNode of the document.

That would become messy :)

Michael.

Reply by email

Florian Klämpfl
to Sven Barth: Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus < Somehow I have the feeling…
Sven Barth wrote 24 lines
Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus < <mailto:>> geschrieben: > > >> Background is that I am starting another trial to use linux as >> desktop system but within in a few days I have already lost changes >> because lazarus was just killed on shutdown (well, actually I would >> prefer to have linux just hibernating instead of shutdown, but this >> is another story). >> >> Furthermore, is there any option to store the green bars which >> indicate changed sources between different runs of lazarus? > > Wouldn't that accumulate over time so that everything becomes green? > You need some "reset". By just closing the source code tab? Somehow I have the feeling what you really need is "show changed lines in regard to version control system" :P (at least that's what I would need...)

Well, yes. But till next christmas it's a long time ;)

Reply by email

Michael Van Canneyt
to Florian Klämpfl
Florian Klämpfl wrote 27 lines
Am 04.01.19 um 14:26 schrieb Sven Barth via lazarus: > Am Fr., 4. Jan. 2019, 13:01 hat Florian Klämpfl via lazarus > < <mailto:>> > geschrieben: > > > > > > >> Background is that I am starting another trial to use linux as > >> desktop system but within in a few days I have already lost changes > >> because lazarus was just killed on shutdown (well, actually I would > >> prefer to have linux just hibernating instead of shutdown, but this > >> is another story). > >> > >> Furthermore, is there any option to store the green bars which > >> indicate changed sources between different runs of lazarus? > > > > Wouldn't that accumulate over time so that everything becomes green? > > You need some "reset". > > By just closing the source code tab? > > > Somehow I have the feeling what you really need is "show changed lines > in regard to version control system" :P (at least that's what I would > need...) Well, yes. But till next christmas it's a long time ;)

Again something that Atom has :)

In general, the git integration of Atom is the easiest to use that I've seen yet...

Michael.

Reply by email

Marco van de Voort
to Graeme Geldenhuys: EditPad Pro and jEdit also does that. Seems it is a more popular feature than first…

Op 2019-01-04 om 14:05 schreef Graeme Geldenhuys via lazarus:

Show quoted text 12 lines
EditPad Pro and jEdit also does that. Seems it is a more popular feature than first expected. ;-) From the book "About Face 3: The Essentials of Interaction Design" (not a direct quote): Editors and most programs shouldn't even need an explicit Save menu option. If they auto-save everything - combined with an Undo feature - that's all that is needed. Why bother the end-user then with an explicit Save. Many mobile apps already implement this behaviour with great success.

Unfortunately the undo is often only for the session.

Reply by email

Giuliano Colla
to Florian Klämpfl: If there had been one (seems Ubuntu and derivatives removed hibernation (!!, remember, we…

Il 04/01/2019 14:27, Florian Klämpfl via lazarus ha scritto:

If there had been one (seems Ubuntu and derivatives removed hibernation (!!, remember, we are in 2018, not 1998) in 18.04, I didn't ask about this feature.

With a good distro I didn't mean Ubuntu, which is the opposite of what a software developer needs. It is intended for non-technical end users. It makes it very easy to get multimedia software, and very hard to administer the system, and tune it to your needs. It's the best choice for my wife, but my current choice is CentOs. I don't know what will happen in future, with IBM having bought Red Hat (for 34 billion $!!!).

However if you want to enable hibernate in Ubuntu 18.04, you may find useful help here:
http://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/

Giuliano

Do not do to others as you would have them do to you.They might have different tastes.

Reply by email

Unknown author
to Marco van de Voort: Op 2019-01-04 om 14:05 schreef Graeme Geldenhuys via lazarus: Unfortunately the undo is…
Marco van de Voort wrote
Unfortunately the undo is often only for the session.

that information can also be saved so that it persists between front-to-back sessions... it could also be saved as part of the project data so that it is specific to that one project and it's files...

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list unless* *a signed and pre-paid contract is in effect with us.*

Reply by email