diff -Naur mc-4.6.1/configure.ac mc-4.6.1-prn/configure.ac --- mc-4.6.1/configure.ac 2005-07-23 19:52:49.000000000 +0300 +++ mc-4.6.1-prn/configure.ac 2005-10-04 12:17:08.000000000 +0300 @@ -531,6 +531,19 @@ dnl +dnl Printing support +dnl +AC_ARG_ENABLE([print], + [ --enable-print Support for file and block printing [[no]]]) +have_print= +print_msg="no" +if test "x$enable_print" = xyes; then + AC_DEFINE(HAVE_PRINT, 1, [Define to enable printing support]) + have_print=yes + print_msg="yes" +fi + +dnl dnl User visible support for charset conversion. dnl AC_ARG_ENABLE([charset], diff -Naur mc-4.6.1/edit/edit.c mc-4.6.1-prn/edit/edit.c --- mc-4.6.1/edit/edit.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/edit/edit.c 2005-10-04 12:17:08.000000000 +0300 @@ -2359,6 +2359,11 @@ } else check_and_wrap_line (edit); break; +#ifdef HAVE_PRINT + case CK_Print_Block: + edit_print_block_cmd (edit); + break; +#endif case CK_Toggle_Insert: edit->overwrite = (edit->overwrite == 0); diff -Naur mc-4.6.1/edit/editcmd.c mc-4.6.1-prn/edit/editcmd.c --- mc-4.6.1/edit/editcmd.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/edit/editcmd.c 2005-10-04 12:17:08.000000000 +0300 @@ -41,6 +41,9 @@ #include "../src/dialog.h" /* do_refresh() */ #include "../src/wtools.h" /* message() */ #include "../src/charsets.h" +#ifdef HAVE_PRINT +#include "../src/dlg_prn.h" +#endif #define edit_get_load_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) #define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) @@ -928,6 +931,40 @@ edit_cursor_move (edit, cursor - edit->curs1); } +#ifdef HAVE_PRINT +/* Return 1 on success */ +int +edit_print_block_cmd (WEdit *edit) +{ + long start_mark, end_mark; + char *exp; + + if (eval_marks (edit, &start_mark, &end_mark)) + return 1; + + if (show_print_dlg( )) + return 1; + + exp = catstrs (home_dir, PRN_FILE, 0); + edit_push_action (edit, KEY_PRESS + edit->start_display); + if (exp) { + if (!*exp) + return 0; + else { + if (edit_save_block (edit, exp, start_mark, end_mark)) { + print_file(exp); + edit->force |= REDRAW_COMPLETELY; + return 1; + } else { + edit_error_dialog (_("Print Block"), + get_sys_error ( _("Can't save print file.") )); + } + } + } + edit->force |= REDRAW_COMPLETELY; + return 0; +} +#endif /* HAVE_PRINT */ void edit_block_copy_cmd (WEdit *edit) diff -Naur mc-4.6.1/edit/editcmddef.h mc-4.6.1-prn/edit/editcmddef.h --- mc-4.6.1/edit/editcmddef.h 2004-08-15 22:34:37.000000000 +0300 +++ mc-4.6.1-prn/edit/editcmddef.h 2005-10-04 12:17:08.000000000 +0300 @@ -51,6 +51,7 @@ #define CK_Unmark 206 #define CK_Save_Block 207 #define CK_Column_Mark 208 +#define CK_Print_Block 209 /* search and replace */ #define CK_Find 301 diff -Naur mc-4.6.1/edit/edit.h mc-4.6.1-prn/edit/edit.h --- mc-4.6.1/edit/edit.h 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/edit/edit.h 2005-10-04 12:17:08.000000000 +0300 @@ -203,6 +203,9 @@ int edit_save_block_cmd (WEdit * edit); int edit_insert_file_cmd (WEdit * edit); int edit_insert_file (WEdit * edit, const char *filename); +#ifdef HAVE_PRINT +int edit_print_block_cmd (WEdit * edit); +#endif void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block); char *catstrs (const char *first, ...); void freestrs (void); @@ -331,5 +334,6 @@ #define MACRO_FILE EDIT_DIR PATH_SEP_STR "cooledit.macros" #define BLOCK_FILE EDIT_DIR PATH_SEP_STR "cooledit.block" #define TEMP_FILE EDIT_DIR PATH_SEP_STR "cooledit.temp" +#define PRN_FILE EDIT_DIR PATH_SEP_STR "cooledit.prn" #endif /* __EDIT_H */ diff -Naur mc-4.6.1/edit/editkeys.c mc-4.6.1-prn/edit/editkeys.c --- mc-4.6.1/edit/editkeys.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/edit/editkeys.c 2005-10-04 12:17:08.000000000 +0300 @@ -114,6 +114,9 @@ KEY_F (14), CK_Replace_Again, KEY_F (15), CK_Insert_File, KEY_F (17), CK_Find_Again, +#ifdef HAVE_PRINT + KEY_F (18), CK_Print_Block, +#endif KEY_F (19), CK_Pipe_Block (0), /* C formatter */ /* Shift */ diff -Naur mc-4.6.1/edit/editmenu.c mc-4.6.1-prn/edit/editmenu.c --- mc-4.6.1/edit/editmenu.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/edit/editmenu.c 2005-10-04 12:17:08.000000000 +0300 @@ -147,6 +147,14 @@ menu_cmd (CK_Save_Block); } +#ifdef HAVE_PRINT +static void +menu_prn_cmd (void) +{ + menu_cmd (CK_Print_Block); +} +#endif + static void menu_search_cmd (void) { @@ -288,6 +296,9 @@ {' ', "", ' ', 0}, {' ', N_("&Insert file... F15"), 'I', menu_insert_file_cmd}, {' ', N_("Copy to &file... C-f"), 'F', menu_cut_cmd}, +#ifdef HAVE_PRINT + {' ', N_("&Print block F18"), 'P', menu_prn_cmd}, +#endif {' ', "", ' ', 0}, {' ', N_("&User menu... F11"), 'U', menu_user_menu_cmd}, {' ', "", ' ', 0}, @@ -306,6 +317,9 @@ {' ', "", ' ', 0}, {' ', N_("&Insert file... F15"), 'I', menu_insert_file_cmd}, {' ', N_("Copy to &file... "), 'F', menu_cut_cmd}, +#ifdef HAVE_PRINT + {' ', N_("&Print block F18"), 'P', menu_prn_cmd}, +#endif {' ', "", ' ', 0}, {' ', N_("&User menu... F11"), 'U', menu_user_menu_cmd}, {' ', "", ' ', 0}, diff -Naur mc-4.6.1/src/cmd.c mc-4.6.1-prn/src/cmd.c --- mc-4.6.1/src/cmd.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/src/cmd.c 2005-10-04 12:17:08.000000000 +0300 @@ -345,6 +345,16 @@ } } +#ifdef HAVE_PRINT +void +print_cmd (void) +{ + save_cwds_stat (); + print_sel_files (current_panel); + repaint_screen (); +} +#endif + void mkdir_cmd (void) { @@ -386,6 +396,7 @@ } } +#ifndef HAVE_PRINT /* Invoked by F18. Remove selected file, regardless of marked files. */ void delete_cmd_local (void) { @@ -396,6 +407,7 @@ repaint_screen (); } } +#endif void find_cmd (void) { diff -Naur mc-4.6.1/src/cmd.h mc-4.6.1-prn/src/cmd.h --- mc-4.6.1/src/cmd.h 2004-08-29 19:43:04.000000000 +0300 +++ mc-4.6.1-prn/src/cmd.h 2005-10-04 12:17:08.000000000 +0300 @@ -22,7 +22,11 @@ void ren_cmd (void); void copy_cmd_local (void); void ren_cmd_local (void); +#ifdef HAVE_PRINT +void print_cmd (void); +#else void delete_cmd_local (void); +#endif void reselect_vfs (void); void mkdir_cmd (void); void delete_cmd (void); diff -Naur mc-4.6.1/src/dlg_prn.c mc-4.6.1-prn/src/dlg_prn.c --- mc-4.6.1/src/dlg_prn.c 1970-01-01 03:00:00.000000000 +0300 +++ mc-4.6.1-prn/src/dlg_prn.c 2005-10-04 12:36:39.000000000 +0300 @@ -0,0 +1,313 @@ +/* Print dialog module for the Midnight Commander + Copyright (C) 2005 Likhota Vadim + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + /* + 2005 09 small fix add a2ps + 2005 06 orig + */ + +#include + +#ifdef HAVE_PRINT + +#include +#include + +#include "global.h" +#include "tty.h" +#include "execute.h" +#include "color.h" +#include "widget.h" +#include "wtools.h" + +#ifdef HAVE_CHARSET +#include "charsets.h" +#endif + +#include "dlg_prn.h" + +#define TEMP_BUF_LEN 1024 + +#define DLG_PRN_H 11 +#define DLG_PRN_W 72 + +static char printer[32] = N_("default printer"); +static char codepgf[32] = N_("default charset"); +static char codepgt[32] = N_("default charset"); +static int nprinter = 0, ncodepgf = 0, ncodepgt = 0; +static int sel_pln = 1, sel_prn = 0, sel_enc = 0; +static WCheck *check_pln, *check_prn, *check_enc; +static WButton *but_prn, *but_en1, *but_en2; + +static void +prn_enter (Dlg_head * h, const int f_pos) +{ + Dlg_head *chl_dlg = 0; + WListbox *chl_list; + int prnbox = ( f_pos == 2 ? 1 : 0 ); // 1 - printers, 0 - charsets + int lxx = (COLS - DLG_PRN_W) / 2 + (f_pos == 7 ? 50 : 25); + int lyy = (LINES - DLG_PRN_H) / 2 + (prnbox ? 0 : 2 ); + char *title = ( prnbox ? _("printers") : _("charsets") ); + + if ( !(chl_dlg = create_dlg (lyy, lxx, 9, 20, dialog_colors, NULL, + "[print option]", title, DLG_COMPACT))) { + message (1, MSG_ERROR, "Can't create child window."); + return; + } + + if ( !(chl_list = listbox_new (1, 1, 18, 7, NULL))) { + message (1, MSG_ERROR, "Can't create child lisbox."); + destroy_dlg (chl_dlg); + return; + } + + listbox_add_item (chl_list, 0, 0, + (prnbox ? N_("default printer") : N_("default charset")), NULL); + + // read printcap file + if ( prnbox ) { + char *p = PRINTCAP; + char buf[TEMP_BUF_LEN], *bufi; + FILE *f; + + f = (FILE *) fopen (p, "r"); + if (f) { + while ( fgets(buf, TEMP_BUF_LEN - 1, f) ) { + int prflag = 0; + if (*buf != '#') { + bufi = buf; + while ( *bufi != '\0' and (*bufi >= '0' and *bufi <= '9' or + *bufi >= 'A' and *bufi <= 'Z' or *bufi >= 'a' and *bufi <= 'z' or + *bufi == '|' or *bufi == '_') { + if ( *bufi == '|' ) { + *bufi = '\0'; + prflag = 1; + break; + } + else + bufi++; + } + if ( prflag ) { + listbox_add_item (chl_list, 0, 0, buf, NULL); + prflag = 0; + } + } + } + if (fclose (f) > 0) + message (1, MSG_ERROR, "Error while close file: %s.", p); + } else { + message (1, MSG_ERROR, "Can't open file for reading: %s.", p); + destroy_dlg (chl_dlg); + return; + } + } +#ifdef HAVE_CHARSET + else { + int i = 0; + for ( ; i < n_codepages; i++) + listbox_add_item (chl_list, 0, 0, codepages[i].name, NULL); + } +#endif + + add_widget (chl_dlg, chl_list); + + run_dlg (chl_dlg); + + switch (f_pos) { + case 2: + strncpy(printer, chl_list->current->text, 32); + strncpy(but_prn->text, printer, 32); + nprinter = chl_list->pos; + break; + case 5: + strncpy(codepgf, chl_list->current->text, 32); + strncpy(but_en1->text, codepgf, 32); + ncodepgf = chl_list->pos; + break; + case 7: + strncpy(codepgt, chl_list->current->text, 32); + strncpy(but_en2->text, codepgt, 32); + ncodepgt = chl_list->pos; + break; + } + destroy_dlg (chl_dlg); +} + +static cb_ret_t +print_block_callback (struct Dlg_head *h, dlg_msg_t Msg, int Par) +{ + int f_pos = h->current->dlg_id; + + if (Msg == DLG_KEY) { + switch (Par) { + case '\n': + if ( f_pos < 8 ) { + switch (f_pos) { + case 2: + if ( check_prn->state ) + prn_enter (h, f_pos); + break; + case 7: + if ( !strcmp(but_en1->text, N_("default charset")) ) + break; + case 5: + if ( check_enc->state ) + prn_enter (h, f_pos); + break; + } + return MSG_HANDLED; + } + break; + } + } else + return default_dlg_callback (h, Msg, Par); + + return MSG_NOT_HANDLED; +} + +/* Return 0 on success */ +int +show_print_dlg (void) +{ + Dlg_head *prn_dlg; + + prn_dlg = create_dlg (0, 0, DLG_PRN_H, DLG_PRN_W, dialog_colors, print_block_callback, + "[print dlg]", _(" Print options "), DLG_CENTER); + // 0 + add_widget (prn_dlg, check_pln = check_new (DLG_PRN_H - 9, 3, sel_pln, + N_("plain text"))); + // 1 + add_widget (prn_dlg, check_prn = check_new (DLG_PRN_H - 7, 3, sel_prn, + N_("select printer"))); + // 2 + add_widget (prn_dlg, but_prn = button_new(DLG_PRN_H - 7, 25, B_USER+1, NORMAL_BUTTON, + "default_printer_XXXXXXXXXXXXXXX", NULL)); + // 3 + add_widget (prn_dlg, check_enc = check_new (DLG_PRN_H - 5, 3, sel_enc, + N_("encoding"))); + // 4 + add_widget (prn_dlg, label_new (DLG_PRN_H - 5, 20, N_("from"))); + // 5 + add_widget (prn_dlg, but_en1 = button_new(DLG_PRN_H - 5, 25, B_USER+2, NORMAL_BUTTON, + "default_charset_XXXXXXXXXXXXXXX", NULL)); + // 6 + add_widget (prn_dlg, label_new (DLG_PRN_H - 5, 45, N_("to"))); + // 7 + add_widget (prn_dlg, but_en2 = button_new(DLG_PRN_H - 5, 48, B_USER+3, NORMAL_BUTTON, + "default_charset_XXXXXXXXXXXXXXX", NULL)); + // 8 + add_widget (prn_dlg, button_new(DLG_PRN_H - 3, 20, B_ENTER, NORMAL_BUTTON, + N_("Print"), NULL)); + // 9 + add_widget (prn_dlg, button_new(DLG_PRN_H - 3, 40, B_CANCEL, NORMAL_BUTTON, + N_("Cancel"), NULL)); + + strncpy(but_en1->text, codepgf, 32); + strncpy(but_en2->text, codepgt, 32); + strncpy(but_prn->text, printer, 32); + + run_dlg (prn_dlg); + + sel_enc = check_enc->state; + sel_prn = check_prn->state; + sel_pln = check_pln->state; + + if (prn_dlg->ret_value == B_CANCEL) { + destroy_dlg (prn_dlg); + return 1; + } + + destroy_dlg (prn_dlg); + + return 0; +} + +#define CMD_BUF 256 +void +print_file (const char *fname) +{ + char cmd[CMD_BUF]; + char *lpr; + + /* for cyrillic + if (text in koi8-r) lpr -l == a2ps -1m -X koi8-r -B --border=no, + but many matrix printer use cp866 */ + + if ( !sel_pln ) { + lpr = g_strdup("lpr -l"); + +#ifdef HAVE_CHARSET + if ( ncodepgf && ncodepgt) + if ( nprinter ) + snprintf(cmd, CMD_BUF, "iconv -f %s -t %s %s | %s -p %s", + codepages[ncodepgf-1].id, codepages[ncodepgt-1].id, fname, lpr, printer); + else + snprintf(cmd, CMD_BUF, "iconv -f %s -t %s %s | %s", + codepages[ncodepgf-1].id, codepages[ncodepgt-1].id, fname, lpr); + else +#endif + if ( nprinter ) + snprintf(cmd, CMD_BUF, "%s -p %s %s", lpr, printer, fname); + else + snprintf(cmd, CMD_BUF, "%s %s", lpr, fname); + } + else { +#ifdef FIX_a2ps_and_utf8 /* see bottom */ + lpr = g_strdup("a2ps -1m -X utf-8 -f7 -B --border=no"); + +#ifdef HAVE_CHARSET + if ( ncodepgf ) + if ( nprinter ) + snprintf(cmd, CMD_BUF, "iconv -f %s -t utf-8 %s | %s -P %s", + codepages[ncodepgf-1].id, codepages[ncodepgt-1].id, fname, lpr, printer, codepages[ncodepgt-1].id); + else + snprintf(cmd, CMD_BUF, "iconv -f %s -t %s %s | %s -d", + codepages[ncodepgf-1].id, codepages[ncodepgt-1].id, fname, lpr, codepages[ncodepgt-1].id); + else +#endif + if ( nprinter ) + snprintf(cmd, CMD_BUF, "%s -P %s %s", lpr, printer, fname); + else + snprintf(cmd, CMD_BUF, "%s -d %s", lpr, fname); +#else /* not FIX_a2ps_and_utf8 */ + lpr = g_strdup("a2ps -1m -X koi8-r -f8 -B --border=no"); + /* FIXME: ^^^ + my printers (hp dj 845 and hp lj 1010) cann't work with "-X utf-8" or a2ps don't normally support utf-8 */ +#ifdef HAVE_CHARSET + if ( ncodepgf ) + if ( nprinter ) + snprintf(cmd, CMD_BUF, "iconv -f %s -t koi8-r %s | %s -P %s", + codepages[ncodepgf-1].id, fname, lpr, printer); + else + snprintf(cmd, CMD_BUF, "iconv -f %s -t koi8-r %s | %s -d", + codepages[ncodepgf-1].id, fname, lpr); + else +#endif + if ( nprinter ) + snprintf(cmd, CMD_BUF, "%s -P %s %s", lpr, printer, fname); + else + snprintf(cmd, CMD_BUF, "%s -d %s", lpr, fname); +#endif /* FIX_a2ps_and_utf8 */ + } + g_free(lpr); + + shell_execute(cmd, 0); +} +#undef CMD_BUFF + +#endif /* HAVE_PRINT */ diff -Naur mc-4.6.1/src/dlg_prn.h mc-4.6.1-prn/src/dlg_prn.h --- mc-4.6.1/src/dlg_prn.h 1970-01-01 03:00:00.000000000 +0300 +++ mc-4.6.1-prn/src/dlg_prn.h 2005-10-04 12:18:35.000000000 +0300 @@ -0,0 +1,13 @@ +#ifndef __MC_DLG_PRN_H +#define __MC_DLG_PRN_H + +#ifdef HAVE_PRINT + +#define PRINTCAP "/etc/printcap" + +int show_print_dlg (void); +void print_file (const char *fname); + +#endif /* HAVE_PRINT */ + +#endif /* __MC_DLG_PRN_H */ diff -Naur mc-4.6.1/src/file.c mc-4.6.1-prn/src/file.c --- mc-4.6.1/src/file.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/src/file.c 2005-10-04 12:17:08.000000000 +0300 @@ -76,6 +76,10 @@ #include "key.h" #include "../vfs/vfs-impl.h" +#ifdef HAVE_PRINT +#include "dlg_prn.h" +#endif + /* }}} */ int verbose = 1; @@ -2063,6 +2067,56 @@ return 1; } +#ifdef HAVE_PRINT + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +int +print_sel_files (void *cur_panel) +{ + WPanel *panel = cur_panel; + int one_file = (get_current_type () == view_tree) || (panel->marked <= 1); + char full_fname[PATH_MAX]; + + if (get_current_type () == view_listing) + if (!panel->marked && !strcmp (selection (panel)->fname, "..")) { + message (1, MSG_ERROR, _("Can't print \"..\"!")); + return 1; + } + + if (show_print_dlg ()) + return 1; + + if (one_file) { + if (S_ISDIR (panel->dir.list[panel->selected].st.st_mode)) { + message (1, MSG_ERROR, _("Can't print directory!")); + return 1; + } + + snprintf(full_fname, sizeof(full_fname), "%s/%s", panel->cwd, selection (panel)->fname); + print_file(full_fname); + } else { + int i = 0; + for ( ; i < panel->count; i++) { + if (!panel->dir.list[i].f.marked) + continue; + + if (S_ISDIR (panel->dir.list[i].st.st_mode)) + continue; + + snprintf(full_fname, sizeof(full_fname), "%s/%s", panel->cwd, panel->dir.list[i].fname); + print_file(full_fname); + do_file_mark (panel, i, 0); + } + } + + return 0; +} + +#endif /* HAVE_PRINT */ + /* }}} */ /* {{{ Query/status report routines */ diff -Naur mc-4.6.1/src/file.h mc-4.6.1-prn/src/file.h --- mc-4.6.1/src/file.h 2004-08-29 19:50:10.000000000 +0300 +++ mc-4.6.1-prn/src/file.h 2005-10-04 12:17:08.000000000 +0300 @@ -20,6 +20,10 @@ int panel_operate (void *source_panel, FileOperation op, int force_single); +#ifdef HAVE_PRINT +int print_sel_files (void *cur_panel); +#endif + extern int file_op_compute_totals; /* Error reporting routines */ diff -Naur mc-4.6.1/src/main.c mc-4.6.1-prn/src/main.c --- mc-4.6.1/src/main.c 2005-07-23 19:52:02.000000000 +0300 +++ mc-4.6.1-prn/src/main.c 2005-10-04 12:17:08.000000000 +0300 @@ -848,6 +848,9 @@ {' ', N_("&Filtered view M-!"), 'F', filtered_view_cmd}, {' ', N_("&Edit F4"), 'E', edit_cmd}, {' ', N_("&Copy F5"), 'C', copy_cmd}, +#ifdef HAVE_PRINT + {' ', N_("&Print F18"), 'P', print_cmd}, +#endif {' ', N_("c&Hmod C-x c"), 'H', chmod_cmd}, {' ', N_("&Link C-x l"), 'L', link_cmd}, {' ', N_("&SymLink C-x s"), 'S', symlink_cmd}, diff -Naur mc-4.6.1/src/Makefile.am mc-4.6.1-prn/src/Makefile.am --- mc-4.6.1/src/Makefile.am 2005-06-08 15:27:19.000000000 +0300 +++ mc-4.6.1-prn/src/Makefile.am 2005-10-04 12:17:08.000000000 +0300 @@ -46,6 +46,7 @@ chmod.c chmod.h chown.c chown.h cmd.c cmd.h color.c color.h \ command.c command.h complete.c complete.h cons.handler.c \ cons.saver.h dialog.c dialog.h dir.c dir.h \ + dlg_prn.c dlg_prn.h \ eregex.h execute.c execute.h ext.c ext.h file.c filegui.c \ filegui.h file.h filenot.c fileopctx.c fileopctx.h find.c \ find.h findme.c findme.h fs.h \ diff -Naur mc-4.6.1/src/screen.c mc-4.6.1-prn/src/screen.c --- mc-4.6.1/src/screen.c 2005-05-27 17:19:18.000000000 +0300 +++ mc-4.6.1-prn/src/screen.c 2005-10-04 12:17:08.000000000 +0300 @@ -2063,7 +2063,9 @@ static void cmd_edit_new(WPanel *wp) { edit_cmd_new(); } static void cmd_copy_local(WPanel *wp) { copy_cmd_local(); } static void cmd_rename_local(WPanel *wp) { ren_cmd_local(); } +#ifndef HAVE_PRINT static void cmd_delete_local(WPanel *wp) { delete_cmd_local(); } +#endif static void cmd_select(WPanel *wp) { select_cmd(); } static void cmd_unselect(WPanel *wp) { unselect_cmd(); } static void cmd_reverse_selection(WPanel *wp) { reverse_selection_cmd(); } @@ -2108,7 +2110,11 @@ { KEY_F(14), cmd_edit_new }, { KEY_F(15), cmd_copy_local }, { KEY_F(16), cmd_rename_local }, +#ifdef HAVE_PRINT + { KEY_F(18), print_cmd }, +#else { KEY_F(18), cmd_delete_local }, +#endif { ALT('y'), directory_history_prev }, { ALT('u'), directory_history_next }, { ALT('+'), cmd_select },