[Bug 1008380] Re: mutt -f =FOO<tab> and mutt -f +FOO<tab> are broken
Marius Gedminas
marius at gedmin.as
Sat Oct 15 16:32:10 UTC 2016
Ubuntu 16.10 still has the 1st bug ('mutt -f +U<tab>' completes to 'mutt
-f UNKNOWN-LIST' without the + prefix), but the 2nd bug is gone ('mutt
-f =U<tab>' completes correctly).
--
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