Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 4 Sep 2005 18:59:04 +0000 (18:59 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 4 Sep 2005 18:59:04 +0000 (18:59 +0000)
- merge in latest mutt changes
- fix bug #4965

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@480 e385b8ad-14ed-0310-8656-cc95a2468c6d

ChangeLog.mutt
VERSION.svn
attach.c
curs_main.c
doc/manual.txt
doc/manual.xml.head
doc/manual.xml.tail
keymap.c
mutt_ssl.c
pattern.c
send.c

index 6b1f23c..a1f9878 100644 (file)
@@ -1,3 +1,22 @@
+2005-09-04 18:01:57  Zardoz@users.sourceforge.net  (brendan)
+
+       * keymap.c: Teach keymap.c about KEY_NEXT. Closes: #1588.
+
+2005-09-04 06:57:04  Alain Bench  <veronatif@free.fr>  (brendan)
+
+       * doc/manual.xml.head, doc/manual.xml.tail: Note that <Tab> is
+       bound to next-new-then-unread by default, rather than
+       next-new. Closes: #1637.
+
+       * curs_main.c, pattern.c: Allow empty limits, and limits in empty
+       mailboxes. Closes: #1853, #1906.
+
+2005-09-03 23:22:31  Brendan Cully  <brendan@kublai.com>  (brendan)
+
+       * send.c, attach.c: Note when mutt_edit_attachment fails and
+       display error instead of prompting to abort an unmodified
+       file. Closes: #2051.
+
 2005-09-03 19:41:53  Alain Bench  <veronatif@free.fr>  (brendan)
 
        * contrib/gpg.rc: One should let GnuPG charset be automatically
index bf11029..36e0826 100644 (file)
@@ -1 +1 @@
-479
+480
index 0b97d5a..c695e34 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -238,11 +238,14 @@ int mutt_edit_attachment (BODY * a)
                                   command, sizeof (command))) {
         /* For now, editing requires a file, no piping */
         mutt_error _("Mailcap Edit entry requires %%s");
+        goto bailout;
       }
       else {
         mutt_endwin (NULL);
-        if (mutt_system (command) == -1)
+        if (mutt_system (command) == -1) {
           mutt_error (_("Error running \"%s\"!"), command);
+          goto bailout;
+        }
       }
     }
   }
index 4811ba4..39973fa 100644 (file)
@@ -61,9 +61,16 @@ static const char *Function_not_permitted_in_attach_message_mode =
 N_("Function not permitted in attach-message mode.");
 static const char *No_visible = N_("No visible messages.");
 
+#define CHECK_IN_MAILBOX if (!Context) \
+        { \
+                mutt_flushinp (); \
+                mutt_error (_(No_mailbox_is_open)); \
+                break; \
+        }
+
 #define CHECK_MSGCOUNT if (!Context) \
         { \
-                  mutt_flushinp (); \
+                mutt_flushinp (); \
                 mutt_error(_(No_mailbox_is_open)); \
                 break; \
         } \
@@ -269,19 +276,16 @@ static void update_index (MUTTMENU * menu, CONTEXT * ctx, int check,
    * they will be visible in the limited view */
   if (Context->pattern) {
 #define THIS_BODY Context->hdrs[j]->content
-    if (oldcount || check == M_REOPENED) {
-      for (j = (check == M_REOPENED) ? 0 : oldcount; j < Context->msgcount;
-           j++) {
-        if (mutt_pattern_exec
-            (Context->limit_pattern, M_MATCH_FULL_ADDRESS, Context,
-             Context->hdrs[j])) {
-          Context->hdrs[j]->virtual = Context->vcount;
-          Context->v2r[Context->vcount] = j;
-          Context->hdrs[j]->limited = 1;
-          Context->vcount++;
-          Context->vsize +=
-            THIS_BODY->length + THIS_BODY->offset - THIS_BODY->hdr_offset;
-        }
+    for (j = (check == M_REOPENED) ? 0 : oldcount; j < Context->msgcount; j++) {
+      if (mutt_pattern_exec
+          (Context->limit_pattern, M_MATCH_FULL_ADDRESS, Context,
+            Context->hdrs[j])) {
+        Context->hdrs[j]->virtual = Context->vcount;
+        Context->v2r[Context->vcount] = j;
+        Context->hdrs[j]->limited = 1;
+        Context->vcount++;
+        Context->vsize +=
+          THIS_BODY->length + THIS_BODY->offset - THIS_BODY->hdr_offset;
       }
     }
 #undef THIS_BODY
@@ -922,7 +926,7 @@ int mutt_index_menu (void)
       break;
 
     case OP_MAIN_SHOW_LIMIT:
-      CHECK_MSGCOUNT;
+      CHECK_IN_MAILBOX;
       if (!Context->pattern)
         mutt_message (_("No limit pattern is in effect."));
 
@@ -938,7 +942,7 @@ int mutt_index_menu (void)
     case OP_MAIN_LIMIT:
     case OP_TOGGLE_READ:
 
-      CHECK_MSGCOUNT;
+      CHECK_IN_MAILBOX;
       menu->oldcurrent = (Context->vcount && menu->current >= 0
                           && menu->current <
                           Context->vcount) ? CURHDR->index : -1;
@@ -977,7 +981,7 @@ int mutt_index_menu (void)
         else
           menu->current = 0;
         menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
-        if ((Sort & SORT_MASK) == SORT_THREADS)
+        if (Context->msgcount && (Sort & SORT_MASK) == SORT_THREADS)
           mutt_draw_tree (Context);
         menu->redraw = REDRAW_FULL;
       }
@@ -1699,7 +1703,7 @@ int mutt_index_menu (void)
 
     case OP_TOGGLE_WRITE:
 
-      CHECK_MSGCOUNT;
+      CHECK_IN_MAILBOX;
       if (mx_toggle_write (Context) == 0)
         menu->redraw |= REDRAW_STATUS;
       break;
index 57f6f01..99c7317 100644 (file)
@@ -873,7 +873,7 @@ Chapter 2. Getting Started
    |----------+----------+---------------------------------------------|
    | <Return> |          | display-message                             |
    |----------+----------+---------------------------------------------|
-   | <Tab>    |          | jump to the next new message                |
+   | <Tab>    |          | jump to the next new or unread message      |
    |----------+----------+---------------------------------------------|
    | @        |          | show the author's full e-mail address       |
    |----------+----------+---------------------------------------------|
@@ -7602,7 +7602,7 @@ Chapter 7. Reference
 
    Type: system property
 
-   Value: 477
+   Value: 479
 
    This is a read-only system property and specifies muttng's subversion
    revision string.
@@ -10392,7 +10392,8 @@ Chapter 7. Reference
              list
              mail                       m   compose a new mail message
              mail-key               ESC k   mail a PGP public key
-             next-new                 TAB   jump to the next new message
+             next-new           not bound   jump to the next new message
+             next-new-then-unread     TAB   jump to the next new or unread message
              next-subthread         ESC n   jump to the next subthread
              next-thread               ^N   jump to the next thread
              next-undeleted             j   move to the next undeleted message
@@ -10400,7 +10401,10 @@ Chapter 7. Reference
              parent-message             P   jump to parent message in thread
              pipe-message               |   pipe message/attachment to a shell
              command
-             previous-new         ESC TAB   jump to the previous new message
+             previous-new       not bound   jump to the previous new message
+             previous-new-then-unread
+                                  ESC TAB   jump to the previous new or unread message
+
              previous-page              Z   move to the previous page
              previous-subthread     ESC p   jump to previous subthread
              previous-thread           ^P   jump to previous thread
@@ -10477,7 +10481,8 @@ Chapter 7. Reference
              mark-as-new                N   toggle a message's 'new' flag
              next-line                RET   scroll down one line
              next-entry                 J   move to the next entry
-             next-new                 TAB   jump to the next new message
+             next-new           not bound   jump to the next new message
+             next-new-then-unread     TAB   jump to the next new or unread message
              next-page                      move to the next page
              next-subthread         ESC n   jump to the next subthread
              next-thread               ^N   jump to the next thread
@@ -10489,6 +10494,8 @@ Chapter 7. Reference
              previous-line      BackSpace   scroll up one line
              previous-entry             K   move to the previous entry
              previous-new       not bound   jump to the previous new message
+             previous-new-then-unread
+                                not bound   jump to the previous new or unread message
              previous-page              -   move to the previous page
              previous-subthread     ESC p   jump to previous subthread
              previous-thread           ^P   jump to previous thread
index c121d1b..9b11500 100644 (file)
           <row><entry><code>v        </code></entry><entry><code></code></entry><entry>view-attachments</entry></row>
           <row><entry><code>x       </code></entry><entry><code></code></entry><entry>abort changes and exit</entry></row>
           <row><entry><code>&#60;Return&#62;  </code></entry><entry><code></code></entry><entry>display-message</entry></row>
-          <row><entry><code>&#60;Tab&#62;      </code></entry><entry><code></code></entry><entry>jump to the next new message</entry></row>
+          <row><entry><code>&#60;Tab&#62;      </code></entry><entry><code></code></entry><entry>jump to the next new or unread message</entry></row>
           <row><entry><code>@      </code></entry><entry><code></code></entry><entry>show the author's full e-mail address</entry></row>
           <row><entry><code>$       </code></entry><entry><code></code></entry><entry>save changes to mailbox</entry></row>
           <row><entry><code>/       </code></entry><entry><code></code></entry><entry>search</entry></row>
index 744504f..194095b 100644 (file)
             list
             mail                       m   compose a new mail message
             mail-key               ESC k   mail a PGP public key
-            next-new                 TAB   jump to the next new message
+            next-new           not bound   jump to the next new message
+            next-new-then-unread     TAB   jump to the next new or unread message
             next-subthread         ESC n   jump to the next subthread
             next-thread               ^N   jump to the next thread
             next-undeleted             j   move to the next undeleted message
             parent-message             P   jump to parent message in thread
             pipe-message               |   pipe message/attachment to a shell
             command
-            previous-new         ESC TAB   jump to the previous new message
+            previous-new       not bound   jump to the previous new message
+            previous-new-then-unread
+                                 ESC TAB   jump to the previous new or unread message
+
             previous-page              Z   move to the previous page
             previous-subthread     ESC p   jump to previous subthread
             previous-thread           ^P   jump to previous thread
             mark-as-new                N   toggle a message's 'new' flag
             next-line                RET   scroll down one line
             next-entry                 J   move to the next entry
-            next-new                 TAB   jump to the next new message
+            next-new           not bound   jump to the next new message
+            next-new-then-unread     TAB   jump to the next new or unread message
             next-page                      move to the next page
             next-subthread         ESC n   jump to the next subthread
             next-thread               ^N   jump to the next thread
             previous-line      BackSpace   scroll up one line
             previous-entry             K   move to the previous entry
             previous-new       not bound   jump to the previous new message
+            previous-new-then-unread
+                               not bound   jump to the previous new or unread message
             previous-page              -   move to the previous page
             previous-subthread     ESC p   jump to previous subthread
             previous-thread           ^P   jump to previous thread
index bd12211..b480455 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -81,6 +81,9 @@ static struct mapping_t KeyNames[] = {
   {"<Space>", ' '},
 #ifdef KEY_BTAB
   {"<BackTab>", KEY_BTAB},
+#endif
+#ifdef KEY_NEXT
+  {"<Next>",    KEY_NEXT},
 #endif
   {NULL, 0}
 };
index f73cca7..1fb7aa5 100644 (file)
@@ -64,7 +64,7 @@ typedef struct _sslsockdata {
 } sslsockdata;
 
 /* local prototypes */
-int ssl_init (void);
+static int ssl_init (void);
 static int add_entropy (const char *file);
 static int ssl_socket_read (CONNECTION * conn, char *buf, size_t len);
 static int ssl_socket_write (CONNECTION * conn, const char *buf, size_t len);
index aee8dc2..a606ab9 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -1222,22 +1222,16 @@ int mutt_pattern_func (int op, char *prompt)
   mutt_clear_error ();
 
   if (op == M_LIMIT) {
+    /* drop previous limit pattern */
     mem_free (&Context->pattern);
     if (Context->limit_pattern)
       mutt_pattern_free (&Context->limit_pattern);
-    if (!Context->vcount) {
+    if (Context->msgcount && !Context->vcount) {
       mutt_error _("No messages matched criteria.");
-
-#if 0
-      Context->vcount = Context->msgcount;
-      /* restore full display */
-      for (i = 0; i < Context->msgcount; i++) {
-        Context->hdrs[i]->virtual = i;
-        Context->v2r[i] = i;
-      }
-#endif
     }
-    else if (str_ncmp (buf, "~A", 2) != 0) {
+
+    /* record new limit pattern, unless match all */
+    if (str_ncmp (buf, "~A", 2) != 0) {
       Context->pattern = simple;
       simple = NULL;            /* don't clobber it */
       Context->limit_pattern = mutt_pattern_comp (buf, M_FULL_MSG, &err);
diff --git a/send.c b/send.c
index 10803c4..b4dbd3a 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1428,9 +1428,10 @@ int ci_send_message (int flags, /* send mode */
          query_quadoption (OPT_FORWEDIT,
                            _("Edit forwarded message?")) == M_YES)) {
       /* If the this isn't a text message, look for a mailcap edit command */
-      if (mutt_needs_mailcap (msg->content))
-        mutt_edit_attachment (msg->content);
-      else if (!Editor || str_cmp ("builtin", Editor) == 0)
+      if (mutt_needs_mailcap (msg->content)) {
+        if (!mutt_edit_attachment (msg->content))
+          goto cleanup;
+      } else if (!Editor || str_cmp ("builtin", Editor) == 0)
         mutt_builtin_editor (msg->content->filename, msg, cur);
       else if (option (OPTEDITHDRS)) {
         mutt_env_to_local (msg->env);