On April 1, 1865, Whitman had signed a contract with Brooklyn printer Peter Eckler to publish Drum-Taps, a 72-page collection of 43 poems in which Whitman addressed the emotional experiences of the Civil War.
Drum-Taps was being printed at the time of Lincoln's assassination two weeks later.
Upon learning of the president's death, Whitman delayed the printing to insert a quickly-written poem, "Hush'd Be the Camps To-Day", into the collection.
The poem's subtitle indicates it was written on April 19, 1865—four days after Lincoln's death.
Whitman intended to supplement Drum-Taps with several additional Civil War poems and a handful of new poems mourning Lincoln's death that he had written between April and June 1865.

Upon returning to Washington, Whitman contracted with Gibson Brothers to publish a pamphlet of eighteen poems that included two works directly addressing the assassination—"When Lilacs Last in the Dooryard Bloom'd" and "O Captain!
My Captain!".
He intended to include the pamphlet with copies of Drum-Taps.
The 24-page collection was titled Sequel to Drum-Taps and bore the subtitle When Lilacs Last in the Door-Yard Bloom'd and other poems.
The eponymous poem filled the first nine pages.
In October, after the pamphlet was printed, he returned to Brooklyn to have them integrated with Drum-Taps.
 
Whitman added the poems from Drum-Taps and Sequel to Drum-Taps as a supplement to the fourth edition of Leaves of Grass printed in 1867 by William E. Chapin.
Whitman revised his collection Leaves of Grass throughout his life, and each additional edition included newer works, his previously published poems often with revisions or minor emendations, and reordering of the sequence of the poems.
 The first edition (1855) was a small pamphlet of twelve poems.
At his death four decades later, the collection included over 400 poems.
For the fourth edition (1867)—in which "When Lilacs Last in the Dooryard Bloom'd" had first been included—Leaves of Grass had been expanded to a collection of 236 poems.
However, University of Nebraska literature professor Kenneth Price and University of Iowa English professor Ed Folsom describe the 1867 edition as "the most carelessly printed and most chaotic of all the editions" citing errata and conflicts with typesetters.
Price and Folsom note that book had five different formats—some including the Drum-Taps poems; some without.

"When Lilacs Last in the Dooryard Bloom'd" and his other three Lincoln Poems "O Captain!
My Captain", "Hush'd be the Camps To-day", "This Dust Was Once the Man" (1871) were included in subsequent editions of Leaves of Grass, although in Whitman's 1871 and 1881 editions it was separated from Drum-Taps.
 In the 1871 edition, Whitman's four Lincoln poems were listed as a cluster titled "President Lincoln's Burial Hymn".
In the 1881 edition, this cluster was renamed "Memories of President Lincoln".
Whitman considered the 1881 edition to be final—although the subsequent "Deathbed Edition" compiled 1891–1892 corrected grammatical errors from the 1881 edition and add three minor works.
Leaves of Grass has never been out of print since its first publication in 1855, and "When Lilacs Last in the Dooryard Bloom'd" is among several poems from the collection that appear frequently in poetry anthologies.
On April 1, 1865, Whitman had signed a contract with Brooklyn printer Peter Eckler to publish Drum-Taps, a 72-page collection of 43 poems in which Whitman addressed the emotional experiences of the Civil War. Drum-Taps was being printed at the time of Lincoln's assassination two weeks later. Upon learning of the president's death, Whitman delayed the printing to insert a quickly-written poem, "Hush'd Be the Camps To-Day", into the collection. The poem's subtitle indicates it was written on April 19, 1865—four days after Lincoln's death. Whitman intended to supplement Drum-Taps with several additional Civil War poems and a handful of new poems mourning Lincoln's death that he had written between April and June 1865.
Upon returning to Washington, Whitman contracted with Gibson Brothers to publish a pamphlet of eighteen poems that included two works directly addressing the assassination—"When Lilacs Last in the Dooryard Bloom'd" and "O Captain! My Captain!". He intended to include the pamphlet with copies of Drum-Taps. The 24-page collection was titled Sequel to Drum-Taps and bore the subtitle When Lilacs Last in the Door-Yard Bloom'd and other poems. The eponymous poem filled the first nine pages. In October, after the pamphlet was printed, he returned to Brooklyn to have them integrated with Drum-Taps.  
Whitman added the poems from Drum-Taps and Sequel to Drum-Taps as a supplement to the fourth edition of Leaves of Grass printed in 1867 by William E. Chapin. Whitman revised his collection Leaves of Grass throughout his life, and each additional edition included newer works, his previously published poems often with revisions or minor emendations, and reordering of the sequence of the poems.  The first edition (1855) was a small pamphlet of twelve poems. At his death four decades later, the collection included over 400 poems. For the fourth edition (1867)—in which "When Lilacs Last in the Dooryard Bloom'd" had first been included—Leaves of Grass had been expanded to a collection of 236 poems. However, University of Nebraska literature professor Kenneth Price and University of Iowa English professor Ed Folsom describe the 1867 edition as "the most carelessly printed and most chaotic of all the editions" citing errata and conflicts with typesetters. Price and Folsom note that book had five different formats—some including the Drum-Taps poems; some without.
"When Lilacs Last in the Dooryard Bloom'd" and his other three Lincoln Poems "O Captain! My Captain", "Hush'd be the Camps To-day", "This Dust Was Once the Man" (1871) were included in subsequent editions of Leaves of Grass, although in Whitman's 1871 and 1881 editions it was separated from Drum-Taps.  In the 1871 edition, Whitman's four Lincoln poems were listed as a cluster titled "President Lincoln's Burial Hymn". In the 1881 edition, this cluster was renamed "Memories of President Lincoln". Whitman considered the 1881 edition to be final—although the subsequent "Deathbed Edition" compiled 1891–1892 corrected grammatical errors from the 1881 edition and add three minor works. Leaves of Grass has never been out of print since its first publication in 1855, and "When Lilacs Last in the Dooryard Bloom'd" is among several poems from the collection that appear frequently in poetry anthologies.
When Lilacs Last in the Dooryard Bloom'd