Setting to enable persistent non-saved buffers

17 views
Skip to first unread message

rol...@logikalsolutions.com

unread,
May 24, 2021, 3:21:58 PMMay 24
to scite-interest

All,

There has to be a setting for this, but I haven't stumbled into it yet. I thought it would be in the "session" settings but no love.

I'm looking for a setting that will preserve unsaved unnamed note files across sessions. I used to use Sublime for this kind of note taking because things would still be there if something caused a crash. 

Notepadqq can kind of do it, but has other issues.

Sublime wants me to buy a new license now and I'm once again seeing what my options are for a persistent "note taker" editor that can also double as an actual editor when needed.

Emacs doesn't save buffers.

John Yeung

unread,
May 24, 2021, 4:18:44 PMMay 24
to scite-interest
On Mon, May 24, 2021 at 3:22 PM 'rol...@logikalsolutions.com' via
scite-interest <scite-i...@googlegroups.com> wrote:
>
> There has to be a setting for this, but I haven't stumbled into it yet. I thought it would be in the "session" settings but no love.

I actually don't think SciTE has this feature. I would be happy to be
wrong about that!

> Sublime wants me to buy a new license now and I'm once again seeing what my options are for a persistent "note taker" editor that can also double as an actual editor when needed.
>
> Emacs doesn't save buffers.

I would have thought Emacs can, since it seems to do an amazing amount
of things.

Have you tried Visual Studio Code? Some consider it "heavy" as it's an
Electron app. But it does persist all buffers, and it obviously can
serve as an actual editor.

I will say that I'm not sure if the buffers will still be there after
a crash. I haven't experienced a crash in a very long time.

John Y.

rol...@logikalsolutions.com

unread,
May 24, 2021, 4:44:06 PMMay 24
to scite-interest
On Monday, May 24, 2021 at 3:18:44 PM UTC-5 John Yeung wrote:
On Mon, May 24, 2021 at 3:22 PM 'rol...@logikalsolutions.com' via
scite-interest <scite-i...@googlegroups.com> wrote:
>
> There has to be a setting for this, but I haven't stumbled into it yet. I thought it would be in the "session" settings but no love.

I actually don't think SciTE has this feature. I would be happy to be
wrong about that!
 
I would really love it too! Notepadqq can mostly do it. Tea has a thing they call CrapBook which is currently the only such buffer handled in that manner.


> Sublime wants me to buy a new license now and I'm once again seeing what my options are for a persistent "note taker" editor that can also double as an actual editor when needed.
>
> Emacs doesn't save buffers.

I would have thought Emacs can, since it seems to do an amazing amount
of things.
 
There might be one of the 32767 Elpa/Melpa add-ons that do this, but Emacs is very explicit in its doc that buffers, named or not, do not get saved. This is why when you click "New" in GUI Emacs you are forced to create a file before the edit window appears.

Have you tried Visual Studio Code? Some consider it "heavy" as it's an
Electron app. But it does persist all buffers, and it obviously can
serve as an actual editor.

Yeah.....but it started as a Microsoft product and unless you download the VSCodium version, comes with a massive amount of "tracker" code to tell Microsoft all about you so they can push ads out and/or otherwise find some way of selling your personal information.


I tried VSCodium for a while, but you had to add a repo for it and it kept failing updates because it was "too busy." I think it is just a couple of guys and a personal Web site so it doesn't have the hardware behind it that a full repo able to handle thousands of simultaneous users would have.


I will say that I'm not sure if the buffers will still be there after
a crash. I haven't experienced a crash in a very long time.

John Y.

Well, crash might have been a bit heavy.

Usually it is because I have the thing minimized and apply updates that need a reboot (Ubuntu) and I reboot without looking to see what is open. Ubuntu 20.04 LTS early on had/has some serious bugs with SSD drives. If you have a bunch of threads performing I/O on SSD, it will encounter a "Deadly Embrace" despite the fact you are reading/writing to different files in every thread. The entire machine will lock up and the drive light will be on.

Admittedly that hasn't happened in the past month and theoretically it could also have been related to BOINC.

When one creates a new buffer in Scite, the SciTE.session file doesn't properly record it for posterity. It would be way cool if there was a .SciTE.cache directory where all of the disconnected buffers were written.

In Scite I have
.SciTEUser.properties open in tab 1. 
fred_notes.txt open in tab 2
SciTEGlobal.properties open in tab 3
Untitled* open in tab 4

roland@roland-HP-EliteDesk-800-G2-SFF:~$ cat .SciTE.session
[code]# SciTE session file

position.left=1920
position.top=0
position.width=1920
position.height=1043
position.maximize=1

mru.1.path=/home/roland/SciTE.properties
mru.2.path=/home/roland/.SciTEUser.properties
mru.3.path=/run/user/1000/gvfs/blah=even-more-blah,share=such-blah/fred_notes.txt
mru.4.path=/usr/share/scite/SciTEGlobal.properties

search.1.findwhat=save
search.2.findwhat=font
search.3.findwhat=session

buffer.1.path=/home/roland/.SciTEUser.properties
buffer.1.position=1405
buffer.1.scroll=0

buffer.2.path=/run/user/1000/gvfs/blah=even-more-blah,share=such-blah/fred_notes.txt
buffer.2.position=1
buffer.2.scroll=0

buffer.3.path=/usr/share/scite/SciTEGlobal.properties
buffer.3.position=4231
buffer.3.scroll=135
roland@roland-HP-EliteDesk-800-G2-SFF:~$
[/code]

I'm thinking (and I've been warned about thinking before) that if .SciTEUser.cache existed as a directory, File->New would create a tab named Untitled but an actual file in SciTEUser.cache of Untitled-some-GUID then the session information could be accurate and persistent buffers would automagically be saved/restored.

Neil Hodgson

unread,
May 24, 2021, 5:59:44 PMMay 24
to scite-interest
rol…@logikalsolutions:

> I'm looking for a setting that will preserve unsaved unnamed note files across sessions. I used to use Sublime for this kind of note taking because things would still be there if something caused a crash.

SciTE doesn’t support this. One complicating factor is that multiple instances of SciTE can be used at one time. Any design to save untitled buffers would have to act sensibly when a second instance is started or stopped.

Should be an option so you can set up an instance as a note taker and others as not or provide different directories for different instances.

> File->New would create a tab named Untitled but an actual file in SciTEUser.cache of Untitled-some-GUID then the session information could be accurate and persistent buffers would automagically be saved/restored.

GUIDs are ugly. Its likely users will handle Untitled-23 better.

Neil

rol...@logikalsolutions.com

unread,
May 24, 2021, 7:26:25 PMMay 24
to scite-interest
On Monday, May 24, 2021 at 4:59:44 PM UTC-5 Neil Hodgson wrote:
rol…@logikalsolutions:

> I'm looking for a setting that will preserve unsaved unnamed note files across sessions. I used to use Sublime for this kind of note taking because things would still be there if something caused a crash.

SciTE doesn’t support this. One complicating factor is that multiple instances of SciTE can be used at one time. Any design to save untitled buffers would have to act sensibly when a second instance is started or stopped.

Here's a really stupid question then.

When there are N instances running, which one wins when it comes to SciTEUser.session? In particular, if you have things set to reload previous session, say you have 3 open sessions, close them all, which one "should" be restored? Which one will be written to that file?

Yes, I could try this myself, but I'm just continuing the line of thought because it had to have been dealt with for this. My gut tells me it is probably last one in wins.


Should be an option so you can set up an instance as a note taker and others as not or provide different directories for different instances.

> File->New would create a tab named Untitled but an actual file in SciTEUser.cache of Untitled-some-GUID then the session information could be accurate and persistent buffers would automagically be saved/restored.

GUIDs are ugly. Its likely users will handle Untitled-23 better.

Possibly, but you have the same issue or at least a similar issue. One would have to sort the file names and increment the number. You couldn't keep track of it in the running executable because there could be N instances running. Name collision would be a problem.

Ordinarily I try to use a full date timestamp but the x86-wanna-be-a-real-computer-some-day doesn't generally have enough timestamp precision. Some have been trying to work around it.


I must admit to not having dabbled with this: https://www.cplusplus.com/reference/chrono/high_resolution_clock/now/

Too much time spent with Qt.


Untitled-20210525-182534001.txt

One still has to deal with happy-click because someone could double click new.



Neil Hodgson

unread,
May 26, 2021, 9:41:06 PMMay 26
to scite-i...@googlegroups.com
'rol...@logikalsolutions.com’:

> When there are N instances running, which one wins when it comes to SciTEUser.session? In particular, if you have things set to reload previous session, say you have 3 open sessions, close them all, which one "should" be restored? Which one will be written to that file?

Yes, it doesn’t work how I thought it did. The session name from -loadsession is remembered in $(SessionPath) but its reset to the default at shutdown so they’re all writing to a single global session file.

> Should be an option so you can set up an instance as a note taker and others as not or provide different directories for different instances.

It would likely work to start more isolated SciTEs with batch files that set one of the env vars SciTE_USERHOME / SciTE_HOME / USERPROFILE first.

Neil

Reply all
Reply to author
Forward
0 new messages