Attorney General Eric H. Holder Jr. said Thursday that he “thinks the world” of former colleague Robert Gates, who has spent the past few weeks peddling and receiving heat for the recently-published memoir about his years at the helm of the Pentagon.

But publishing the book, "Duty," while President Obama remains in office was poor form, Holder says.

“It’s my view that it’s just not a good thing to write a book about a president that you served while that president is still in office,” Holder said in an interview at the University of Virginia.

Holder didn’t say whether writing a tell-all of his own is on his to-do list, but he said his insider account would only come once Obama has joined the ranks of former presidents.

“There is a degree of candor that I think is potentially chilled by the prospect of having a book appear while the person you served is still serving as president,” said Holder, who admitted he glimpsed at the glossary of Gates’ book to spot references to himself.

Holder does not play a leading role in "Duty," but he evidently upset the defense chief at least once.

In the book, the former defense secretary, the only Cabinet level carryover from the George W. Bush administration, said he complained about Holder’s decision not to defend six Navy petty officers who were being sued by a former detainee at the military prison at Guantanamo Bay, Cuba, where they served as guards. Gates wrote he was upset Holder made the decision without consulting with him.

Relaying a conversation with then-White House Chief of Staff Rahm Emanuel, Gates wrote: “I told him in language I knew he’d understand that a decision by Justice not to defend innocent American service members was a travesty and a “huge [expletive] mistake.”

Holder agreed to pay for defense lawyers for the service members, but he thought it unwise to have government attorneys represent them.

The sailors were blameless, Gates wrote, “but Holder did not want to have to defend the constitutionality of holding prisoners at Guantanamo.”