Mr. Leonard, who started out writing westerns, had his first story published in Argosy magazine in 1951, and 60 years later, he was still turning out a book a year because, he said, “It’s fun.”

It was in that spirit that Mr. Leonard, at 84, took more than a casual interest in the development of his short story “Fire in the Hole” for television. “Justified,” as the resulting series on FX was called, won a Peabody Award in 2011 in its second season and sent new fans to “Pronto” (1993) and “Riding the Rap” (1995), novels that feature the series’s hero, Raylan Givens (played by Timothy Olyphant), a federal marshal from Harlan County, Ky., who presents himself as a good ol’ country boy but is “not as dumb as you’d like to believe.”

Approving of how the show was working out, Mr. Leonard wrote his 45th novel, “Raylan,” with the television series in mind. Published in 2012, it featured three strong female villains and gave its cowboy hero license to shoot one of them.

It was a major concession for Mr. Leonard to acknowledge his approval of “Justified”; he had long been candidly and comically disdainful of the treatment his books generally received from Hollywood, even in commercially successful films like “Get Shorty,” “Be Cool,” “Out of Sight” and “Jackie Brown” (based on his novel “Rum Punch”). His first novel, “The Big Bounce,” was filmed twice, in 1969 and 2004. After seeing the first version, he declared it to be “at least the second-worst movie ever made.” Once he saw the remake, he said, he knew what the worst one was. (Yet another movie based on a Leonard novel is to open this year: “Life of Crime,” based on “The Switch” and starring Jennifer Aniston and Tim Robbins.)

In an interview with the author Doug Stanton for the National Writers Series in 2011, Mr. Leonard explained why “Get Shorty,” the 1995 movie starring John Travolta, was a faithful treatment of his novel of the same title, and why its sequel, “Be Cool,” was not. The directive he had given the producers about his clever crooks — “These guys aren’t being funny, so don’t let the other characters laugh at their lines” — was heeded in the first case, he said, and ignored in the second.