[Bug 1008380] Re: mutt -f =FOO<tab> and mutt -f +FOO<tab> are broken

Marius Gedminas marius at gedmin.as
Tue Nov 26 19:22:20 UTC 2013


On Ubuntu 13.10, with bash-completion 1:2.0-1ubuntu3:

- mutt -f =U<tab> completes to mutt -f UNKNOWN-LIST

- mutt -f +U<tab> completes to mutt -f UNKNOWN-LIST

In both cases the prefix is lost.

Related bugs (probably duplicates):
- https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/655849

Upstream bugs:
- https://alioth.debian.org/tracker/?group_id=100114&atid=413095&func=detail&aid=312184
- https://alioth.debian.org/tracker/?group_id=100114&atid=413095&func=detail&aid=312760
- https://alioth.debian.org/tracker/?group_id=100114&atid=413095&func=detail&aid=313189

** Bug watch added: alioth.debian.org/ #312184
   http://alioth.debian.org/support/tracker.php?aid=312184

** Bug watch added: alioth.debian.org/ #312760
   http://alioth.debian.org/support/tracker.php?aid=312760

** Bug watch added: alioth.debian.org/ #313189
   http://alioth.debian.org/support/tracker.php?aid=313189

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/1008380

Title:
  mutt -f =FOO<tab> and mutt -f +FOO<tab> are broken

Status in “bash-completion” package in Ubuntu:
  New

Bug description:
  Here are two closely-related bugs in Mutt tab-completion.  My muttrc
  sets folder=~/Mail, and I've a mailbox named UNKNOWN-LIST. I can open
  it by typing either 'mutt -f =UNKNOWN-LIST' or 'mutt -f +UNKNOWN-
  LIST'.  As you can imagine, that's more typing than I like.  I want
  tab-completion.

  Bug #1:  'mutt -f +U<tab>' completes to 'mutt -f UNKNOWN-LIST', i.e.
  it loses the leading '+'.  Fix:

  --- a/bash_completion.d/mutt
  +++ b/bash_completion.d/mutt
  @@ -87,6 +87,10 @@ _muttfiledir()
           # (minus the leading '=' sign).
           COMPREPLY=( $( compgen -f -- "$folder/${cur:1}" ) )
           COMPREPLY=( ${COMPREPLY[@]#$folder/} )
  +        # mg: fix mutt -f +FOO<tab>
  +        if [[ $cur == [+]* ]]; then
  +            COMPREPLY=( +${COMPREPLY[@]#$folder/} )
  +        fi
           return 0
       elif [ "$cur" == !* ]; then
           spoolfile="$( $muttcmd -Q spoolfile | \

  Bug #2: 'mutt -f =U<tab>' fails to complete folder names (instead it
  tries to complete aliases).  Fix:

  --- a/bash_completion.d/mutt
  +++ b/bash_completion.d/mutt

  @@ -75,7 +75,7 @@ _muttquery()
   _muttfiledir()
   {
       local cur folder spoolfile muttcmd=${COMP_WORDS[0]}
  -    cur=`_get_cword`
  +    cur=`_get_cword =`
   
       # This is currently not working so well. Perhaps this function should
       # just call _filedir() for the moment.

  @@ -101,8 +105,12 @@ _muttfiledir()
   _mutt()
   {
       local cur prev
  -    cur=`_get_cword`
  +    cur=`_get_cword =`
       prev=${COMP_WORDS[COMP_CWORD-1]}
  +    # mg: fix mutt -f =FOO<tab>
  +    if [[ $prev == "=" ]]; then
  +        prev=${COMP_WORDS[COMP_CWORD-2]}
  +    fi
   
       COMPREPLY=()

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: bash-completion 1:1.1-3ubuntu2
  ProcVersionSignature: Ubuntu 2.6.32-41.89-server 2.6.32.59+drm33.24
  Uname: Linux 2.6.32-41-server x86_64
  Architecture: amd64
  Date: Mon Jun  4 11:12:53 2012
  PackageArchitecture: all
  SourcePackage: bash-completion

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1008380/+subscriptions



More information about the foundations-bugs mailing list