From 63c88b9616a7d9f25ee1d466fbdd74792dec9a37 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 7 Mar 2015 19:00:46 +0100 Subject: changed save point file format to .teco--~ * It is no longer possible to accidentally open save point files of the same or another SciTECO instance when typing something like EB*.cpp$ * The use of a trailing ~ is common among editors. These files will be recognized more easily as temporary by users. * People will often already have VCS ignore rules for files with trailing tilde. Therefore SciTECO savepoints will often be already ignored by VCS. * Since they still have a unique ".teco" prefix, they will not be confused by other programs as backup files. * Also mention in sciteco(1) that save point files are hidden on Windows. --- doc/sciteco.1.in | 6 ++++-- src/ioview.cpp | 2 +- src/ring.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/sciteco.1.in b/doc/sciteco.1.in index 7e3b0c3..6bc0f98 100644 --- a/doc/sciteco.1.in +++ b/doc/sciteco.1.in @@ -183,10 +183,12 @@ and opening files specified on the command line. .B $SCITECOPATH/*.tes Standard library macros. .TP -.BI .teco- x - filename +.BI .teco- n - filename ~ Save point files created by \*(ST when saving files during interactive execution have this format. -These files can be ignored by version control systems, etc. +On Windows, these files have the hidden attribute set. +Savepoint files are temporary and should be ignored by version +control systems, etc. .TP .B $SCITECOCONFIG/.teco_session Macro storing the default buffer session. diff --git a/src/ioview.cpp b/src/ioview.cpp index 2d368ed..b663fcf 100644 --- a/src/ioview.cpp +++ b/src/ioview.cpp @@ -213,7 +213,7 @@ make_savepoint(const gchar *filename) basename = g_path_get_basename(filename); g_snprintf(savepoint_basename, sizeof(savepoint_basename), - ".teco-%d-%s", savepoint_id, basename); + ".teco-%d-%s~", savepoint_id, basename); g_free(basename); dirname = g_path_get_dirname(filename); savepoint = g_build_filename(dirname, savepoint_basename, NIL); diff --git a/src/ring.cpp b/src/ring.cpp index c7c145a..c3fec3f 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -403,7 +403,7 @@ StateEditFile::done(const gchar *str) * save point files. * It does not merely overwrite existing files when saving * but moves them to save point files instead. - * Save point files are called \(lq.teco-\fIn\fP-\fIfilename\fP\(rq, + * Save point files are called \(lq.teco-\fIn\fP-\fIfilename\fP~\(rq, * where is the name of the saved file and is * a number that is increased with every save operation. * Save point files are always created in the same directory @@ -411,7 +411,7 @@ StateEditFile::done(const gchar *str) * on disk is necessary but only a rename of the file. * When rubbing out the EW command, \*(ST restores the latest * save point file by moving (renaming) it back to its - * original path - also not requiring any on-disk copying. + * original path \(em also not requiring any on-disk copying. * \*(ST is impossible to crash, but just in case it still * does it may leave behind these save point files which * must be manually deleted by the user. -- cgit v1.2.3