Attached is a patch for a replacement function and an additional patch which adds tests for expanding all descendants. I couldn't see a direct way to test a Speedbar without creating a frame, and because the Speedbar code doesn't implement any type of hierarchy itself I've used eieio-speedbar to make something minimal to test. Each test runs by converting a list of strings into objects which implement a Speedbar display, making state changes for the functions being tested, and then converting the objects back into strings - this was the simplest way I could find to create a reusable interface for tests. The conversion back to a string is customizable to allow whatever state change is under test to be represented. If the tests are problematic or considered too complicated, perhaps they can just be used to test the current function and the replacement function and not committed. The current function fails 3/9 tests. -- Morgan Willcock