Updating some comments to match the current state of affairs.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4986 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-06-19 13:08:23 +00:00
parent e7c690d577
commit d840302f28
2 changed files with 16 additions and 15 deletions

View File

@ -1,6 +1,7 @@
2014-06-19 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()'
for consistency, and tweak the related comments.
* src/files.c: Update some comments to match the current status.
2014-06-18 Benno Schulenberg <bensberg@justemail.net>
* src/text.c: Rename 'to_end' to 'to_eof', to lessen confusion

View File

@ -2965,21 +2965,22 @@ int check_dotnano(void)
return 1;
}
/* Load histories from ~/.nano_history. */
/* Load the search and replace histories from ~/.nano/search_history. */
void load_history(void)
{
char *nanohist = histfilename();
char *legacyhist = legacyhistfilename();
struct stat hstat;
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\nto the preferred location (%s) but encountered an error: %s"),
legacyhist, nanohist, strerror(errno));
history_error(N_("Detected a legacy nano history file (%s) which I tried to move\n"
"to the preferred location (%s) but encountered an error: %s"),
legacyhist, nanohist, strerror(errno));
else
history_error(N_("Detected a legacy nano history file (%s) which I moved\nto the preferred location (%s)\n(see the nano FAQ about this change)"),
legacyhist, nanohist);
history_error(N_("Detected a legacy nano history file (%s) which I moved\n"
"to the preferred location (%s)\n(see the nano FAQ about this change)"),
legacyhist, nanohist);
}
/* Assume do_rcfile() has reported a missing home directory. */
@ -3046,7 +3047,7 @@ bool writehist(FILE *hist, filestruct *h)
return TRUE;
}
/* Save histories to ~/.nano/search_history. */
/* Save the search and replace histories to ~/.nano/search_history. */
void save_history(void)
{
char *nanohist;
@ -3081,7 +3082,7 @@ void save_history(void)
}
}
/* Analogs for the POS history. */
/* Save the recorded last file positions to ~/.nano/filepos_history. */
void save_poshistory(void)
{
char *poshist;
@ -3116,8 +3117,8 @@ void save_poshistory(void)
}
}
/* Update the POS history, given a filename line and column. If no
* entry is found, add a new entry on the end. */
/* Update the recorded last file positions, given a filename, a line
* and a column. If no entry is found, add a new one at the end. */
void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
{
poshiststruct *posptr, *posprev = NULL;
@ -3150,10 +3151,9 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
free(fullpath);
}
/* Check the POS history to see if file matches an existing entry. If
* so, return 1 and set line and column to the right values. Otherwise,
* return 0. */
/* Check the recorded last file positions to see if the given file
* matches an existing entry. If so, return 1 and set line and column
* to the retrieved values. Otherwise, return 0. */
int check_poshistory(const char *file, ssize_t *line, ssize_t *column)
{
poshiststruct *posptr;
@ -3174,7 +3174,7 @@ int check_poshistory(const char *file, ssize_t *line, ssize_t *column)
return 0;
}
/* Load histories from ~/.nano_history. */
/* Load the recorded file positions from ~/.nano/filepos_history. */
void load_poshistory(void)
{
char *nanohist = poshistfilename();