Commit f13707fd authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

history: slate the search-history migration for removal

No related merge requests found
Showing with 7 additions and 6 deletions
+7 -6
......@@ -214,10 +214,9 @@
<h2><a name="4.14"></a>4.14. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</h2>
<blockquote><p>You have the autoindent feature turned on. Hit Meta-I to turn it off, paste your text, and then hit Meta-I again to turn it back on.</p></blockquote>
<h2><a name="4.15"></a>4.15. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!</h2>
<blockquote><p>In nano 2.3.0, cursor-position history was introduced, and both history files now reside under a .nano directory in your home. nano was trying to move this file into the new location so it could continue to use it. This means that if you try and use an earlier version of nano, it will be unable to see your current search history. To fix this, run the following commands:<br>
<p><b>mv ~/.nano/search_history ~/.nano_history</b><br>
<b>ln -sf ~/.nano_history ~/.nano/search_history</b></p>
</p></blockquote>
<blockquote><p>In nano 2.3.0, cursor-position history was introduced, and both history files now reside in a .nano subdirectory in your home directory. A newer nano will move an existing search-history file to this new location so it can continue to be used. This means that if you then try and use an earlier version of nano, it will be unable to see your current search history. To fix this, run the following command:<br>
<p><b>ln -sf ~/.nano/search_history ~/.nano_history</b></p>
</p><p>The "migration service" (moving the search-history file to its new location) will be deleted from nano in early 2018.</p></blockquote>
<hr width="100%">
<h1><a name="5"></a>5. Internationalization</h1>
<h2><a name="5.1"></a>5.1. There's no translation for my language!</h2>
......
......@@ -2940,8 +2940,8 @@ char *histfilename(void)
return construct_filename("/.nano/search_history");
}
/* Construct the legacy history filename.
* (Deprecate in 2.5, delete later.) */
/* Construct the legacy history filename. */
/* (To be removed in 2018.) */
char *legacyhistfilename(void)
{
return construct_filename("/.nano_history");
......@@ -3001,6 +3001,8 @@ void load_history(void)
char *legacyhist = legacyhistfilename();
struct stat hstat;
/* If there is an old history file, migrate it. */
/* (To be removed in 2018.) */
if (stat(legacyhist, &hstat) != -1 && stat(nanohist, &hstat) == -1) {
if (rename(legacyhist, nanohist) == -1)
history_error(N_("Detected a legacy nano history file (%s) which I tried to move\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment