From a62fbd9628435c9ad00b56984daf0ee9af56d5d7 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Mon, 23 Jun 2014 23:00:19 +0400 Subject: [PATCH] remove unnecessary menu item. Menu 'Sort' is no longer needed. Signed-off-by: Ilia Maslakov --- src/editor/edit-impl.h | 1 - src/editor/edit.c | 3 -- src/editor/editcmd.c | 71 ------------------------------------------ src/editor/editmenu.c | 1 - 4 files changed, 76 deletions(-) diff --git a/src/editor/edit-impl.h b/src/editor/edit-impl.h index e9ded220c..553bb507f 100644 --- a/src/editor/edit-impl.h +++ b/src/editor/edit-impl.h @@ -240,7 +240,6 @@ void edit_toggle_fullscreen (WEdit * edit); void edit_move_to_line (WEdit * e, long line); void edit_move_display (WEdit * e, long line); void edit_word_wrap (WEdit * edit); -int edit_sort_cmd (WEdit * edit); int edit_ext_cmd (WEdit * edit); int edit_store_macro_cmd (WEdit * edit); diff --git a/src/editor/edit.c b/src/editor/edit.c index 6200b34d0..6980448ac 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -3827,9 +3827,6 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_UserMenu: user_menu (edit, NULL, -1); break; - case CK_Sort: - edit_sort_cmd (edit); - break; case CK_ExternalCommand: edit_ext_cmd (edit); break; diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index ebd9e9c57..bb9b86752 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -3060,77 +3060,6 @@ edit_insert_file_cmd (WEdit * edit) return ret; } -/* --------------------------------------------------------------------------------------------- */ -/** sorts a block, returns -1 on system fail, 1 on cancel and 0 on success */ - -int -edit_sort_cmd (WEdit * edit) -{ - static char *old = 0; - char *exp, *tmp, *tmp_edit_block_name, *tmp_edit_temp_name; - off_t start_mark, end_mark; - int e; - - if (!eval_marks (edit, &start_mark, &end_mark)) - { - edit_error_dialog (_("Sort block"), _("You must first highlight a block of text")); - return 0; - } - - tmp = mc_config_get_full_path (EDIT_BLOCK_FILE); - edit_save_block (edit, tmp, start_mark, end_mark); - g_free (tmp); - - exp = input_dialog (_("Run sort"), - _("Enter sort options (see manpage) separated by whitespace:"), - MC_HISTORY_EDIT_SORT, (old != NULL) ? old : "", INPUT_COMPLETE_NONE); - - if (!exp) - return 1; - g_free (old); - old = exp; - tmp_edit_block_name = mc_config_get_full_path (EDIT_BLOCK_FILE); - tmp_edit_temp_name = mc_config_get_full_path (EDIT_TEMP_FILE); - tmp = - g_strconcat (" sort ", exp, " ", tmp_edit_block_name, - " > ", tmp_edit_temp_name, (char *) NULL); - g_free (tmp_edit_temp_name); - g_free (tmp_edit_block_name); - - e = system (tmp); - g_free (tmp); - if (e) - { - if (e == -1 || e == 127) - { - edit_error_dialog (_("Sort"), get_sys_error (_("Cannot execute sort command"))); - } - else - { - char q[8]; - sprintf (q, "%d ", e); - tmp = g_strdup_printf (_("Sort returned non-zero: %s"), q); - edit_error_dialog (_("Sort"), tmp); - g_free (tmp); - } - return -1; - } - - edit->force |= REDRAW_COMPLETELY; - - if (edit_block_delete_cmd (edit)) - return 1; - - { - vfs_path_t *tmp_vpath; - - tmp_vpath = mc_config_get_full_vpath (EDIT_TEMP_FILE); - edit_insert_file (edit, tmp_vpath); - vfs_path_free (tmp_vpath); - } - return 0; -} - /* --------------------------------------------------------------------------------------------- */ /** * Ask user for a command, execute it and paste its output back to the diff --git a/src/editor/editmenu.c b/src/editor/editmenu.c index a5a4f6102..37ab6c571 100644 --- a/src/editor/editmenu.c +++ b/src/editor/editmenu.c @@ -208,7 +208,6 @@ create_format_menu (void) entries = g_list_prepend (entries, menu_separator_create ()); entries = g_list_prepend (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat)); - entries = g_list_prepend (entries, menu_entry_create (_("&Sort..."), CK_Sort)); entries = g_list_prepend (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand)); entries =