From 3414418461702a37c247d642e732c62aa4ddbb4c Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Thu, 15 Jun 2000 21:14:29 +0000 Subject: [PATCH] patch-1.3.2.bbell.complete.1 - autocomplete "!", which is helpful in certain IMAP contexts. --- complete.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/complete.c b/complete.c index 5455833e..fd9e1ce1 100644 --- a/complete.c +++ b/complete.c @@ -48,19 +48,23 @@ int mutt_complete (char *s, size_t slen) dprint (2, (debugfile, "mutt_complete: completing %s\n", s)); /* we can use '/' as a delimiter, imap_complete rewrites it */ - if (*s == '=' || *s == '+') + if (*s == '=' || *s == '+' || *s == '!') { + if (*s == '!') + p = Spoolfile; + else + p = Maildir; if (s[1]) { - /* don't append '/' if Maildir is {host} only */ - if (mx_is_imap (NONULL (Maildir)) && Maildir[strlen (Maildir)-1] == '}') - snprintf (imap_path, sizeof (imap_path), "%s%s", Maildir, s+1); + /* don't append '/' if Maildir/Spoolfile is {host} only */ + if (mx_is_imap (NONULL (p)) && p[strlen (p)-1] == '}') + snprintf (imap_path, sizeof (imap_path), "%s%s", p, s+1); else - snprintf (imap_path, sizeof (imap_path), "%s/%s", NONULL (Maildir), + snprintf (imap_path, sizeof (imap_path), "%s/%s", NONULL (p), s+1); } else - strfcpy (imap_path, NONULL(Maildir), sizeof(imap_path)); + strfcpy (imap_path, NONULL(p), sizeof(imap_path)); } else strfcpy (imap_path, s, sizeof(imap_path)); @@ -69,11 +73,14 @@ int mutt_complete (char *s, size_t slen) return imap_complete (s, slen, imap_path); #endif - if (*s == '=' || *s == '+') + if (*s == '=' || *s == '+' || *s == '!') { dirpart[0] = *s; dirpart[1] = 0; - strfcpy (exp_dirpart, NONULL (Maildir), sizeof (exp_dirpart)); + if (*s == '!') + strfcpy (exp_dirpart, NONULL (Spoolfile), sizeof (exp_dirpart)); + else + strfcpy (exp_dirpart, NONULL (Maildir), sizeof (exp_dirpart)); if ((p = strrchr (s, '/'))) { *p++ = 0; -- 2.40.0