When I copy text from another application and paste it into Emacs it removes all formatting including the empty lines between paragraphs. I would like to paste into Emacs and preserve the empty lines. I am running Debian 10. My version of Emacs is GNU Emacs 27.0.50. The behaviour is reproducible with emacs -Q. The specific application in question is Atril document viewer.

  • 2
    All newlines are preserved if I open 2* emacs-26.3 -Q, open the tutorial in one of them, copy it and paste it into the *scratch* buffer of the other. That indicates that there is way too little information in this question. Which operating system? Which Emacs version? Is the behavior reproduceable with emacs -Q? Which other application do you mean? I retract my close-vote as soon as the question contains that information. – Tobias Nov 6 '19 at 11:19
  • What @Tobias said. Please provide a recipe to reproduce the problem, starting with emacs -Q (no init file). – Drew Nov 6 '19 at 14:09
  • 1
    @Drew I can reproduce the effect now with the info given in the question. Though I do not think that this is an Emacs problem. The pdf-Viewer Atril or also Xpdf does not copy the text object from the pdf file with the correct number of newlines and Emacs cannot guess what the correct number was. But, pdftotext converts the pdf with the correct number of newlines into a text file. So the info is actually there in the pdf. – Tobias Nov 6 '19 at 14:17
  • 1
    BTW: Copy-paste from pdf-tools does also not preserve the number of newlines. (That is my preferred pdf-viewer since it supports occur and regular expression search.) – Tobias Nov 6 '19 at 14:20
  • 1
    @Tobias: So it sounds like M-x report-emacs-bug is maybe in order, to report an enhancement request / bug for pdf-tools (?). – Drew Nov 6 '19 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.