From f13707fd1defa4129b26c8921dd1709682c439a5 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 3 Sep 2016 21:02:26 +0200 Subject: [PATCH] history: slate the search-history migration for removal --- doc/faq.html | 7 +++---- src/files.c | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/faq.html b/doc/faq.html index 0b9508e4..c5a6f220 100644 --- a/doc/faq.html +++ b/doc/faq.html @@ -214,10 +214,9 @@

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?

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.

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!

-

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:
-

mv ~/.nano/search_history ~/.nano_history
- ln -sf ~/.nano_history ~/.nano/search_history

-

+

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:
+

ln -sf ~/.nano/search_history ~/.nano_history

+

The "migration service" (moving the search-history file to its new location) will be deleted from nano in early 2018.


5. Internationalization

5.1. There's no translation for my language!

diff --git a/src/files.c b/src/files.c index 37533e79..165aa11b 100644 --- a/src/files.c +++ b/src/files.c @@ -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"