Changeset 1640:89a63d6c0d6f

Show
Ignore:
Timestamp:
2000-03-16 02:01:43 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Add the $print_decode option.

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • commands.c

    r1601 r1640  
    233233} 
    234234 
     235static void pipe_print_set_flags (int decode, int *cmflags, int *chflags) 
     236{ 
     237  if (decode) 
     238  { 
     239    *cmflags |= M_CM_DECODE | M_CM_CHARCONV; 
     240    *chflags |= CH_DECODE | CH_REORDER; 
     241     
     242    if (option (OPTWEED)) 
     243    { 
     244      *chflags |= CH_WEED; 
     245      *cmflags |= M_CM_WEED; 
     246    } 
     247  } 
     248} 
     249 
    235250void mutt_pipe_message_to_state (HEADER *h, STATE *s) 
    236251{ 
     
    238253  int chflags = CH_FROM; 
    239254   
    240   if (option (OPTPIPEDECODE)) 
    241   { 
    242     cmflags |= M_CM_DECODE | M_CM_CHARCONV; 
    243     chflags |= CH_DECODE | CH_REORDER; 
    244      
    245     if (option (OPTWEED)) 
    246     { 
    247       chflags |= CH_WEED; 
    248       cmflags |= M_CM_WEED; 
    249     } 
    250   } 
     255  pipe_print_set_flags (option (OPTPIPEDECODE), &cmflags, &chflags); 
    251256   
    252257  if (option (OPTPIPEDECODE)) 
     
    687692} 
    688693 
     694/* XXX - merge this with mutt_pipe_message_to_state? */ 
     695 
    689696static void print_msg (FILE *fp, CONTEXT *ctx, HEADER *h) 
    690697{ 
    691   int cmflags = M_CM_DECODE | M_CM_CHARCONV; 
    692   int chflags = CH_DECODE | CH_REORDER; 
    693  
    694   if (option (OPTWEED)) 
    695   { 
    696     cmflags |= M_CM_WEED; 
    697     chflags |= CH_WEED; 
    698   } 
    699  
    700 #ifdef HAVE_PGP 
    701   if (h->pgp & PGPENCRYPT) 
     698  int cmflags = 0; 
     699  int chflags = CH_FROM; 
     700 
     701  pipe_print_set_flags (option (OPTPRINTDECODE), &cmflags, &chflags); 
     702 
     703#ifdef HAVE_PGP 
     704  if (option (OPTPRINTDECODE) && (h->pgp & PGPENCRYPT)) 
    702705  { 
    703706    if (!pgp_valid_passphrase ()) 
     
    707710#endif 
    708711 
    709   mutt_parse_mime_message (ctx, h); 
     712  if (option (OPTPRINTDECODE)) 
     713    mutt_parse_mime_message (ctx, h); 
     714 
    710715  mutt_copy_message (fp, ctx, h, cmflags, chflags); 
    711716} 
  • init.h

    r1635 r1640  
    14631463  /* 
    14641464  */ 
     1465  { "print_decode",     DT_BOOL, R_NONE, OPTPRINTDECODE, 1 }, 
     1466  /* 
     1467  ** .pp 
     1468  ** Used in connection with the print-message command.  If this 
     1469  ** option is set, the message is decoded before it is passed to the 
     1470  ** external command specified by $$print_command.  If this option 
     1471  ** is unset, no processing will be applied to the message when 
     1472  ** printing it.  The latter setting may be useful if you are using 
     1473  ** some advanced printer filter which is able to properly format 
     1474  ** e-mail messages for printing. 
     1475  */ 
    14651476  { "prompt_after",     DT_BOOL, R_NONE, OPTPROMPTAFTER, 1 }, 
    14661477  /* 
  • mutt.h

    r1601 r1640  
    322322  OPTPOPDELETE, 
    323323  OPTPOPLAST, 
     324  OPTPRINTDECODE, 
    324325  OPTPROMPTAFTER, 
    325326  OPTREADONLY,