When Louis C. K. gets excited about something, he really gets excited. Case in point: in a recent interview with the Arts & Leisure section of The Times, he expounded on many subjects, including his coming HBO special, “Oh My God,” his work with Woody Allen on “Blue Jasmine” and the number of years he believes he has left in his career. But when the topic of conversation turned to David Lynch, the “Blue Velvet” and “Mulholland Dr.” filmmaker, a certain gleam appeared in his eye. Over the next several minutes, Louis C. K. enthusiastically recounted the story of how he cast Mr. Lynch on “Louie” in the role of Jack Dall, an inscrutable entertainment-industry veteran who trains the Louie character for a fateful audition to replace David Letterman on “Late Show.”

Here, in more words than could reasonably fit into one newspaper, is that story:

To me, it was Ben Gazzara. I was doing Ben Gazzara [for “Louie” producer Vernon Chatman], making him laugh, and I’m doing all these lines: “Listen, champ – that’s short for champion.” It was supposed to be this old, grizzly guy, telling you that’s short for champion, like you’re too stupid to know it. We’re laughing, and we’re like, “This is going to be amazing.” So Vernon Googles Ben Gazzara while we’re talking. He died an hour before he Googled it. I think it’s possible, the minute I said, “I think this is Ben Gazzara,” he dropped dead. “Let’s get Ben Gazzara.” [makes sound of flat-lining] Those two things happened at the exact same moment, which is crazy. So I finished writing it and then we went looking for who else can do this.

I sent it to Jerry Lewis. Jerry Lewis’s system of approval is a fax machine in his office. You fax it to him and you wait to hear from him. We got a phone call from his personal secretary saying, “Jerry is not interested at this time.” We reached out to Woody Allen, who said, “I can’t contribute to this right now.” I got a really nice email from Al Pacino. Martin Scorsese said, [Scorsese voice] “Louie’s terrific, I enjoy the program, I can’t be any part of this right now.” What I learned is that the level I’m at now, I get polite nos. It used to just be nothing but silence.

When Scorsese said no, I thought, Oh, directors. I Googled [Francis Ford] Coppola to see if he had acted in anything. And on the page I was at: directors, David Lynch. The thing is, I love David Lynch. I’ve always loved him, like a warm love for him – not just thinking he’s great. His movies are a massive thing for me. He gives you this license to do whatever you want. [David Lynch voice] I remember him on Letterman and he speaks like this Midwest, Nebraska, American broadcaster of the 1940s. [Normal voice] And I thought, “That would be really weird. It doesn’t make any sense. It makes no sense.” I put him in my head and I read the script and I’m like, “This is way better than any of those guys. This is the only guy that could ever do it. If I don’t get David Lynch, I’m not doing it.”

He has a lawyer and an assistant. So I sent the script with a letter, and I said, “If I never get to say anything else to you, thank you for your work and what it’s meant to me. This is a guy I think you would be perfect playing.” The first response came from his assistant, Mindy, who was very nice and said, “He loves the script, he thinks it’s really excellent. He doesn’t want to mess it up for you. He doesn’t think he’s right for it. He doesn’t like traveling either.” So I wrote back and said, “I want you to know that I’m not expecting you to play this guy the way he reads on paper. I’m not expecting you to play a different kind of person than you. The idea is that you, being the way you are naturally, the way you speak, delivering these lines, is what I’m looking for – that’s what I want to see.” And then he wrote back and said, “Aren’t there 10,000 other people that could do this better than me? And I don’t like traveling.”

I wrote back and I said, “I can’t argue with the traveling. You want to be with your family. We’ll certainly give you the best possible accommodations and travel. But if there were 10,000 other people, I would get one. And I’m really good at this. I know what works on my show. I’m never wrong. I don’t know what it’s going to be like. There’s not some expectation that you have to measure up to. I’m excited to be wrong here.” He would always write back through his assistant, earnestly and sincerely and gently saying no. And then finally I got one where they said, “Can it be done in two days, and can he wear his own clothes? And no.” And I was like, “I got him.” It took like two months and we got him. Once I got him, I’m like, “Is this a good idea?”

I’ve learned when you work with people that are heroes to you, you have to be really careful, especially if you’re directing them. It’s unsettling to act and you feel a little untethered, and the director makes you feel like someone else is in control and it helps you. So when the director is someone going, “Oh my God, I’m like the biggest fan of you” – when he showed up, I said “Hi” to him, quickly. “You have any questions? Thank you for coming.” And I stayed away from him. And we just started shooting. The first thing we shot was him coming to say goodbye to me, his last scene. And he comes and sits down and he just says, “Well, I’ve done my part. Now it’s up to you. It’s just, if you can do it.” I’m sitting there in character, going, “I can’t believe how good everything he says is. This is way better than I thought it would be.” He had it perfectly memorized. He had something to prove as an actor.

When we did the scene in the office where I dance around, it was really humiliating. I’m doing this in front of this guy, who I love, and it gave me a stomachache. At one point, out of self-consciousness, I said, “This isn’t even funny.” And David said, “No, it’s not funny. It’s not supposed to be.” He said, “Jack doesn’t give you the extra week ‘cause he thought you were funny – don’t make any mistake of that. He gave you the extra week because you did something. He finally got you try and do something. And by the way, that extra week was pretty close to, you didn’t get it.” He had a few things to say like that. I got to hang out with him, smoke cigarettes with him, even though I haven’t smoked in a year. I love the guy. I love him.