]> granicus.if.org Git - mutt/commitdiff
Allow descending into maildir and mh directories in file browser
authorCorey Minyard <cminyard@mvista.com>
Thu, 31 Jan 2019 23:57:57 +0000 (17:57 -0600)
committerKevin McCarthy <kevin@8t8.us>
Fri, 1 Feb 2019 02:11:07 +0000 (18:11 -0800)
Some (maybe most) IMAP mail systems allow folders to be nested inside
folders, so you can have, say, an Inbox with more folders inside it.
However, in the file browser, mutt will only open a maildir/mh
directory as a mailbox, there is no way to get to the child mailboxes.

This change adds a function <descend-directory> that forces mutt to
descend into the directory.  It is unbound by default.

Signed-off-by: Corey Minyard <minyard@acm.org>
OPS
browser.c
doc/manual.xml.head
functions.h

diff --git a/OPS b/OPS
index e97798744ddde4fb475b524bebe49f37e54b7a8c..5c28c536cde3afc968703ca277f38ef4f25ef921 100644 (file)
--- a/OPS
+++ b/OPS
@@ -186,3 +186,4 @@ OP_CHECK_STATS "calculate message statistics for all mailboxes"
 OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
 OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread"
 OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads"
+OP_DESCEND_DIRECTORY "descend into a directdory"
index cb30f8295d19b82d0d77842493f5bf1de8705dbe..e95dbdcb012eef3be81d36b0db7c8382d558fe3a 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -769,6 +769,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
   {
     switch (i = mutt_menuLoop (menu))
     {
+      case OP_DESCEND_DIRECTORY:
       case OP_GENERIC_SELECT_ENTRY:
 
        if (!state.entrylen)
@@ -800,7 +801,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
          else
            mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf));
 
-         if ((mx_get_magic (buf) <= 0)
+         if (i == OP_DESCEND_DIRECTORY || (mx_get_magic (buf) <= 0)
 #ifdef USE_IMAP
               || state.entry[menu->current].inferiors
 #endif
index cb22736aa6c0e0907efc9b3a5eb54991ad77b5c7..e3da882a51f68339ac193150536d884a92e62e8d 100644 (file)
@@ -403,6 +403,14 @@ for easy navigation through the file system when selecting file(s) to
 attach to a message, select multiple files to attach and many more.
 </para>
 
+<para>
+Some mail systems can nest mail folders inside other mail folders.
+The normal open entry commands in mutt will open the mail folder and
+you can't see the sub-folders.  If you instead use the
+<literal>&lt;descend-directory&gt;</literal> function it will go into
+the directory and not open it as a mail directory.
+</para>
+
 </sect2>
 
 <sect2 id="intro-sidebar">
index 33f3a07be7e1a2f310f8fb4a52a67fe3d6f1b3f5..d3ac06b7538eb4d9c1a59244499846faa839de81 100644 (file)
@@ -403,6 +403,7 @@ const struct binding_t OpAlias[] = { /* map: alias */
 /* The file browser */
 const struct binding_t OpBrowser[] = { /* map: browser */
   { "change-dir",      OP_CHANGE_DIRECTORY,    "c" },
+  { "descend-directory", OP_DESCEND_DIRECTORY, NULL },
   { "display-filename",        OP_BROWSER_TELL,        "@" },
   { "enter-mask",      OP_ENTER_MASK,          "m" },
   { "sort",            OP_SORT,                "o" },