Linghu Defen () (583–666), formally Duke Xian of Pengyang (), was a Chinese historian and politician. He was an official of the Chinese Sui and Tang dynasties. During the Tang era, he was a major proponent for the compilation of the histories of the Sui and its predecessor the Northern Zhou. He was eventually put in charge of compiling Northern Zhou's official history, Book of Zhou, which was completed in 636.

Background 
Linghu Defen was born in 583, during the reign of Emperor Wen of Sui. His ancestors had been from an aristocratic clan of Dunhuang, the Linghu clan of Dunhuang, but had later relocated to Yi Province (宜州, roughly modern Tongchuan, Shaanxi). His father Linghu Xi () served as an official during Emperor Wen's reign but died in anger after being imprisoned due to false accusations of corruption.  Late in the reign of Emperor Wen's son Emperor Yang, Linghu Defen was made the magistrate of Yaocheng County (藥城, in modern Bozhou, Anhui), but as by that time the Sui realm was had been thrown into a state of confusion due to agrarian rebellions, Linghu never took office.  In 617, after the general Li Yuan the Duke of Tang rose in rebellion against Emperor Yang's rule, Li Yuan's cousin Li Shentong () rose as well and made Linghu a member of his staff. In late 617, after Li Yuan captured the capital Chang'an and declared Emperor Yang's grandson Yang You the Prince of Dai emperor (as Emperor Gong), retaining power as regent, he invited Linghu to serve as a secretary on his staff.

During Emperor Gaozu's reign 
In 618, after Li Yuan received news that Emperor Yang had been killed in a coup at Jiangdu (江都, in modern Yangzhou, Jiangsu), he poisoned and killed Yang You and took the throne from him, establishing Tang Dynasty as its Emperor Gaozu. He made Linghu Defen an imperial attendant. In 622, Emperor Gaozu made Linghu Mishu Cheng (), the secretary general of the Palace Library, and had him participate on the compilation of the Yiwen Leiju, with the chancellor Chen Shuda.

At that time, after the great disturbance at the end of Sui, much of old book collections had been lost.  Linghu advocated, and Emperor Gaozu agreed, to seek out books and purchase them and, once they were bought, to have them copied as well.  After several years, the imperial collections were more comprehensive.  Linghu also pointed out that while the Southern Dynasties' histories were largely written, little have been formally compiled of Northern Zhou and Sui Dynasty's histories—and that the deeds of the great people of those two dynasties, including those of Emperor Gaozu's ancestors, would be lost.  Emperor Gaozu therefore issued an edict commissioning Xiao Yu, Wang Jingye (), and Yin Wenli () to compile the history of Northern Wei; Chen, Linghu, and Yu Jian () to compile the history of Northern Zhou; Feng Deyi and Yan Shigu to compile the history of Sui; Cui Shanwei (), Kong Shao'an (), and Xiao Deyan () to compile the history of Liang Dynasty; Pei Ju, Zu Xiaosun (), and Wei Zheng to compile the history of Southern Qi; and Dou Jin (), Ouyang Xun, and Yao Silian to compile the history of Chen Dynasty.  However, after the issuance of Emperor Gaozu's edict, not much actual historical compilation was carried out, and the projects stalled.

During Emperor Taizong's reign 
In 629, during the reign of Emperor Gaozu's son Emperor Taizong, Emperor Taizong was interested in the compilation of the histories, and he therefore issued an edict commissioning Linghu Defen and Cen Wenben to compile the history of Northern Zhou (Book of Zhou); Li Baiyao to compile the history of Northern Qi (Book of Northern Qi); Yao Silian to compile the histories of Liang (Book of Liang) and Chen (Book of Chen); and Wei Zheng to compile the history of Sui (Book of Sui), and to oversee the overall compilation project with Fang Xuanling.  These officials also convened to discuss the issue of the history of Northern Wei, but concluded that as Northern Wei's history has already been compiled in the past by Wei Shou (now known as the Book of Wei) and Wei Dan (魏澹, Wei Shou's cousin, who compiled a separate Book of Wei now no longer extant), it was no longer necessary to have a new compilation.  At Linghu's suggestion, the imperial censor Cui Renshi was also invited to join the Northern Zhou project, and Linghu himself also contributed to the compilation of the histories of Liang, Chen, Northern Qi, and Sui.  Later historians praised Linghu for spearheading the overall project.

In 632, Linghu was made the deputy minister of rites (), but continued to serve as an imperial historian.  He was also created the Baron of Pengyang.

In 636, the Book of Zhou was completed, and Linghu was awarded silk.

In 637, another work by Linghu, the New Rites (), was completed, and his title was promoted to Viscount of Pengyang.  Also that year, another project that Linghu participated in, the Records of Clans (), was completed as well, and he was awarded silk again.

In 641, Linghu was made a member of the staff of Emperor Taizong's son Li Chengqian the Crown Prince.  In 643, after Li Chengqian was deposed, Linghu was relieved of his duties.

In 644, Linghu was recalled to civil service and made the prefect of Ya Prefecture (雅州, roughly modern Ya'an, Sichuan), but was later removed from office due to his acts there.  Soon, however, when Fang was put in charge of compiling the history of Jin Dynasty (266–420) (Book of Jin), Linghu was made the lead editor on the project, which involved 118 editors, and the other editors largely followed Linghu's lead.  After the work was completed in 648, Linghu was made Mishu Jian (), the head of the archival bureau.

During Emperor Gaozong's reign 
Emperor Taizong died in 639 and was succeeded by his son Li Zhi the Crown Prince (as Emperor Gaozong).  In 640, Emperor Gaozong put Linghu Defen in charge of editing the laws, and made him the deputy minister of rites again, as well as an imperial scholar at Hongwen Pavilion ().  He was soon made the minister of worship (太常卿, Taichang Qing) and continued to serve as imperial scholar as well.

In 643, Linghu was made Guozi Jijiu (), the principal of the imperial university.  As Linghu had compiled the records of Emperor Taizong's reign after 639, he was awarded silk and made an imperial scholar at Chongxian Pavilion ().  He was later put in charge of compiling the records of Emperor Gaozong's reign as well, and his title was promoted to Duke of Pengyang.  In 662, he requested retirement and was allowed to retire with the honorific title of Jinzi Guanglu Daifu ().  He died in 666.  It was said that in his late years he was particularly diligent in writing, and whenever there were major compilation projects, he would participate.

References 

 Old Book of Tang, vol. 73.
 New Book of Tang, vol. 102.

582 births
666 deaths
7th-century Chinese historians
Historians from Shaanxi
Linghu clan of Dunhuang
Politicians from Tongchuan
Sui dynasty government officials
Tang dynasty historians
Tang dynasty government officials
Writers from Tongchuan