A lot of things helped Wesley Thomas survive 29 years living on Washington’s streets: the meals distributed by the charity Miriam’s Kitchen, the coins he’d panhandle around Foggy Bottom, his own hard-earned smarts.

On Friday afternoon, another lifesaver sat in a sun-filled room at Western Presbyterian Church waiting to meet him: best-selling thriller writer Patricia Cornwell.

I wrote about Thomas last month, about how addiction and mental illness forced him onto the streets. In 2017, with the help of Miriam’s Kitchen, Thomas was able to move into an apartment. I asked him what he likes to do now that his life is more stable. Read, he said, especially books by his favorite author, Cornwell.

Well, the creator of medical examiner Dr. Kay Scarpetta happened to see that column. She wanted to hand-deliver an inscribed copy of her latest book, “Autopsy,” to Thomas.

“I felt very honored to be mentioned in this way,” Cornwell told me. “I knew I had a trip coming to D.C. I wanted to try to work it out, come here and meet him, and, hey, make a new friend.”

I’d told Thomas that Cornwell’s publisher had contacted me, but he didn’t know the author herself would be waiting for him on Friday, along with me, a radio reporter and a TV cameraman.

“You all set me up,” he said when the surprise was sprung.

“I feel pretty honored to meet you,” Cornwell said. “And that’s the truth. I do want you to know, this is the only in-person book signing I have done in the whole world for this book, for you.”

Cornwell was in town to chat with federal law enforcement officials, many of whom are among her biggest fans. They appreciate the research that goes into her richly detailed books. A licensed helicopter pilot, she wore a blue shirt embroidered with a chopper.

“To meet someone that I admire as an author is an amazing thing,” Thomas said.

“This is fun for both of us,” Cornwell said. “We both got to do something special today.”

I’d thought that Thomas had started gorging on Cornwell’s novels after he’d found a home. But he said her books had been a lifeline throughout his decades on the streets.

“Every day I’d go to the Foggy Bottom library, for warmth and for reading,” he said.

Said Cornwell: “That makes me respect libraries even more than I did.”

“Her books, and all the characters in there, just drew me in and gave me stability,” Thomas said. “I’d wait and think, ‘What’s the next book? What’s the next book?’ ”

“You probably learned to avoid serial killers, too,” Cornwell said with a smile.

“It got me through the times, basically, because I love to read,” Thomas said. “Your mind will take you anywhere. A book will take you anywhere.”

When the outside world is hard to bear, we sometimes rely on the ones we create in our heads.

The cover of Cornwell’s “Autopsy” features an image of the White House. That’s a building Thomas spent a lot of time looking at. When he first became homeless, he slept in Lafayette Square, before favoring Washington Circle, which was closer to Miriam’s Kitchen.

The charity — a partner in The Washington Post Helping Hand — was founded in 1983. What began as an effort to provide meals to people without homes has broadened since then. Miriam’s Kitchen still serves food — 70,000 healthy breakfasts and dinners last year — but its case managers also work with clients to find housing and serve as advocates when dealing with landlords.

Clients and staff members meet with legislators to advocate permanent supportive housing of the sort that allows Thomas to have a roof over his head. You can learn more about Miriam’s Kitchen — and donate — by visiting posthelpinghand.com.

To give by check, write Miriam’s Kitchen, Attn: Development, 2401 Virginia Ave. NW, Washington, DC 20037.

At Western Presbyterian Church, home to Miriam’s Kitchen, Cornwell made her own donation and presented Thomas with a copy of “Autopsy.”

“You’ll have to let me know if you like it,” she said. “I have no doubt you have some amazing ideas. And you might write your own.”

Over the shoulders of the writer and the reader — emblazoned on a gray stone set into the wall — was a Bible verse: “Do not neglect to show hospitality to strangers, for thereby some have entertained angels unawares.”

“Isn’t that a nice thing to have on the wall?” Cornwell said. “Everybody should have that in their living room.”

That and a bookcase groaning with books, of course.

Twitter: @johnkelly

For previous columns, visit washingtonpost.com/johnkelly.