diff -pubrN w3m/funcname.tab w3m-new/funcname.tab --- w3m/funcname.tab Fri Jan 28 09:10:55 2000 +++ w3m-new/funcname.tab Mon Dec 10 15:01:26 2001 @@ -92,3 +92,4 @@ VIEW_BOOKMARK ldBmark VIEW_IMAGE followI WHEREIS srchfor WRAP_TOGGLE wrapToggle +PRINT_SCREEN printBuffer diff -pubrN w3m/main.c w3m-new/main.c --- w3m/main.c Fri Apr 21 05:45:53 2000 +++ w3m-new/main.c Mon Dec 10 15:11:47 2001 @@ -627,6 +627,30 @@ dump_head(Buffer * buf) } void +printBuffer(void) +{ + FILE *ph; + char *lpr = 0; + int fd_orig, fd_stderr = 2; + + lpr = inputStr("name of printer program: ", ""); + if (lpr != 0 && strlen(lpr) > 0) { + // avoid error messages from printer program + fd_orig = dup(fd_stderr); + close(fd_stderr); + if ((ph = popen(lpr, "w")) == NULL) { + dup2(fd_orig, fd_stderr); + disp_message("can't execute printer program", FALSE); + return; + } + saveBuffer(Currentbuf, ph); + pclose(ph); + } + + displayBuffer(Currentbuf, B_NORMAL); +} + +void nulcmd(void) { /* do nothing */ } diff -pubrN w3m/menu.c w3m-new/menu.c --- w3m/menu.c Fri Apr 21 02:51:59 2000 +++ w3m-new/menu.c Mon Dec 10 15:13:27 2001 @@ -219,6 +219,7 @@ static MenuItem MainMenuItem[] = {MENU_FUNC, "¥½¡¼¥¹¤òɽ¼¨ (v)", NULL, 0, vwSrc, NULL, "vV"}, {MENU_FUNC, "¥½¡¼¥¹¤òÊÔ½¸ (e)", NULL, 0, editBf, NULL, "eE"}, {MENU_FUNC, "¥½¡¼¥¹¤òÊݸ (S)", NULL, 0, svSrc, NULL, "S"}, + {MENU_FUNC, "¥Print Source (p) ", NULL, 0, printBuffer, NULL, "pP"}, {MENU_FUNC, "ºÆÆɤ߹þ¤ß (r)", NULL, 0, reload, NULL, "rR"}, {MENU_NOP, "¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡", NULL, 0, nulcmd, NULL, ""}, {MENU_FUNC, "¥ê¥ó¥¯¤òɽ¼¨ (a)", NULL, 0, followA, NULL, "a"}, @@ -243,6 +244,7 @@ static MenuItem MainMenuItem[] = {MENU_FUNC, " View Source (v) ", NULL, 0, vwSrc, NULL, "vV"}, {MENU_FUNC, " Edit Source (e) ", NULL, 0, editBf, NULL, "eE"}, {MENU_FUNC, " Save Source (S) ", NULL, 0, svSrc, NULL, "S"}, + {MENU_FUNC, " Print Source (p) ", NULL, 0, printBuffer, NULL, "pP"}, {MENU_FUNC, " Reload (r) ", NULL, 0, reload, NULL, "rR"}, {MENU_NOP, " ---------------- ", NULL, 0, nulcmd, NULL, ""}, {MENU_FUNC, " Go Link (a) ", NULL, 0, followA, NULL, "a"}, diff -pubrN w3m/proto.h w3m-new/proto.h --- w3m/proto.h Fri Apr 21 03:47:40 2000 +++ w3m-new/proto.h Mon Dec 10 15:14:52 2001 @@ -73,6 +73,7 @@ extern void curURL(void); extern void vwSrc(void); extern void reload(void); extern void chkURL(void); +extern void printBuffer(void); #ifdef USE_NNTP extern void chkNMID(void); #else