about summary refs log tree commit diff
path: root/Completion/User/_mh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User/_mh')
-rw-r--r--Completion/User/_mh15
1 files changed, 7 insertions, 8 deletions
diff --git a/Completion/User/_mh b/Completion/User/_mh
index 724b45e5a..29d6bc2a1 100644
--- a/Completion/User/_mh
+++ b/Completion/User/_mh
@@ -17,16 +17,13 @@ if compset -P 1 -; then
   # get list of options, which MH commands can generate themselves
   # awk is just too icky to use for this, sorry.  send me one if
   # you come up with it.
-  if _wanted options; then
-    _all_labels options expl option \
-        compadd - $($words[1] -help | perl -ne 'if (/^\s*-\(?(\S+)/) {
+  _wanted options expl option \
+      compadd - $($words[1] -help | perl -ne 'if (/^\s*-\(?(\S+)/) {
             $n = $1;
             $n =~ s/\)//g;
             print $n =~ s/^\[([a-z]+)\]// ? "$n\n$1$n\n" : "$n\n";
           }')
-    return
-  fi
-  return 1
+  return
 elif compset -P 1 '[+@]' || [[ "$prev" = -draftfolder ]]; then
   # Complete folder names.
   local mhpath
@@ -72,13 +69,15 @@ else
     # leaving foldnam empty works here
   fi
 
-  if _wanted sequences; then
+  _tags sequences
+  while _tags; do
     while _next_label sequences expl sequence; do
       compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') &&
         ret=0
       compadd "$expl[@]" reply next cur prev first last all unseen && ret=0
       _files "$expl[@]" -W folddir -g '<->' && ret=0
     done
-  fi
+    (( ret )) || return 0
+  done
   return ret
 fi