I have been wrestling with this question a lot lately.
We are debt free, except the mortgage.
We have 3 months in a cash e-fund, a sinking fund for cars and repairs that would cover another month if I had to tap that, a few other smaller sinking funds for home maintenance, travel, and gifts that amount to another half a month's mortgage payment. We also have about 2 months of expenses in a taxable brokerage account to earn some cash. I am in the midst of opening a HELOC, which is free by the way, to have an added layer of cushion should disaster strike.
Our plan is to bump up our cash a bit, and add some additional to the taxable account to add some additional safety there as well, and then focus on a split of accelerating mortgage pay down as well as dropping cash into the investment account.
I think you are going to find that everyone has a different plan, and it all depends on your risk tolerance. I am a bit more conservative, but I am self employed and wife has a steady gov job.