mid-14c., "constant and earnest effort to accomplish what is undertaken," from Old French diligence "attention, care; haste, speed" and directly from Latin diligentia "attentiveness, carefulness," from diligentem (nominative diligens) "attentive, assiduous, careful," present-participle adjective from diligere "single out, value highly, esteem, prize, love; aspire to, be content with, appreciate," originally "to pick out, select," from dis- "apart" (see dis-) + legere "choose, gather," from PIE root *leg- (1) "to collect, gather," with derivatives meaning "to speak (to 'pick out words')."
Sense evolved through time from "love" through "attentiveness" to "carefulness" to "steady effort." Legal sense "attention and care due from a person in a given situation" is from 1620s. From the secondary French sense comes the old useage of diligence for "public stage coach" (1742; dilly for short), from a French shortening of carrosse de diligence.
late 14c., attencioun, "a giving heed, active direction of the mind upon some object or topic," from Old French attencion and directly from Latin attentionem (nominative attentio) "attention, attentiveness," noun of action from past-participle stem of attendere "give heed to," literally "to stretch toward," from ad "to, toward" (see ad-) + tendere "stretch" (from PIE root *ten- "to stretch").
Rare in English before 17c. The meaning "consideration, observant care" is from 1741; that of "civility, courtesy" is from 1752. The meaning "power of mental concentration" is from 1871. It is used with a remarkable diversity of verbs (pay, gather, attract, draw, call, etc.). As a military cautionary word before giving a command, it is attested from 1792. Attention span is from 1903 (earlier span of attention, 1892). Related: Attentions.