From 995177f2d967c2ec68468308804c84ef0ee23850 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sat, 22 Sep 2001 04:34:23 +0000 Subject: [PATCH] Add Mac toggle Meta-O for Mac format git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@775 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++-- global.c | 11 +++++++---- nano.h | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf015979..db630782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,8 +14,8 @@ CVS code - new code in read_line and write_file. New cmdline flag (-D --dos) to automatically write the file in DOS format, regardless of the original format. - - Mac file writing supported too. Flag -M, --mac. No toggle - as of yet. + - Mac file writing supported too. Flag -M, --mac. Toggle + Meta-O (MacOS? OS-X? =-) - nano.c: main() - Added vars oldcurrent and oldcurrent_x to check whether cursor diff --git a/global.c b/global.c index 4ea47395..b01ef76a 100644 --- a/global.c +++ b/global.c @@ -151,7 +151,7 @@ void toggle_init(void) char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg, *toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg, *toggle_cuttoend_msg, *toggle_wrap_msg, *toggle_case_msg, - *toggle_backwards_msg, *toggle_dos_msg; + *toggle_backwards_msg, *toggle_dos_msg, *toggle_mac_msg; #ifdef ENABLE_MULTIBUFFER char *toggle_load_msg, *nano_openprev_msg, *nano_opennext_msg; @@ -171,6 +171,7 @@ void toggle_init(void) toggle_backwards_msg = _("Backwards Search"); toggle_case_msg = _("Case Sensitive Search"); toggle_dos_msg = _("Writing file in DOS format"); + toggle_mac_msg = _("Writing file in Mac format"); #ifdef HAVE_REGEX_H toggle_regexp_msg = _("Regular expressions"); #endif @@ -204,13 +205,15 @@ void toggle_init(void) CASE_SENSITIVE, 0); toggle_init_one(&toggles[10], TOGGLE_DOS_KEY, toggle_dos_msg, DOS_FILE, 0); + toggle_init_one(&toggles[11], TOGGLE_MAC_KEY, toggle_mac_msg, + MAC_FILE, 0); #ifdef ENABLE_MULTIBUFFER - toggle_init_one(&toggles[11], TOGGLE_LOAD_KEY, toggle_load_msg, + toggle_init_one(&toggles[12], TOGGLE_LOAD_KEY, toggle_load_msg, MULTIBUFFER, 0); - toggle_init_one(&toggles[12], NANO_OPENPREV_KEY, nano_openprev_msg, + toggle_init_one(&toggles[13], NANO_OPENPREV_KEY, nano_openprev_msg, 0, '<'); - toggle_init_one(&toggles[13], NANO_OPENNEXT_KEY, nano_opennext_msg, + toggle_init_one(&toggles[14], NANO_OPENNEXT_KEY, nano_opennext_msg, 0, '>'); #endif diff --git a/nano.h b/nano.h index 1f870293..7bac4000 100644 --- a/nano.h +++ b/nano.h @@ -276,6 +276,7 @@ know what you're doing */ #define TOGGLE_CASE_KEY NANO_ALT_A #define TOGGLE_LOAD_KEY NANO_ALT_F #define TOGGLE_DOS_KEY NANO_ALT_D +#define TOGGLE_MAC_KEY NANO_ALT_O /* Toggle stuff, these static lengths need to go away RSN */ @@ -309,7 +310,7 @@ know what you're doing */ #define WHEREIS_LIST_LEN (8 - NO_REGEX - NO_TOGGLES) #define REPLACE_LIST_LEN (8 - NO_REGEX - NO_TOGGLES) -#define TOGGLE_LEN (12 - NO_REGEX + MULTI_TOGGLES) +#define TOGGLE_LEN (13 - NO_REGEX + MULTI_TOGGLES) #define WRITEFILE_LIST_LEN (3 - NO_BROWSER) #define INSERTFILE_LIST_LEN (2 - NO_BROWSER) #define BROWSER_LIST_LEN 4