From 13b3b36c8f696aea26b7c60444f2baa4858b004d Mon Sep 17 00:00:00 2001 From: pdmef Date: Fri, 25 Nov 2005 09:12:27 +0000 Subject: [PATCH] Rocco Rutte: - merge in latest mutt changes git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@622 e385b8ad-14ed-0310-8656-cc95a2468c6d --- ChangeLog.mutt | 21 +++++++++++++++++++++ VERSION.svn | 2 +- curs_main.c | 2 ++ handler.c | 16 ++++++++++++---- menu.c | 29 ++++++++++++----------------- pattern.c | 8 +------- pgp.c | 22 ++++++++++++++-------- 7 files changed, 63 insertions(+), 37 deletions(-) diff --git a/ChangeLog.mutt b/ChangeLog.mutt index e9be924..c664966 100644 --- a/ChangeLog.mutt +++ b/ChangeLog.mutt @@ -1,3 +1,24 @@ +2005-11-24 12:50:27 Thomas Roessler (roessler) + + * curs_main.c, pattern.c: mutt/2142 suggests that the change + from pattern.c,3.14 -> 3.15 causes inconsistency and confusion. + Reverting the change; adding a helpful message to the status line. + +2005-11-22 12:31:58 Thomas Roessler (roessler) + + * pgp.c: Fix "mixed messages" about the success (or not) of + decrypting PGP messages. + + * handler.c: Actually, the previous fix for 2139 had a flaw. + + * handler.c: Fix mutt/2139; also Debian #340116. + +2005-11-17 18:40:50 Thomas Roessler (roessler) + + * menu.c: a not entirely sane state of code. + + * menu.c: Another stab at #2019. + 2005-11-01 08:42:00 Thomas Roessler (roessler) * menu.c: This should be a better patch for the menu break diff --git a/VERSION.svn b/VERSION.svn index 7e1aa32..ff39c77 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -621 +622 diff --git a/curs_main.c b/curs_main.c index 83e1808..4d58326 100644 --- a/curs_main.c +++ b/curs_main.c @@ -989,6 +989,8 @@ int mutt_index_menu (void) mutt_draw_tree (Context); menu->redraw = REDRAW_FULL; } + if (Context->pattern) + mutt_message _("To view all messages, limit to \"all\"."); break; case OP_QUIT: diff --git a/handler.c b/handler.c index 9c379dc..06a1fcd 100644 --- a/handler.c +++ b/handler.c @@ -1304,16 +1304,24 @@ void mutt_decode_attachment (BODY * b, STATE * s) fseeko (s->fpin, b->offset, 0); switch (b->encoding) { case ENCQUOTEDPRINTABLE: - mutt_decode_quoted (s, b->length, istext, cd); + mutt_decode_quoted (s, b->length, istext || + ((WithCrypto & APPLICATION_PGP) && + mutt_is_application_pgp (b)), cd); break; case ENCBASE64: - mutt_decode_base64 (s, b->length, istext, cd); + mutt_decode_base64 (s, b->length, istext || + ((WithCrypto & APPLICATION_PGP) && + mutt_is_application_pgp (b)), cd); break; case ENCUUENCODED: - mutt_decode_uuencoded (s, b->length, istext, cd); + mutt_decode_uuencoded (s, b->length, istext + || ((WithCrypto & APPLICATION_PGP) && + mutt_is_application_pgp (b)), cd); break; default: - mutt_decode_xbit (s, b->length, istext, cd); + mutt_decode_xbit (s, b->length, istext + || ((WithCrypto & APPLICATION_PGP) && + mutt_is_application_pgp (b)), cd); break; } diff --git a/menu.c b/menu.c index 4f67b84..7370b12 100644 --- a/menu.c +++ b/menu.c @@ -373,23 +373,18 @@ void menu_check_recenter (MUTTMENU * menu) menu->top = 0; set_option (OPTNEEDREDRAW); } - } - else if (menu->current >= menu->top + menu->pagelen - c) { /* indicator below bottom threshold */ - if (option (OPTMENUSCROLL) || (menu->pagelen <= 0)) - menu->top = menu->current - menu->pagelen + c; - else - menu->top += - (menu->pagelen - - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c; - } - else if (menu->current < menu->top + c) { /* indicator above top threshold */ - if (option (OPTMENUSCROLL) || (menu->pagelen <= 0)) - menu->top = menu->current - c; - else - menu->top -= - (menu->pagelen - - c) * ((menu->top + menu->pagelen - 1 - - menu->current) / (menu->pagelen - c)) - c; + } else { + if (option (OPTMENUSCROLL) || (menu->pagelen <= 0) || (c <= MenuContext)) { + if (menu->current < menu->top + c) + menu->top = menu->current - c; + else if (menu->current >= menu->top + menu->pagelen - c) + menu->top = menu->current - menu->pagelen + c + 1; + } else { + if (menu->current < menu->top + c) + menu->top -= (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 - menu->current) / (menu->pagelen - c)) - c; + else if ((menu->current >= menu->top + menu->pagelen - c)) + menu->top += (menu->pagelen - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c; + } } if (!option (OPTMENUMOVEOFF)) /* make entries stick to bottom */ diff --git a/pattern.c b/pattern.c index dec82b5..c30a381 100644 --- a/pattern.c +++ b/pattern.c @@ -1204,14 +1204,8 @@ int mutt_pattern_func (int op, char *prompt) strfcpy (buf, NONULL (Context->pattern), sizeof (buf)); if (prompt || op != M_LIMIT) - if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0) + if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0 || !buf[0]) return (-1); - if (!buf[0]) { - if (op == M_LIMIT) - strncpy (buf, "~A", sizeof (buf)); - else - return (-1); - } mutt_message _("Compiling search pattern..."); diff --git a/pgp.c b/pgp.c index 4b586e9..13a5e1e 100644 --- a/pgp.c +++ b/pgp.c @@ -233,6 +233,7 @@ static void pgp_copy_clearsigned (FILE * fpin, STATE * s, char *charset) int pgp_application_pgp_handler (BODY * m, STATE * s) { + int could_not_decrypt = 0; int needpass = -1, pgp_keyblock = 0; int c = 1; int clearsign = 0, rv, rc; @@ -383,13 +384,15 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) ungetc (c, pgpout); } if (!clearsign && (!pgpout || c == EOF)) { - mutt_error _("Could not decrypt PGP message"); - mutt_sleep (1); - pgp_void_passphrase (); - if (!(s->flags & M_DISPLAY)) { - rc = -1; - goto out; - } + could_not_decrypt = 1; + pgp_void_passphrase (); + } + + if (could_not_decrypt && !(s->flags & M_DISPLAY)) { + mutt_error _("Could not decrypt PGP message"); + mutt_sleep (1); + rc = -1; + goto out; } } @@ -429,7 +432,10 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) state_putc ('\n', s); if (needpass) { state_attach_puts (_("[-- END PGP MESSAGE --]\n"), s); - mutt_message _("PGP message successfully decrypted."); + if (could_not_decrypt) + mutt_error _("Could not decrypt PGP message."); + else + mutt_message _("PGP message successfully decrypted."); } else if (pgp_keyblock) state_attach_puts (_("[-- END PGP PUBLIC KEY BLOCK --]\n"), s); -- 2.20.1