early 14c., "one who holds an official post, one entrusted with a responsibility or share of the management of some undertaking" (originally a high office), from Old French oficier "officer, official" (early 14c., Modern French officier), from Medieval Latin officiarius "an officer," from Latin officium "a service, a duty" (see office).
In Middle English also "a servant, a retainer of a great household; an official at court" (late 14c.). From late 14c. as "a military retainer," but the modern military sense of "one who holds a commission in the army or navy" is from 1560s. Applied to petty officials of justice from 16c.; U.S. use in reference to policemen is from 1880s.
The phrase officer and a gentleman in reference to one having the qualities of both is by 1762 and was standard language in British court-martial indictments ("behaviour infamous and scandalous such as is unbecoming the character of an officer and a gentleman").
The words 'officer and gentleman,' though in general to be understood as one single and indivisible term, appear not to be so used here. The misbehaviour, entailing on it the penalty declared by this article, must be such, as I understand it, as to implicate, in the first place, the officer; that is, it must arise in some sort out of his office; and affect incidentally only, the character of the gentleman. It must be such a misconduct, as must necessarily dissever what should ever be indivisible, the consideration of the officer from the gentleman. It must be of that decisively low, humiliating, and debasing kind, as to lay prostrate the honour of the gentleman, in the degradation of the officer. [Capt. Hough and George Long, "The Practice of Courts-Martial," London, 1825]
mid-12c. "grant, commission" (recorded earlier in Old English, but as a Latin word), from Old French privilege "right, priority, privilege" (12c.) and directly from Latin privilegium "law applying to one person, bill of law in favor of or against an individual;" in the post-Augustine period "an ordinance in favor of an individual" (typically the exemption of one individual from the operation of a law), "privilege, prerogative," from privus "individual" (see private (adj.)) + lex (genitive legis) "law" (see legal (adj.)).
From c. 1200 as "power or prerogative associated with a certain social or religious position." Meaning "advantage granted, special right or favor granted to a person or group, a right, immunity, benefit, or advantage enjoyed by a person or body of persons beyond the common advantages of other individuals" is from mid-14c. in English. From late 14c. as "legal immunity or exemption."
Formerly of such things as an exemption or license granted by the Pope, or special immunity or advantage (as freedom of speech) granted to persons in authority or in office; in modern times, with general equality of all under the law, it is used of the basic rights common to all citizens (habeas corpus, voting, etc.).
Privilege is also more loosely used for any special advantage: as, the privilege of intimacy with people of noble character. Prerogative is a right of precedence, an exclusive privilege, an official right, a right indefeasible on account of one's character or position : as, the Stuart kings were continually asserting the royal prerogative, but parliament resisted any infringement upon its privileges. [Century Dictionary]
Middle English also had pravilege "an evil law or privilege" (late 14c.), from Medieval Latin pravilegium, a play on privilegium by substitution of pravus "wrong, bad."
1726, "morbid longing to return to one's home or native country, severe homesickness considered as a disease," Modern Latin, coined 1688 in a dissertation on the topic at the University of Basel by scholar Johannes Hofer (1669-1752) as a rendering of German heimweh "homesickness" (for which see home + woe).
From Greek algos "pain, grief, distress" (see -algia) + nostos "homecoming," from neomai "to reach some place, escape, return, get home," from PIE *nes- "to return safely home" (cognate with Old Norse nest "food for a journey," Sanskrit nasate "approaches, joins," German genesen "to recover," Gothic ganisan "to heal," Old English genesen "to recover"). French nostalgie is in French army medical manuals by 1754.
Originally in reference to the Swiss and said to be peculiar to them and often fatal, whether by its own action or in combination with wounds or disease.
[Dr. Scheuzer] had said that the air enclosed in the bodies of his countrymen, being in Æquilibrium with a rare and light air that surrounds them, was overloaded in lower countries with an air more dense and heavier, which compressing and obstructing the capillary vessels, makes the circulation slow and difficult, and occasions many sad symptoms. [Account of the publication of "Areographia Helvetiæ" in New Memoirs of Literature, London, March 1726]
By 1830s the word was used of any intense homesickness: that of sailors, convicts, African slaves. "The bagpipes produced the same effects sometimes in the Scotch regiments while serving abroad" [Penny Magazine," Nov. 14, 1840]. It is listed among the "endemic diseases" in the "Cyclopaedia of Practical Medicine" [London, 1833, edited by three M.D.s], which defines it as "The concourse of depressing symptoms which sometimes arise in persons who are absent from their native country, when they are seized with a longing desire of returning to their home and friends and the scenes their youth ...."
It was a military medical diagnosis principally, and was considered a serious medical problem by the North in the American Civil War:
In the first two years of the war, there were reported 2588 cases of nostalgia, and 13 deaths from this cause. These numbers scarcely express the real extent to which nostalgia influenced the sickness and mortality of the army. To the depressing influence of home-sickness must be attributed the fatal result in many cases which might otherwise have terminated favorably. ["Sanitary Memoirs of the War," U.S. Sanitary Commission, N.Y.: 1867]
Transferred sense (the main modern one) of "wistful yearning for the past" is recorded by 1920, perhaps from such use of nostalgie in French literature. The longing for a distant place also necessarily involves a separation in time.