Placing a help string among its kin, adjusting some indentation,
grouping function pairs more tightly, bundling restricted stuff, and deleting an unused item. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4691 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
cf71578cfd
commit
91ee10a3f9
|
@ -1,5 +1,8 @@
|
||||||
2014-03-27 Benno Schulenberg <bensberg@justemail.net>
|
2014-03-27 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/nano.c (main) - Fix compilation with --disable-utf8.
|
* src/nano.c (main) - Fix compilation with --disable-utf8.
|
||||||
|
* src/global.c (shortcut_init) - Place a help string among
|
||||||
|
its kin, adjust some indentation, group function pairs more
|
||||||
|
tightly, bundle restricted stuff, and delete an unused item.
|
||||||
|
|
||||||
2014-03-27 Mike Frysinger <vapier@gentoo.org>.
|
2014-03-27 Mike Frysinger <vapier@gentoo.org>.
|
||||||
* configure.ac - Make --disable-nanorc with --enable-color barf.
|
* configure.ac - Make --disable-nanorc with --enable-color barf.
|
||||||
|
|
49
src/global.c
49
src/global.c
|
@ -583,8 +583,6 @@ void shortcut_init(bool unjustify)
|
||||||
const char *spell_msg = N_("To Spell");
|
const char *spell_msg = N_("To Spell");
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
const char *lint_msg = N_("To Linter");
|
const char *lint_msg = N_("To Linter");
|
||||||
const char *nano_lint_msg =
|
|
||||||
N_("Invoke the linter, if available");
|
|
||||||
const char *prev_lint_msg = N_("Prev Lint Msg");
|
const char *prev_lint_msg = N_("Prev Lint Msg");
|
||||||
const char *next_lint_msg = N_("Next Lint Msg");
|
const char *next_lint_msg = N_("Next Lint Msg");
|
||||||
#endif
|
#endif
|
||||||
|
@ -738,6 +736,7 @@ void shortcut_init(bool unjustify)
|
||||||
const char *nano_gotodir_msg = N_("Go to directory");
|
const char *nano_gotodir_msg = N_("Go to directory");
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
|
const char *nano_lint_msg = N_("Invoke the linter, if available");
|
||||||
const char *nano_prevlint_msg = N_("Go to previous linter msg");
|
const char *nano_prevlint_msg = N_("Go to previous linter msg");
|
||||||
const char *nano_nextlint_msg = N_("Go to next linter msg");
|
const char *nano_nextlint_msg = N_("Go to next linter msg");
|
||||||
#endif
|
#endif
|
||||||
|
@ -783,7 +782,6 @@ void shortcut_init(bool unjustify)
|
||||||
* restricted mode, inserting files is disabled, since it allows
|
* restricted mode, inserting files is disabled, since it allows
|
||||||
* reading from or writing to files not specified on the command
|
* reading from or writing to files not specified on the command
|
||||||
* line. */
|
* line. */
|
||||||
|
|
||||||
add_to_funcs(do_insertfile_void,
|
add_to_funcs(do_insertfile_void,
|
||||||
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
||||||
MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE,
|
MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE,
|
||||||
|
@ -845,9 +843,9 @@ void shortcut_init(bool unjustify)
|
||||||
* because it allows reading from or writing to files not specified
|
* because it allows reading from or writing to files not specified
|
||||||
* on the command line. */
|
* on the command line. */
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
||||||
add_to_funcs(do_spell, MMAIN, spell_msg, IFSCHELP(nano_spell_msg),
|
add_to_funcs(do_spell, MMAIN, spell_msg, IFSCHELP(nano_spell_msg),
|
||||||
TRUE, NOVIEW);
|
TRUE, NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
|
@ -858,7 +856,6 @@ void shortcut_init(bool unjustify)
|
||||||
add_to_funcs(do_first_line,
|
add_to_funcs(do_first_line,
|
||||||
(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE),
|
(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE),
|
||||||
first_line_msg, IFSCHELP(nano_firstline_msg), FALSE, VIEW);
|
first_line_msg, IFSCHELP(nano_firstline_msg), FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_last_line,
|
add_to_funcs(do_last_line,
|
||||||
(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE),
|
(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE),
|
||||||
last_line_msg, IFSCHELP(nano_lastline_msg), TRUE, VIEW);
|
last_line_msg, IFSCHELP(nano_lastline_msg), TRUE, VIEW);
|
||||||
|
@ -892,14 +889,12 @@ void shortcut_init(bool unjustify)
|
||||||
|
|
||||||
add_to_funcs(do_indent_void, MMAIN, N_("Indent Text"),
|
add_to_funcs(do_indent_void, MMAIN, N_("Indent Text"),
|
||||||
IFSCHELP(nano_indent_msg), FALSE, NOVIEW);
|
IFSCHELP(nano_indent_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
add_to_funcs(do_unindent, MMAIN, N_("Unindent Text"),
|
add_to_funcs(do_unindent, MMAIN, N_("Unindent Text"),
|
||||||
IFSCHELP(nano_unindent_msg), FALSE, NOVIEW);
|
IFSCHELP(nano_unindent_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
if (ISSET(UNDOABLE)) {
|
if (ISSET(UNDOABLE)) {
|
||||||
add_to_funcs(do_undo, MMAIN, N_("Undo"),
|
add_to_funcs(do_undo, MMAIN, N_("Undo"),
|
||||||
IFSCHELP(nano_undo_msg), FALSE, NOVIEW);
|
IFSCHELP(nano_undo_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
add_to_funcs(do_redo, MMAIN, N_("Redo"),
|
add_to_funcs(do_redo, MMAIN, N_("Redo"),
|
||||||
IFSCHELP(nano_redo_msg), TRUE, NOVIEW);
|
IFSCHELP(nano_redo_msg), TRUE, NOVIEW);
|
||||||
}
|
}
|
||||||
|
@ -923,27 +918,23 @@ void shortcut_init(bool unjustify)
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
add_to_funcs(do_prev_word_void, MMAIN, N_("Prev Word"),
|
add_to_funcs(do_prev_word_void, MMAIN, N_("Prev Word"),
|
||||||
IFSCHELP(nano_prevword_msg), FALSE, VIEW);
|
IFSCHELP(nano_prevword_msg), FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_next_word_void, MMAIN, N_("Next Word"),
|
add_to_funcs(do_next_word_void, MMAIN, N_("Next Word"),
|
||||||
IFSCHELP(nano_nextword_msg), FALSE, VIEW);
|
IFSCHELP(nano_nextword_msg), FALSE, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
add_to_funcs(do_up_void, (MMAIN|MHELP|MBROWSER), N_("Prev Line"),
|
add_to_funcs(do_up_void, (MMAIN|MHELP|MBROWSER), N_("Prev Line"),
|
||||||
IFSCHELP(nano_prevline_msg), FALSE, VIEW);
|
IFSCHELP(nano_prevline_msg), FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_down_void, (MMAIN|MHELP|MBROWSER), N_("Next Line"),
|
add_to_funcs(do_down_void, (MMAIN|MHELP|MBROWSER), N_("Next Line"),
|
||||||
IFSCHELP(nano_nextline_msg), TRUE, VIEW);
|
IFSCHELP(nano_nextline_msg), TRUE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_home, MMAIN, N_("Home"), IFSCHELP(nano_home_msg),
|
add_to_funcs(do_home, MMAIN, N_("Home"), IFSCHELP(nano_home_msg),
|
||||||
FALSE, VIEW);
|
FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_end, MMAIN, N_("End"), IFSCHELP(nano_end_msg),
|
add_to_funcs(do_end, MMAIN, N_("End"), IFSCHELP(nano_end_msg),
|
||||||
FALSE, VIEW);
|
FALSE, VIEW);
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifndef DISABLE_JUSTIFY
|
||||||
add_to_funcs(do_para_begin_void, (MMAIN|MWHEREIS), beg_of_par_msg,
|
add_to_funcs(do_para_begin_void, (MMAIN|MWHEREIS), beg_of_par_msg,
|
||||||
IFSCHELP(nano_parabegin_msg), FALSE, VIEW);
|
IFSCHELP(nano_parabegin_msg), FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_para_end_void, (MMAIN|MWHEREIS), end_of_par_msg,
|
add_to_funcs(do_para_end_void, (MMAIN|MWHEREIS), end_of_par_msg,
|
||||||
IFSCHELP(nano_paraend_msg), FALSE, VIEW);
|
IFSCHELP(nano_paraend_msg), FALSE, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
@ -954,7 +945,6 @@ void shortcut_init(bool unjustify)
|
||||||
|
|
||||||
add_to_funcs(do_scroll_up, MMAIN, N_("Scroll Up"),
|
add_to_funcs(do_scroll_up, MMAIN, N_("Scroll Up"),
|
||||||
IFSCHELP(nano_scrollup_msg), FALSE, VIEW);
|
IFSCHELP(nano_scrollup_msg), FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_scroll_down, MMAIN, N_("Scroll Down"),
|
add_to_funcs(do_scroll_down, MMAIN, N_("Scroll Down"),
|
||||||
IFSCHELP(nano_scrolldown_msg), FALSE, VIEW);
|
IFSCHELP(nano_scrolldown_msg), FALSE, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1062,47 +1052,33 @@ void shortcut_init(bool unjustify)
|
||||||
* and fourth are disabled because they allow writing to files not
|
* and fourth are disabled because they allow writing to files not
|
||||||
* specified on the command line, and the fifth is useless since
|
* specified on the command line, and the fifth is useless since
|
||||||
* backups are disabled. */
|
* backups are disabled. */
|
||||||
if (!ISSET(RESTRICTED))
|
if (!ISSET(RESTRICTED)) {
|
||||||
add_to_funcs(dos_format_void, MWRITEFILE,
|
add_to_funcs(dos_format_void, MWRITEFILE,
|
||||||
dos_format_msg, IFSCHELP(nano_dos_msg), FALSE, NOVIEW);
|
dos_format_msg, IFSCHELP(nano_dos_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
if (!ISSET(RESTRICTED))
|
|
||||||
add_to_funcs(mac_format_void, MWRITEFILE,
|
add_to_funcs(mac_format_void, MWRITEFILE,
|
||||||
mac_format_msg, IFSCHELP(nano_mac_msg), FALSE, NOVIEW);
|
mac_format_msg, IFSCHELP(nano_mac_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
if (!ISSET(RESTRICTED))
|
|
||||||
add_to_funcs(append_void, MWRITEFILE,
|
add_to_funcs(append_void, MWRITEFILE,
|
||||||
append_msg, IFSCHELP(nano_append_msg), FALSE, NOVIEW);
|
append_msg, IFSCHELP(nano_append_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
if (!ISSET(RESTRICTED))
|
|
||||||
add_to_funcs(prepend_void, MWRITEFILE,
|
add_to_funcs(prepend_void, MWRITEFILE,
|
||||||
prepend_msg, IFSCHELP(nano_prepend_msg), FALSE, NOVIEW);
|
prepend_msg, IFSCHELP(nano_prepend_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
if (!ISSET(RESTRICTED))
|
|
||||||
add_to_funcs(backup_file_void, MWRITEFILE,
|
add_to_funcs(backup_file_void, MWRITEFILE,
|
||||||
backup_file_msg, IFSCHELP(nano_backup_msg), FALSE, NOVIEW);
|
backup_file_msg, IFSCHELP(nano_backup_msg), FALSE, NOVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
/* If we're using restricted mode, command execution is disabled.
|
/* If we're using restricted mode, file insertion is disabled, and
|
||||||
* It's useless since inserting files is disabled. */
|
* thus command execution and the multibuffer toggle have no place. */
|
||||||
if (!ISSET(RESTRICTED))
|
if (!ISSET(RESTRICTED)) {
|
||||||
add_to_funcs(ext_cmd_void, MINSERTFILE,
|
add_to_funcs(ext_cmd_void, MINSERTFILE,
|
||||||
ext_cmd_msg, IFSCHELP(nano_execute_msg), FALSE, NOVIEW);
|
ext_cmd_msg, IFSCHELP(nano_execute_msg), FALSE, NOVIEW);
|
||||||
|
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
/* If we're using restricted mode, the multibuffer toggle is
|
add_to_funcs(new_buffer_void, MINSERTFILE|MEXTCMD,
|
||||||
* disabled. It's useless since inserting files is disabled. */
|
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
|
||||||
if (!ISSET(RESTRICTED))
|
|
||||||
add_to_funcs(new_buffer_void, MINSERTFILE,
|
|
||||||
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
add_to_funcs(do_insertfile_void, MEXTCMD,
|
|
||||||
insert_file_msg, IFSCHELP(nano_insert_msg), FALSE, VIEW);
|
|
||||||
|
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
|
||||||
add_to_funcs(new_buffer_void, MEXTCMD,
|
|
||||||
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
#ifndef DISABLE_HELP
|
#ifndef DISABLE_HELP
|
||||||
|
@ -1115,7 +1091,6 @@ void shortcut_init(bool unjustify)
|
||||||
#ifndef DISABLE_BROWSER
|
#ifndef DISABLE_BROWSER
|
||||||
add_to_funcs(do_first_file, (MBROWSER|MWHEREISFILE),
|
add_to_funcs(do_first_file, (MBROWSER|MWHEREISFILE),
|
||||||
first_file_msg, IFSCHELP(nano_firstfile_msg), FALSE, VIEW);
|
first_file_msg, IFSCHELP(nano_firstfile_msg), FALSE, VIEW);
|
||||||
|
|
||||||
add_to_funcs(do_last_file, (MBROWSER|MWHEREISFILE),
|
add_to_funcs(do_last_file, (MBROWSER|MWHEREISFILE),
|
||||||
last_file_msg, IFSCHELP(nano_lastfile_msg), FALSE, VIEW);
|
last_file_msg, IFSCHELP(nano_lastfile_msg), FALSE, VIEW);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue