diff --git a/ChangeLog b/ChangeLog
index 0f6f5e69d0380eb8d54fc64eca23eeb81d2b9bd0..a4083d0edaa8d44bcdf45e2ca84f1da417bdb2c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
 	'focusing' when searching only for filenames.
 	* src/browser.c (findnextfile, do_filesearch, do_fileresearch):
 	Greatly simplify the searching for the next matching filename.
+	* src/{browser,files,help,prompt,text,winio}.c: Let the function
+	bottombars() set the global variable 'currmenu' -- the displayed
+	menu must necessarily be the active one.
 
 2015-04-05  Benno Schulenberg  <bensberg@justemail.net>
 	* doc/texinfo/nano.texi: Expand on nano's features, condense the
diff --git a/src/browser.c b/src/browser.c
index 4285395efa45bdcd7f88bb71d3703982bd69a3f7..7b631fff0458599bd5c5d3a8ca0452d27225f638 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -60,7 +60,6 @@ char *do_browser(char *path, DIR *dir)
 
     curs_set(0);
     blank_statusbar();
-    currmenu = MBROWSER;
     bottombars(MBROWSER);
     wnoutrefresh(bottomwin);
 
@@ -197,7 +196,6 @@ char *do_browser(char *path, DIR *dir)
 			browser_refresh, _("Go To Directory"));
 
 	    curs_set(0);
-	    currmenu = MBROWSER;
 	    bottombars(MBROWSER);
 
 	    /* If the directory begins with a newline (i.e. an
@@ -823,7 +821,6 @@ void findnextfile(const char *needle)
  * shortcut list to the browser shortcut list, and displaying it. */
 void filesearch_abort(void)
 {
-    currmenu = MBROWSER;
     bottombars(MBROWSER);
 }
 
diff --git a/src/files.c b/src/files.c
index 65c151befbbb18ddb055edc0f180935c74c43191..dd4b2c55b7c0526cf072d04339b1ee09ba849e1b 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1049,8 +1049,6 @@ void do_insertfile(
     bool right_side_up = FALSE, single_line = FALSE;
 #endif
 
-    currmenu = MINSERTFILE;
-
     while (TRUE) {
 #ifndef NANO_TINY
 	if (execute) {
@@ -2252,8 +2250,6 @@ bool do_writeout(bool exiting)
 #endif
     bool retval = FALSE;
 
-    currmenu = MWRITEFILE;
-
     if (exiting && openfile->filename[0] != '\0' && ISSET(TEMP_FILE)) {
 	retval = write_file(openfile->filename, NULL, FALSE, OVERWRITE,
 		FALSE);
diff --git a/src/help.c b/src/help.c
index 8bda238684cf41a1e9f89aa3e9c58b6a5756be4d..a14fcbc90c4b508c372453f64c67012be2f1b9f5 100644
--- a/src/help.c
+++ b/src/help.c
@@ -62,10 +62,6 @@ void do_help(void (*refresh_func)(void))
 
     assert(help_text != NULL);
 
-    /* Set currmenu to allow clicking on the help screen's shortcut
-     * list, after help_init() is called. */
-    currmenu = MHELP;
-
     if (ISSET(NO_HELP)) {
 	/* Make sure that the help screen's shortcut list will actually
 	 * be displayed. */
@@ -158,15 +154,14 @@ void do_help(void (*refresh_func)(void))
 	}
     }
 
-    currmenu = oldmenu;
-
     if (old_no_help) {
 	blank_bottombars();
 	wnoutrefresh(bottomwin);
+	currmenu = oldmenu;
 	SET(NO_HELP);
 	window_init();
     } else
-	bottombars(currmenu);
+	bottombars(oldmenu);
 
     curs_set(1);
     refresh_func();
diff --git a/src/prompt.c b/src/prompt.c
index 0729dc2f6d7b11f18fff23c074783b8e0bff5fb5..89d0a86c93b80179bf8d792dd3fa2d96102459d7 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -969,7 +969,6 @@ int do_prompt(bool allow_tabs,
 
     prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1);
 
-    currmenu = menu;
     bottombars(menu);
 
     va_start(ap, msg);
diff --git a/src/text.c b/src/text.c
index 14ca49e82a4a836b8f53bed42c90e35ef6fe720d..4b41eaa11c55c18b77fd47d8c9919bce59963441 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2213,7 +2213,6 @@ void do_justify(bool full_justify)
 
     /* Display the shortcut list with UnJustify. */
     uncutfunc->desc = unjust_tag;
-    currmenu = MMAIN;
     display_main_list();
 
     /* Now get a keystroke and see if it's unjustify.  If not, put back
@@ -2914,7 +2913,6 @@ void do_spell(void)
 /* Cleanup things to do after leaving the linter. */
 void lint_cleanup(void)
 {
-    currmenu = MMAIN;
     display_main_list();
 }
 
@@ -3129,7 +3127,6 @@ void do_linter(void)
 	return;
     }
 
-    currmenu = MLINTER;
     bottombars(MLINTER);
     tmplint = NULL;
     curlint = lints;
diff --git a/src/winio.c b/src/winio.c
index 12bc2de8874605b264aa5642d45e07134f76978d..9d6587a42d3ecf1660b191539cbbc7850a9c167c 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2344,6 +2344,9 @@ void bottombars(int menu)
     subnfunc *f;
     const sc *s;
 
+    /* Set the global variable to the given menu. */
+    currmenu = menu;
+
     if (ISSET(NO_HELP))
 	return;