~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002101854

« back to all changes in this revision

Viewing changes to curs_main.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg, Antonio Radici, Christoph Berg
  • Date: 2009-06-20 15:00:50 UTC
  • mfrom: (16.1.1 sid) (16.2.1 experimental)
  • mto: (2.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090620150050-ta3y92wwef0m5y4t
Tags: 1.5.20-2
[ Antonio Radici ]
* debian/patches/series:
  + upstream/533209-mutt_perror.patch: better error reporting if a mailbox
    cannot be opened (Closes: 533209)
  + upstream/533459-unmailboxes.patch: fixes a segfault with the unmailboxes 
    command (Closes: 533459)
  + upstream/533439-mbox-time.patch: do not corrupt the atime/mtime of 
    mboxes when opened (Closes: 533439)
  + upstream/531430-imapuser.patch: ask the user for the right information
    while logging in on IMAP servers (Closes: 531430)
  + upstream/534543-imap-port.patch: correctly parse the port in an IMAP
    url (Closes: 534543)
  + added the right copyright misc/smime_keys-manpage.patch
  + mutt-patched/sidebar: refreshed
  + mutt-patched/sidebar-{dotted,sorted} added (Closes: 523774)
* debian/control:
  + Debian policy bumped to 3.8.2
* debian/mutt.install and debian/extra/lib/mailto-mutt: 
  + added the firefox mailto handler (Closes: 406850)

[ Christoph Berg ]
* Remove maildir-mtime patch, upstream has a different implementation
  (though with different results; Closes: 533471)
* Use elinks-lite (with an alternative Build-Dependency on elinks) for
  rendering the manual. Thanks to Ahmed El-Mahmoudy for the suggestion.
  (Closes: 533445)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
3
 
 * 
 
2
 * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org>
 
3
 *
4
4
 *     This program is free software; you can redistribute it and/or modify
5
5
 *     it under the terms of the GNU General Public License as published by
6
6
 *     the Free Software Foundation; either version 2 of the License, or
7
7
 *     (at your option) any later version.
8
 
 * 
 
8
 *
9
9
 *     This program is distributed in the hope that it will be useful,
10
10
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
 *     GNU General Public License for more details.
13
 
 * 
 
13
 *
14
14
 *     You should have received a copy of the GNU General Public License
15
15
 *     along with this program; if not, write to the Free Software
16
16
 *     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17
 
 */ 
 
17
 */
18
18
 
19
19
#if HAVE_CONFIG_H
20
20
# include "config.h"
23
23
#include "mutt.h"
24
24
#include "mutt_curses.h"
25
25
#include "mutt_menu.h"
26
 
#include "attach.h"
27
26
#include "mailbox.h"
28
27
#include "mapping.h"
29
28
#include "sort.h"
30
 
#include "buffy.h"
31
29
#include "mx.h"
32
30
 
33
31
#ifdef USE_POP
83
81
                mutt_error _(No_visible); \
84
82
                break; \
85
83
        }
86
 
    
 
84
 
87
85
 
88
86
#define CHECK_READONLY if (Context->readonly) \
89
87
                        { \
274
272
  /* store pointers to the newly added messages */
275
273
  HEADER  **save_new = NULL;
276
274
  int j;
277
 
  
 
275
 
278
276
  /* take note of the current message */
279
277
  if (oldcount)
280
278
  {
283
281
    else
284
282
      oldcount = 0; /* invalid message number! */
285
283
  }
286
 
  
 
284
 
287
285
  /* We are in a limited view. Check if the new message(s) satisfy
288
286
   * the limit criteria. If they do, set their virtual msgno so that
289
287
   * they will be visible in the limited view */
296
294
        ctx->vcount = 0;
297
295
 
298
296
      if (mutt_pattern_exec (ctx->limit_pattern,
299
 
                             M_MATCH_FULL_ADDRESS, 
 
297
                             M_MATCH_FULL_ADDRESS,
300
298
                             ctx, ctx->hdrs[j]))
301
299
      {
302
300
        assert (ctx->vcount < ctx->msgcount);
309
307
    }
310
308
#undef THIS_BODY
311
309
  }
312
 
    
 
310
 
313
311
  /* save the list of new messages */
314
312
  if (oldcount && check != M_REOPENED
315
313
      && ((Sort & SORT_MASK) == SORT_THREADS))
318
316
    for (j = oldcount; j < ctx->msgcount; j++)
319
317
      save_new[j-oldcount] = ctx->hdrs[j];
320
318
  }
321
 
  
 
319
 
322
320
  /* if the mailbox was reopened, need to rethread from scratch */
323
321
  mutt_sort_headers (ctx, (check == M_REOPENED));
324
322
 
328
326
    if (check == M_REOPENED)
329
327
    {
330
328
      THREAD *h, *j;
331
 
      
 
329
 
332
330
      ctx->collapsed = 0;
333
 
      
 
331
 
334
332
      for (h = ctx->tree; h; h = h->next)
335
333
      {
336
334
        for (j = h; !j->message; j = j->child)
344
342
      for (j = 0; j < ctx->msgcount - oldcount; j++)
345
343
      {
346
344
        int k;
347
 
        
 
345
 
348
346
        for (k = 0; k < ctx->msgcount; k++)
349
347
        {
350
348
          HEADER *h = ctx->hdrs[k];
356
354
      mutt_set_virtual (ctx);
357
355
    }
358
356
  }
359
 
  
 
357
 
360
358
  menu->current = -1;
361
359
  if (oldcount)
362
360
  {
370
368
      }
371
369
    }
372
370
  }
373
 
  
 
371
 
374
372
  if (menu->current < 0)
375
373
    menu->current = ci_first_message ();
376
 
  
 
374
 
377
375
}
378
376
 
379
377
static void resort_index (MUTTMENU *menu)
393
391
      break;
394
392
    }
395
393
  }
396
 
  
 
394
 
397
395
  if ((Sort & SORT_MASK) == SORT_THREADS && menu->current < 0)
398
396
    menu->current = mutt_parent_message (Context, current);
399
 
  
 
397
 
400
398
  if (menu->current < 0)
401
399
    menu->current = ci_first_message ();
402
 
  
 
400
 
403
401
  menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
404
402
}
405
403
 
406
 
struct mapping_t IndexHelp[] = {
 
404
static struct mapping_t IndexHelp[] = {
407
405
  { N_("Quit"),  OP_QUIT },
408
406
  { N_("Del"),   OP_DELETE },
409
407
  { N_("Undel"), OP_UNDELETE },
412
410
  { N_("Reply"), OP_REPLY },
413
411
  { N_("Group"), OP_GROUP_REPLY },
414
412
  { N_("Help"),  OP_HELP },
415
 
  { NULL }
 
413
  { NULL,        0 }
416
414
};
417
415
 
418
416
/* This function handles the message index window as well as commands returned
434
432
  int do_buffy_notify = 1;
435
433
  int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */
436
434
  int attach_msg = option(OPTATTACHMSG);
437
 
  
438
 
  menu = mutt_new_menu ();
439
 
  menu->menu = MENU_MAIN;
 
435
 
 
436
  menu = mutt_new_menu (MENU_MAIN);
440
437
  menu->offset = 1;
441
438
  menu->pagelen = LINES - 3;
442
439
  menu->make_entry = index_make_entry;
443
440
  menu->color = index_color;
444
441
  menu->current = ci_first_message ();
445
442
  menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, IndexHelp);
446
 
  
447
 
  if (!attach_msg) 
 
443
 
 
444
  if (!attach_msg)
448
445
    mutt_buffy_check(1); /* force the buffy check after we enter the folder */
449
446
 
450
447
  FOREVER
451
448
  {
452
449
    tag = 0; /* clear the tag-prefix */
453
450
 
454
 
    menu->max = Context ? Context->vcount : 0;
455
 
    oldcount = Context ? Context->msgcount : 0;
456
 
 
457
451
    /* check if we need to resort the index because just about
458
452
     * any 'op' below could do mutt_enter_command(), either here or
459
453
     * from any new menu launched, and change $sort/$sort_aux
460
454
     */
461
 
    if (option (OPTNEEDRESORT) && Context && Context->msgcount)
 
455
    if (option (OPTNEEDRESORT) && Context && Context->msgcount && menu->current >= 0)
462
456
      resort_index (menu);
463
 
    
 
457
 
 
458
    menu->max = Context ? Context->vcount : 0;
 
459
    oldcount = Context ? Context->msgcount : 0;
 
460
 
464
461
    if (option (OPTREDRAWTREE) && Context && Context->msgcount && (Sort & SORT_MASK) == SORT_THREADS)
465
462
    {
466
463
      mutt_draw_tree (Context);
479
476
#ifdef USE_IMAP
480
477
      imap_allow_reopen (Context);
481
478
#endif
482
 
    
 
479
 
483
480
      index_hint = (Context->vcount && menu->current >= 0 && menu->current < Context->vcount) ? CURHDR->index : 0;
484
481
 
485
482
      if ((check = mx_check_mailbox (Context, &index_hint, 0)) < 0)
496
493
      else if (check == M_NEW_MAIL || check == M_REOPENED || check == M_FLAGS)
497
494
      {
498
495
        update_index (menu, Context, check, oldcount, index_hint);
499
 
        
 
496
 
500
497
        /* notify the user of new mail */
501
498
        if (check == M_REOPENED)
502
499
          mutt_error _("Mailbox was externally modified.  Flags may be wrong.");
510
507
 
511
508
        /* avoid the message being overwritten by buffy */
512
509
        do_buffy_notify = 0;
513
 
        
 
510
 
514
511
        menu->redraw = REDRAW_FULL;
515
512
        menu->max = Context->vcount;
516
 
        
 
513
 
517
514
        set_option (OPTSEARCHINVALID);
518
515
      }
519
516
    }
520
517
 
521
 
#ifdef USE_IMAP
522
 
    imap_keepalive ();
523
 
    imap_disallow_reopen (Context);
524
 
#endif
525
 
 
526
518
    if (!attach_msg)
527
519
    {
528
520
     /* check for new mail in the incoming folders */
564
556
          menu_redraw_current (menu);
565
557
      }
566
558
 
567
 
      if (menu->redraw & REDRAW_STATUS) 
 
559
      if (menu->redraw & REDRAW_STATUS)
568
560
      {
569
561
        menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
570
562
        CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
614
606
 
615
607
      if (op == -1)
616
608
        continue; /* either user abort or timeout */
617
 
      
 
609
 
618
610
      mutt_curs_set (1);
619
 
      
 
611
 
620
612
      /* special handling for the tag-prefix function */
621
613
      if (op == OP_TAG_PREFIX)
622
614
      {
690
682
        menu->oldcurrent = menu->current;
691
683
      else
692
684
        menu->oldcurrent = -1;
693
 
      
 
685
 
694
686
      mutt_curs_set (1);        /* fallback from the pager */
695
687
    }
696
688
 
 
689
#ifdef USE_IMAP
 
690
    imap_disallow_reopen (Context);
 
691
#endif
 
692
 
697
693
    switch (op)
698
694
    {
699
695
 
754
750
            || !buf[0])
755
751
          break;
756
752
 
757
 
        if (! isdigit ((unsigned char) buf[0]))
 
753
        if (mutt_atoi (buf, &i) < 0)
758
754
        {
759
755
          mutt_error _("Argument must be a message number.");
760
756
          break;
761
757
        }
762
758
 
763
 
        i = atoi (buf);
764
759
        if (i > 0 && i <= Context->msgcount)
765
760
        {
766
761
          for (j = i-1; j < Context->msgcount; j++)
868
863
        }
869
864
        if (Context->pattern)
870
865
          mutt_message _("To view all messages, limit to \"all\".");
871
 
        break;    
 
866
        break;
872
867
 
873
868
      case OP_QUIT:
874
869
 
882
877
        if (query_quadoption (OPT_QUIT, _("Quit Mutt?")) == M_YES)
883
878
        {
884
879
          int check;
885
 
          
 
880
 
886
881
          oldcount = Context ? Context->msgcount : 0;
887
882
 
888
883
          if (!Context || (check = mx_close_mailbox (Context, &index_hint)) == 0)
997
992
          imap_check_mailbox (Context, &index_hint, 1);
998
993
        break;
999
994
#endif
1000
 
      
 
995
 
1001
996
      case OP_MAIN_SYNC_FOLDER:
1002
997
 
1003
998
        if (Context && !Context->msgcount)
1009
1004
        {
1010
1005
          int oldvcount = Context->vcount;
1011
1006
          int oldcount  = Context->msgcount;
1012
 
          int dcount = 0;
1013
 
          int check;
 
1007
          int check, newidx;
 
1008
          HEADER *newhdr = NULL;
1014
1009
 
1015
 
          /* calculate the number of messages _above_ the cursor,
1016
 
           * so we can keep the cursor on the current message
1017
 
           */ 
1018
 
          for (j = 0; j <= menu->current; j++)
1019
 
          {
1020
 
            if (Context->hdrs[Context->v2r[j]]->deleted)
1021
 
              dcount++;
1022
 
          }
 
1010
          /* threads may be reordered, so figure out what header the cursor
 
1011
           * should be on. #3092 */
 
1012
          newidx = menu->current;
 
1013
          if (CURHDR->deleted)
 
1014
            newidx = ci_next_undeleted (menu->current);
 
1015
          if (newidx < 0)
 
1016
            newidx = ci_previous_undeleted (menu->current);
 
1017
          if (newidx >= 0)
 
1018
            newhdr = Context->hdrs[Context->v2r[newidx]];
1023
1019
 
1024
1020
          if ((check = mx_sync_mailbox (Context, &index_hint)) == 0)
1025
1021
          {
1026
 
            if (Context->vcount != oldvcount)
1027
 
              menu->current -= dcount;
 
1022
            if (newhdr && Context->vcount != oldvcount)
 
1023
              for (j = 0; j < Context->vcount; j++)
 
1024
              {
 
1025
                if (Context->hdrs[Context->v2r[j]] == newhdr)
 
1026
                {
 
1027
                  menu->current = j;
 
1028
                  break;
 
1029
                }
 
1030
              }
1028
1031
            set_option (OPTSEARCHINVALID);
1029
1032
          }
1030
1033
          else if (check == M_NEW_MAIL || check == M_REOPENED)
1031
1034
            update_index (menu, Context, check, oldcount, index_hint);
1032
1035
 
1033
 
          /* 
 
1036
          /*
1034
1037
           * do a sanity check even if mx_sync_mailbox failed.
1035
1038
           */
1036
1039
 
1054
1057
 
1055
1058
      case OP_MAIN_CHANGE_FOLDER:
1056
1059
      case OP_MAIN_NEXT_UNREAD_MAILBOX:
1057
 
      
 
1060
 
1058
1061
        if (attach_msg)
1059
1062
          op = OP_MAIN_CHANGE_FOLDER_READONLY;
1060
1063
 
1071
1074
        if ((op == OP_MAIN_NEXT_UNREAD_MAILBOX) && Context && Context->path)
1072
1075
        {
1073
1076
          strfcpy (buf, Context->path, sizeof (buf));
1074
 
          mutt_pretty_mailbox (buf);
 
1077
          mutt_pretty_mailbox (buf, sizeof (buf));
1075
1078
          mutt_buffy (buf, sizeof (buf));
1076
1079
          if (!buf[0])
1077
1080
          {
1119
1122
          {
1120
1123
            if (check == M_NEW_MAIL || check == M_REOPENED)
1121
1124
              update_index (menu, Context, check, oldcount, index_hint);
1122
 
                
 
1125
 
1123
1126
            set_option (OPTSEARCHINVALID);
1124
1127
            menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
1125
1128
            break;
1128
1131
        }
1129
1132
 
1130
1133
        mutt_sleep (0);
1131
 
      
 
1134
 
1132
1135
        /* Set CurrentMenu to MENU_MAIN before executing any folder
1133
1136
         * hooks so that all the index menu functions are available to
1134
1137
         * the exec command.
1137
1140
        CurrentMenu = MENU_MAIN;
1138
1141
        mutt_folder_hook (buf);
1139
1142
 
1140
 
        if ((Context = mx_open_mailbox (buf, 
 
1143
        if ((Context = mx_open_mailbox (buf,
1141
1144
                                        (option (OPTREADONLY) || op == OP_MAIN_CHANGE_FOLDER_READONLY) ?
1142
1145
                                        M_READONLY : 0, NULL)) != NULL)
1143
1146
        {
1174
1177
          if (option (OPTUNCOLLAPSEJUMP))
1175
1178
            menu->current = mutt_thread_next_unread (Context, CURHDR);
1176
1179
        }
1177
 
 
1178
 
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
 
1180
 
 
1181
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
1179
1182
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
1180
1183
        if ((op = mutt_display_message (CURHDR)) == -1)
1181
1184
        {
1197
1200
        }
1198
1201
 
1199
1202
        if ((menu->menu == MENU_MAIN)
1200
 
            && (query_quadoption (OPT_QUIT, 
 
1203
            && (query_quadoption (OPT_QUIT,
1201
1204
                                  _("Exit Mutt without saving?")) == M_YES))
1202
1205
        {
1203
1206
          if (Context)
1254
1257
          mutt_error _("No Message-ID: header available to link thread");
1255
1258
        else if (!tag && (!Context->last_tag || !Context->last_tag->tagged))
1256
1259
          mutt_error _("First, please tag a message to be linked here");
1257
 
        else 
 
1260
        else
1258
1261
        {
1259
1262
          HEADER *oldcur = CURHDR;
1260
1263
 
1263
1266
          {
1264
1267
            mutt_sort_headers (Context, 1);
1265
1268
            menu->current = oldcur->virtual;
1266
 
            
 
1269
 
1267
1270
            Context->changed = 1;
1268
1271
            mutt_message _("Threads linked");
1269
1272
          }
1388
1391
      case OP_DECRYPT_COPY:
1389
1392
      case OP_DECRYPT_SAVE:
1390
1393
        if (!WithCrypto)
1391
 
          break;   
 
1394
          break;
1392
1395
        /* fall thru */
1393
1396
      case OP_COPY_MESSAGE:
1394
1397
      case OP_SAVE:
1433
1436
      {
1434
1437
        int first_unread = -1;
1435
1438
        int first_new    = -1;
1436
 
        
 
1439
 
1437
1440
        CHECK_MSGCOUNT;
1438
1441
        CHECK_VISIBLE;
1439
1442
 
1441
1444
        menu->current = -1;
1442
1445
        for (j = 0; j != Context->vcount; j++)
1443
1446
        {
1444
 
#define CURHDRi Context->hdrs[Context->v2r[i]] 
 
1447
#define CURHDRi Context->hdrs[Context->v2r[i]]
1445
1448
          if (op == OP_MAIN_NEXT_NEW || op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_NEXT_NEW_THEN_UNREAD)
1446
1449
          {
1447
1450
            i++;
1475
1478
            if ((!CURHDRi->old) && first_new == -1)
1476
1479
              first_new = i;
1477
1480
          }
1478
 
          
 
1481
 
1479
1482
          if ((op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_PREV_UNREAD) &&
1480
1483
              first_unread != -1)
1481
1484
            break;
1486
1489
        }
1487
1490
#undef CURHDRi
1488
1491
        if ((op == OP_MAIN_NEXT_NEW || op == OP_MAIN_PREV_NEW ||
1489
 
             op == OP_MAIN_NEXT_NEW_THEN_UNREAD || op == OP_MAIN_PREV_NEW_THEN_UNREAD) 
 
1492
             op == OP_MAIN_NEXT_NEW_THEN_UNREAD || op == OP_MAIN_PREV_NEW_THEN_UNREAD)
1490
1493
            && first_new != -1)
1491
1494
          menu->current = first_new;
1492
1495
        else if ((op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_PREV_UNREAD ||
1614
1617
          case OP_MAIN_NEXT_SUBTHREAD:
1615
1618
            menu->current = mutt_next_subthread (CURHDR);
1616
1619
            break;
1617
 
            
 
1620
 
1618
1621
          case OP_MAIN_PREV_THREAD:
1619
1622
            menu->current = mutt_previous_thread (CURHDR);
1620
1623
            break;
1696
1699
          mutt_error _("Threading is not enabled.");
1697
1700
          break;
1698
1701
        }
1699
 
      
 
1702
 
1700
1703
        if (CURHDR->collapsed)
1701
1704
        {
1702
1705
          menu->current = mutt_uncollapse_thread (Context, CURHDR);
1733
1736
          HEADER *h, *base;
1734
1737
          THREAD *thread, *top;
1735
1738
          int final;
1736
 
          
 
1739
 
1737
1740
          if (CURHDR->collapsed)
1738
1741
            final = mutt_uncollapse_thread (Context, CURHDR);
1739
1742
          else if (option (OPTCOLLAPSEUNREAD) || !UNREAD (CURHDR))
1740
1743
            final = mutt_collapse_thread (Context, CURHDR);
1741
1744
          else
1742
1745
            final = CURHDR->virtual;
1743
 
          
 
1746
 
1744
1747
          base = Context->hdrs[Context->v2r[final]];
1745
 
          
 
1748
 
1746
1749
          top = Context->tree;
1747
1750
          Context->collapsed = !Context->collapsed;
1748
1751
          while ((thread = top) != NULL)
1760
1763
            }
1761
1764
            top = top->next;
1762
1765
          }
1763
 
          
 
1766
 
1764
1767
          mutt_set_virtual (Context);
1765
1768
          for (j = 0; j < Context->vcount; j++)
1766
1769
          {
1770
1773
              break;
1771
1774
            }
1772
1775
          }
1773
 
          
 
1776
 
1774
1777
          menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
1775
1778
        }
1776
1779
        break;
1777
 
      
 
1780
 
1778
1781
      /* --------------------------------------------------------------------
1779
1782
       * These functions are invoked directly from the internal-pager
1780
1783
       */
1854
1857
        if (rc != -1)
1855
1858
        {
1856
1859
          if (option (OPTDELETEUNTAG))
1857
 
            mutt_thread_set_flag (CURHDR, M_TAG, 0, 
 
1860
            mutt_thread_set_flag (CURHDR, M_TAG, 0,
1858
1861
                                  op == OP_DELETE_THREAD ? 0 : 1);
1859
1862
          if (option (OPTRESOLVE))
1860
1863
            if ((menu->current = ci_next_undeleted (menu->current)) == -1)
1889
1892
        CHECK_ATTACH;
1890
1893
        CHECK_ACL(M_ACL_INSERT, _("edit message"));
1891
1894
 
1892
 
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
 
1895
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
1893
1896
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
1894
1897
        mutt_edit_message (Context, tag ? NULL : CURHDR);
1895
1898
        menu->redraw = REDRAW_FULL;
1901
1904
        CHECK_MSGCOUNT;
1902
1905
        CHECK_VISIBLE;
1903
1906
        CHECK_ATTACH;
1904
 
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
 
1907
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
1905
1908
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
1906
1909
        ci_send_message (SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
1907
1910
        menu->redraw = REDRAW_FULL;
1917
1920
        CHECK_MSGCOUNT;
1918
1921
        CHECK_VISIBLE;
1919
1922
        CHECK_ATTACH;
1920
 
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
 
1923
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
1921
1924
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
1922
1925
        ci_send_message (SENDREPLY|SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
1923
1926
        menu->redraw = REDRAW_FULL;
1928
1931
        CHECK_ATTACH;
1929
1932
        CHECK_MSGCOUNT;
1930
1933
        CHECK_VISIBLE;
1931
 
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
 
1934
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
1932
1935
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
1933
1936
        ci_send_message (SENDREPLY|SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
1934
1937
        menu->redraw = REDRAW_FULL;
1949
1952
        menu->redraw = REDRAW_FULL;
1950
1953
        break;
1951
1954
 
1952
 
      
 
1955
 
1953
1956
      case OP_EXTRACT_KEYS:
1954
1957
        if (!WithCrypto)
1955
1958
          break;
1963
1966
      case OP_CHECK_TRADITIONAL:
1964
1967
        if (!(WithCrypto & APPLICATION_PGP))
1965
1968
          break;
1966
 
        CHECK_MSGCOUNT; 
 
1969
        CHECK_MSGCOUNT;
1967
1970
        CHECK_VISIBLE;
1968
 
        if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)) 
 
1971
        if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
1969
1972
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
1970
 
      
 
1973
 
1971
1974
        if (menu->menu == MENU_PAGER)
1972
1975
        {
1973
1976
          op = OP_DISPLAY_MESSAGE;
2027
2030
        {
2028
2031
          if (option (OPTRESOLVE))
2029
2032
          {
2030
 
            if ((menu->current = (op == OP_MAIN_READ_THREAD ? 
 
2033
            if ((menu->current = (op == OP_MAIN_READ_THREAD ?
2031
2034
                                  mutt_next_thread (CURHDR) : mutt_next_subthread (CURHDR))) == -1)
2032
2035
              menu->current = menu->oldcurrent;
2033
2036
          }
2043
2046
        break;
2044
2047
 
2045
2048
      case OP_RESEND:
2046
 
      
 
2049
 
2047
2050
        CHECK_ATTACH;
2048
2051
        CHECK_MSGCOUNT;
2049
2052
        CHECK_VISIBLE;
2050
 
      
 
2053
 
2051
2054
        if (tag)
2052
2055
        {
2053
2056
          for (j = 0; j < Context->vcount; j++)
2058
2061
        }
2059
2062
        else
2060
2063
          mutt_resend_message (NULL, Context, CURHDR);
2061
 
      
 
2064
 
2062
2065
        menu->redraw = REDRAW_FULL;
2063
2066
        break;
2064
 
      
 
2067
 
2065
2068
      case OP_REPLY:
2066
2069
 
2067
2070
        CHECK_ATTACH;
2068
2071
        CHECK_MSGCOUNT;
2069
2072
        CHECK_VISIBLE;
2070
 
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
 
2073
        if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
2071
2074
          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
2072
2075
        ci_send_message (SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
2073
2076
        menu->redraw = REDRAW_FULL;
2086
2089
        CHECK_VISIBLE;
2087
2090
        rc = mutt_thread_set_flag (CURHDR, M_TAG, !CURHDR->tagged,
2088
2091
                                   op == OP_TAG_THREAD ? 0 : 1);
2089
 
        
 
2092
 
2090
2093
        if (rc != -1)
2091
2094
        {
2092
2095
          if (option (OPTRESOLVE))
2109
2112
        CHECK_VISIBLE;
2110
2113
        CHECK_READONLY;
2111
2114
        CHECK_ACL(M_ACL_DELETE, _("undelete message"));
2112
 
        
 
2115
 
2113
2116
        if (tag)
2114
2117
        {
2115
2118
          mutt_tag_set_flag (M_DELETE, 0);
2207
2210
 
2208
2211
  if (!curhdr)
2209
2212
    return;
2210
 
  
 
2213
 
2211
2214
  for (color = ColorIndexList; color; color = color->next)
2212
2215
   if (mutt_pattern_exec (color->color_pattern, M_MATCH_FULL_ADDRESS, ctx, curhdr))
2213
2216
   {