Longing is a Desire, or Appetite, to possess something which is encouraged by the memory of that thing, and at the same time restrained by the memory of other things which exclude the existence of the thing wanted.
Exp.: When we recollect a thing (as we have often said before), we are thereby disposed to regard it with the same affect as if it were present. But while we are awake, this disposition, or striving, is generally restrained by images of things that exclude the existence of what we recollect. So when we remember a thing that affects us with some kind of Joy, we thereby strive to regard it as present with the same affect of Joy—a striving which, of course, is immediately restrained by the memory of things that exclude its existence.
Longing, therefore, is really a Sadness which is opposed to that Joy which arises from the absence of a thing we hate (see P47 S). But because the word longing seems to concern Desire, I relate this affect to the affects of Desire.