From b0811fbd6a0e218c9c310a6ef4170e81540e6c22 Mon Sep 17 00:00:00 2001 From: pdmef Date: Sun, 4 Sep 2005 18:59:04 +0000 Subject: [PATCH] Rocco Rutte: - 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 | 19 +++++++++++++++++++ VERSION.svn | 2 +- attach.c | 5 ++++- curs_main.c | 40 ++++++++++++++++++++++------------------ doc/manual.txt | 17 ++++++++++++----- doc/manual.xml.head | 2 +- doc/manual.xml.tail | 13 ++++++++++--- keymap.c | 3 +++ mutt_ssl.c | 2 +- pattern.c | 16 +++++----------- send.c | 7 ++++--- 11 files changed, 82 insertions(+), 44 deletions(-) diff --git a/ChangeLog.mutt b/ChangeLog.mutt index 6b1f23c..a1f9878 100644 --- a/ChangeLog.mutt +++ b/ChangeLog.mutt @@ -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 (brendan) + + * doc/manual.xml.head, doc/manual.xml.tail: Note that 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) + + * 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 (brendan) * contrib/gpg.rc: One should let GnuPG charset be automatically diff --git a/VERSION.svn b/VERSION.svn index bf11029..36e0826 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -479 +480 diff --git a/attach.c b/attach.c index 0b97d5a..c695e34 100644 --- 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; + } } } } diff --git a/curs_main.c b/curs_main.c index 4811ba4..39973fa 100644 --- a/curs_main.c +++ b/curs_main.c @@ -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; diff --git a/doc/manual.txt b/doc/manual.txt index 57f6f01..99c7317 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -873,7 +873,7 @@ Chapter 2. Getting Started |----------+----------+---------------------------------------------| | | | display-message | |----------+----------+---------------------------------------------| - | | | jump to the next new message | + | | | 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 diff --git a/doc/manual.xml.head b/doc/manual.xml.head index c121d1b..9b11500 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -929,7 +929,7 @@ v view-attachments x abort changes and exit <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 $ save changes to mailbox / search diff --git a/doc/manual.xml.tail b/doc/manual.xml.tail index 744504f..194095b 100644 --- a/doc/manual.xml.tail +++ b/doc/manual.xml.tail @@ -110,7 +110,8 @@ 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 @@ -118,7 +119,10 @@ 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 @@ -203,7 +207,8 @@ 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 @@ -215,6 +220,8 @@ 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 diff --git a/keymap.c b/keymap.c index bd12211..b480455 100644 --- a/keymap.c +++ b/keymap.c @@ -81,6 +81,9 @@ static struct mapping_t KeyNames[] = { {"", ' '}, #ifdef KEY_BTAB {"", KEY_BTAB}, +#endif +#ifdef KEY_NEXT + {"", KEY_NEXT}, #endif {NULL, 0} }; diff --git a/mutt_ssl.c b/mutt_ssl.c index f73cca7..1fb7aa5 100644 --- a/mutt_ssl.c +++ b/mutt_ssl.c @@ -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); diff --git a/pattern.c b/pattern.c index aee8dc2..a606ab9 100644 --- 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 --- 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); -- 2.20.1