From 618051cac731adb854694cde3adde7e98fae48e1 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sat, 26 Apr 2014 20:16:17 +0000
Subject: [PATCH] Group related functions together, remove duplicate
 "up"/"down", and add missing "prevpage"/"nextpage" in nanorc man page.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4818 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog        |   2 +
 doc/man/nanorc.5 | 102 +++++++++++++++++++++++++----------------------
 src/global.c     |  46 ++++++++++-----------
 3 files changed, 77 insertions(+), 73 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b0da21f..e2e228f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
 	help lines show "Close" again when more than one buffer is open.
 	* src/global.c (strtosc), doc/man/nanorc.5: Allow the do_spell
 	(and thus do_lint) function to be bound to other key combos.
+	* src/global.c (strtosc), doc/man/nanorc.5: Group related functions
+	together, remove duplicate up/down, add missing prevpage/nextpage.
 
 2014-04-24  Benno Schulenberg  <bensberg@justemail.net>
 	* doc/faq.html: Update a few URLs, delete some obsolete ones, update
diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5
index 304cb1e8..d739e4a8 100644
--- a/doc/man/nanorc.5
+++ b/doc/man/nanorc.5
@@ -334,9 +334,6 @@ Exit from the program.
 .B writeout
 Write the current buffer to disk.
 .TP
-.B justify
-Justify the current text.
-.TP
 .B insert
 Insert a file into the current buffer (or into a new buffer when multibuffer
 is enabled).
@@ -347,48 +344,36 @@ Search for text in the current buffer.
 .B searchagain
 Repeat the last search command.
 .TP
-.B up
-Move up in the editor or browser.
-.TP
-.B down
-Move down in the editor or browser.
-.TP
-.B left
-Move left in the editor or browser.
-.TP
-.B right
-Move right in the editor or browser.
+.B replace
+Interactively replace text within the current buffer.
 .TP
 .B cut
 Cut the current line of text and store it.
 .TP
+.B copytext
+Copy the currently marked text without deleting it.
+.TP
 .B uncut
 Copy the currently stored text into the current buffer position.
 .TP
+.B mark
+Begin selecting text for cutting at the current position.
+.TP
 .B curpos
 Show the current line, column, word positions in the file.
 .TP
+.B wordcount
+Count the number of words in the current buffer.
+.TP
 .B speller
 Invoke a spell checking program (or a linting program, if the current
 syntax highlighting defines one).
 .TP
-.B firstline
-Move to the first line of the file.
-.TP
-.B lastline
-Move to the last line of the file.
-.TP
-.B gotoline
-Move to a specific line (and column if specified).
-.TP
-.B replace
-Interactively replace text within the current buffer.
-.TP
-.B mark
-Begin selecting text for cutting or pasting at the current position.
+.B justify
+Justify the current text.
 .TP
-.B copytext
-Copy the currently marked text without deleting it.
+.B fulljustify
+Justify the entire current file.
 .TP
 .B indent
 Indent the currently marked text (shift to the right).
@@ -396,6 +381,24 @@ Indent the currently marked text (shift to the right).
 .B unindent
 Un-indent the currently marked text (shift to the left).
 .TP
+.B left
+Go left one position (in the editor or browser).
+.TP
+.B right
+Go right one position (in the editor or browser).
+.TP
+.B up
+Go one line up (in the editor or browser).
+.TP
+.B down
+Go one line down (in the editor or browser).
+.TP
+.B scrollup
+Scroll up one line of text from the current position.
+.TP
+.B scrolldown
+Scroll down one line of text from the current position.
+.TP
 .B nextword
 Move the cursor to the beginning of the next word.
 .TP
@@ -414,16 +417,25 @@ Move the cursor to the beginning of the current paragraph.
 .B endpara
 Move the cursor to the end of the current paragraph.
 .TP
+.B prevpage
+Go one screenful up.
+.TP
+.B nextpage
+Go one screenful down.
+.TP
+.B firstline
+Go to the first line of the file.
+.TP
+.B lastline
+Go to the last line of the file.
+.TP
+.B gotoline
+Move to a specific line (and column if specified).
+.TP
 .B findbracket
 Move the cursor to the matching bracket (brace, parenthesis, etc.) of the one
 under the cursor.
 .TP
-.B scrollup
-Scroll up one line of text from the current position.
-.TP
-.B scrolldown
-Scroll down one line of text from the current position.
-.TP
 .B prevbuf
 Switch to editing/viewing the previous buffer when using multibuffer mode.
 .TP
@@ -442,21 +454,15 @@ Insert a new line below the current one.
 .B delete
 Delete the character under the cursor.
 .TP
-.B fulljustify
-Justify the entire current file.
-.TP
-.B wordcount
-Count the number of words in the current buffer.
-.TP
-.B refresh
-Refresh the screen.
-.TP
 .B undo
 Undo the text action peformed (add text, delete text, etc).
 .TP
 .B redo
 Redo the last undone action (i.e., undo an undo).
 .TP
+.B refresh
+Refresh the screen.
+.TP
 .B suspend
 Suspend the editor (if the suspend function is enabled, see the 
 "suspendenable" entry below).
@@ -518,9 +524,6 @@ Toggle the showing of whitespace.
 .B nosyntax
 Toggle syntax highlighting.
 .TP
-.B softwrap
-Toggle the displaying of overlong lines on multiple screen lines.
-.TP
 .B smarthome
 Toggle whether the smart home key function is enabled.
 .TP
@@ -534,6 +537,9 @@ position to the end of the line.
 .B nowrap
 Toggle whether long lines will be hard-wrapped to the next line.
 .TP
+.B softwrap
+Toggle the displaying of overlong lines on multiple screen lines.
+.TP
 .B tabstospaces
 Toggle whether typed tabs will be converted to spaces.
 .TP
diff --git a/src/global.c b/src/global.c
index 36f0936d..341679f0 100644
--- a/src/global.c
+++ b/src/global.c
@@ -1267,52 +1267,38 @@ sc *strtosc(char *input)
 	s->scfunc = do_insertfile_void;
     else if (!strcasecmp(input, "whereis"))
 	s->scfunc = do_search;
-    else if (!strcasecmp(input, "up"))
-	s->scfunc = do_up_void;
-    else if (!strcasecmp(input, "down"))
-	s->scfunc = do_down_void;
-    else if (!strcasecmp(input, "pageup") ||
-	     !strcasecmp(input, "prevpage"))
-	s->scfunc = do_page_up;
-    else if (!strcasecmp(input, "pagedown") ||
-	     !strcasecmp(input, "nextpage"))
-	s->scfunc = do_page_down;
+    else if (!strcasecmp(input, "searchagain") ||
+	     !strcasecmp(input, "research"))
+	s->scfunc = do_research;
+    else if (!strcasecmp(input, "replace"))
+	s->scfunc = do_replace;
     else if (!strcasecmp(input, "cut"))
 	s->scfunc = do_cut_text_void;
+    else if (!strcasecmp(input, "copytext"))
+	s->scfunc = do_copy_text;
     else if (!strcasecmp(input, "uncut"))
 	s->scfunc = do_uncut_text;
+    else if (!strcasecmp(input, "mark"))
+	s->scfunc = do_mark;
     else if (!strcasecmp(input, "tospell") ||
 	     !strcasecmp(input, "speller"))
 	s->scfunc = do_spell;
     else if (!strcasecmp(input, "curpos") ||
 	     !strcasecmp(input, "cursorpos"))
 	s->scfunc = do_cursorpos_void;
-    else if (!strcasecmp(input, "firstline"))
-	s->scfunc = do_first_line;
-    else if (!strcasecmp(input, "lastline"))
-	s->scfunc = do_last_line;
     else if (!strcasecmp(input, "gotoline"))
 	s->scfunc = do_gotolinecolumn_void;
-    else if (!strcasecmp(input, "replace"))
-	s->scfunc = do_replace;
 #ifndef DISABLE_JUSTIFY
     else if (!strcasecmp(input, "justify"))
 	s->scfunc = do_justify_void;
+    else if (!strcasecmp(input, "fulljustify"))
+	s->scfunc = do_full_justify;
     else if (!strcasecmp(input, "beginpara"))
 	s->scfunc = do_para_begin_void;
     else if (!strcasecmp(input, "endpara"))
 	s->scfunc = do_para_end_void;
-    else if (!strcasecmp(input, "fulljustify"))
-	s->scfunc = do_full_justify;
 #endif
 #ifndef NANO_TINY
-    else if (!strcasecmp(input, "mark"))
-	s->scfunc = do_mark;
-    else if (!strcasecmp(input, "searchagain") ||
-	     !strcasecmp(input, "research"))
-	s->scfunc = do_research;
-    else if (!strcasecmp(input, "copytext"))
-	s->scfunc = do_copy_text;
     else if (!strcasecmp(input, "indent"))
 	s->scfunc = do_indent_void;
     else if (!strcasecmp(input, "unindent"))
@@ -1427,6 +1413,16 @@ sc *strtosc(char *input)
 	s->scfunc = do_home;
     else if (!strcasecmp(input, "end"))
 	s->scfunc = do_end;
+    else if (!strcasecmp(input, "pageup") ||
+	     !strcasecmp(input, "prevpage"))
+	s->scfunc = do_page_up;
+    else if (!strcasecmp(input, "pagedown") ||
+	     !strcasecmp(input, "nextpage"))
+	s->scfunc = do_page_down;
+    else if (!strcasecmp(input, "firstline"))
+	s->scfunc = do_first_line;
+    else if (!strcasecmp(input, "lastline"))
+	s->scfunc = do_last_line;
 #ifndef DISABLE_MULTIBUFFER
     else if (!strcasecmp(input, "prevbuf"))
 	s->scfunc = switch_to_prev_buffer_void;
-- 
GitLab