It was the idea for "Blazing Saddles" that Mel got from the Bergman script. Mel is a solid guy. He bought the script and brought Bergman in to join his writing team for the rewrite. The funniest thing I heard about the writing was that the white writers wrote the best lines for Bart and Pryor wrote some of the best lines for the white characters.
The best line that I only heard about recently (from my nephew) is when Howard Johnson both practices and gives his welcoming speech to Sheriff Bart:
'As Honorary Chairman of the Welcoming Committee, it is my privilege to extend a laurel and hearty handshake to our new sheriff."
Laurel and hearty handshake = Laurel and Hardy handshake
Mel Brooks, like any smart person, will use a good idea when he sees one.