The subject line might not be the best description. And you might not
see that this is a bug. In that case, please let me know how to work
around the behavior I see, as it is quite annoying.
In a Lisp file that I byte-compile and load, I have a redefinition of
`ls-lisp--insert-directory'. (I do not see another, better way to
accomplish the behavior change I need.) I added this when vanilla Emacs
was changed recently to use this function. The bug does not appear for
older Emacs code (e.g. older Emacs 24 Dev snapshots, which do not have
`ls-lisp--insert-directory').
It is true that I byte-compile this library using Emacs 20, because the
library is used with multiple Emacs versions. I don't know whether
byte-compiling it in Emacs 24 would make a difference wrt this annoying
behavior.