3

I have a fundamental-mode buffer with italics set. When I copy the buffer and paste it to an email compose buffer, the text appears but the italics don't. But if I open a .odt file with some italics in another application, copy its text, and paste it to the email compose buffer, the text appears, with italics. If there is a command that lets me promote my buffer to some other mode, so that when I copy/paste it elsewhere, the italics come along? I don't want to use my fingers for anything. I have hooks that, on read-in, read a file and clear the high bits it finds, but set the italic face property on those characters. Ideal would be a command that said write-out-this-buffer-and-make-a-.odt-file-out-of-it. If promotion to some other mode would have the effect I need, how could I cause that?

3
  • Italics in different applications are no doubt implemented differently. In Emacs different fonts are used. If you were able to process the copied text, to put an Emacs text property on its italics bits, then you could use option yank-handled-properties to make sure that gets transferred when you yank text. But who knows what the text you copy from some other application actually contains as characters information? Does it include chars with fonts, using different a different font for italics, for instance? How does it represent that copied info?
    – Drew
    Commented Oct 7, 2022 at 2:07
  • I see now that your question is the reverse of what I said in my previous comment. You want to copy Emacs text, with its fonts, and paste in another app. What does that app expect as input?
    – Drew
    Commented Oct 7, 2022 at 2:09
  • Is your "email compose buffer" in another app, or is it an Emacs buffer. If the latter, and if the italics etc. are the result of font-locking, try removing font-lock-face from option yank-eyank-excluded-properties.
    – Drew
    Commented Oct 7, 2022 at 2:13

1 Answer 1

1

I'm not sure this fix your particular problem, but the package highlight2clipboard allows you to copy highlighted text from an Emacs buffer to an external application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.