From 14ac47517bf1005d1d1d1bc78b31de7f2c851bac Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 3 Aug 2016 12:50:56 +0200
Subject: [PATCH] spelling: don't abort when a misspelled word isn't found,
 just note it

This fixes https://savannah.gnu.org/bugs/?48660 doubly, in case there
are other ways in which 'spell' sees words differently from 'nano'.
---
 src/text.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/text.c b/src/text.c
index dbad310c..06299df2 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2666,14 +2666,15 @@ bool do_int_spell_fix(const char *word)
     /* Find the first whole occurrence of word. */
     result = findnextstr(TRUE, NULL, 0, word, NULL);
 
-    /* The word must exist; if not, something is wrong. */
-    if (result == 0)
-	statusline(ALERT, "Internal error: "
-				"speller listed unfindable word: %s", word);
-    else if (result == 1) {
+    /* If the word isn't found, alert the user; if it is, allow correction. */
+    if (result == 0) {
+	statusline(ALERT, _("Unfindable word: %s"), word);
+	lastmessage = HUSH;
+	proceed = TRUE;
+	napms(2800);
+    } else if (result == 1) {
 	exp_word = display_string(openfile->current->data, xplustabs(),
 					strlenpt(word), FALSE);
-
 	edit_refresh();
 
 	spotlight(TRUE, exp_word);
-- 
GitLab