remove outosave after compilation lazarus / 13-General ---------------------------------------------------------------------- Paolo · 2021-07-18 17:48 How to remove the autosave of edited files after compilation ? LAZARUS 2.0.12, windows 10 pro 64-bit thank you ---------------------------------------------------------------------- Paolo · 2021-09-23 16:24 no way to remove autosave ? ---------------------------------------------------------------------- Bart · 2021-09-23 16:30 The Lazarus IDE saves the files before compilation. The compiler only has access to the files of the project, not to the text in the source editor of the IDE (which for all intents and purposes only resides in memory). Bart ---------------------------------------------------------------------- Paolo · 2021-09-23 16:35 ok, but what I see is that if I change the code, do a run and then close file the change is written in the pas file. But my intent was just to try the effect of code modification without change the file. How can I do this ? ---------------------------------------------------------------------- Paolo · 2021-09-23 16:43 In delphi I can do a whole working session and do several runs and several code modifications, then when I close the project and not saving any files all come back to the initial status. ---------------------------------------------------------------------- Bart · 2021-09-23 21:19 In Lazarus you cannot. Live with it (or use Delphi). Bart ---------------------------------------------------------------------- winni · 2021-09-23 21:35 Quote from: Bart on September 23, 2021, 11:19:38 pmIn Lazarus you cannot. Live with it (or use Delphi). Bart Hi! There is always a way: Kill Lazarus with SIGKILL (9) Not a nice way but it works. Winni ---------------------------------------------------------------------- wp · 2021-09-23 21:43 Use a version control system like git or svn. ---------------------------------------------------------------------- Bart · 2021-09-23 21:54 Quote from: winni on September 23, 2021, 11:35:18 pmThere is always a way: Kill Lazarus with SIGKILL (9) How is that going to achieve what Paolo wants: - compile the changed but yet unsaved sourcecode - do not save the source files before compilation The compiler simply cannot use the changed sourcecode if it is not saved to file. Bart ---------------------------------------------------------------------- Paolo · 2021-09-24 22:54 OK, thanks Bart, so it is not possible. just a note: I found this a little annoying and dangerous, If I type something just to test and then I want come back I have to remember what has to be reverted (but even in case I did a wrong input in the code then it is saved !).  don't know how delphi works, it probably creates some backups, so until you explicitly do a save, closing the project leaves the project unchanged. @wp, never used git or svn, maybe it is time to look at them ---------------------------------------------------------------------- Martin_fr · 2021-09-24 23:49 Well its not "not possible". It is not possible with the current IDE. But it could be added.... It would need some implementation (new featuer in the IDE), and that needs someone to do it.... Because fpc is a separate exe, it can not access the memory of the IDE. So it want know the content of any editor. For compiling the current content of the file must be on some media (disk/volume). And not just the current files, but all files in any uses clause. And all files of the project must be in the expected folder structure (usually all units in the same folder / ignore packages for now). So the ways that this could be implemented are: 1) - The IDE creates backups of all files - Saves the files - compiles - restores the backups That is flawed, if the IDE hits file system permissions. And it can change timestamps, upsetting revision management tools 2) - The IDE saves all files to a temporary location - The files are compiled in that temp location. For that the IDE must be informed of all files. If there are files that the IDE does not know, then they will not be in the temp dir, and the compile fails. --- Either way, it needs to be implemented. ---------------------------------------------------------------------- JuhaManninen · 2021-09-25 00:21 Use Undo (Ctrl-Z). You can Undo changes in a saved file, too. Hit Ctrl-Z enough many times and you get the original contents. Delphi IDE includes the compiler and thus can compile a file already loaded into memory. ---------------------------------------------------------------------- VTwin · 2021-09-25 00:37 I always save a local and/or github build version before tinkering with the code. I guess that is pretty much what wp says. ---------------------------------------------------------------------- Paolo · 2021-09-25 11:19 thanks to All ! at the moment  I'll follow the Juha suggestion that I did not think about  . @VTwin I usually do frequent backups, my projects have few units that makes the things easy, so I can always compare what I have changed in case of problem. @Martin_fr I understood that it is not easy to implement such beahaviour. thanks to all for the suggestions