How to copy paste without blocking source font in emacs?

When you copy text from one buffer to another (Mw and Cy), it copies the text with a font lock, and when you paste it, it displays the colors from the buffer that I copied the text. Is it possible to change this to display it using a font from a new buffer?

+4
source share
3 answers

See the document for user options yank-excluded-propertiesand yank-handled-properties. And start with the document yank: C-h f yank. He tells you:

When this command inserts text into the buffer, it honors the
`yank-handled-properties' and `yank-excluded-properties'
variables, and the `yank-handler' text property.  See
`insert-for-yank-1' for details.

IOW, just tell me yanknot to insert properties like faceand font-lock-face.

See also Elisp, node manual Yanking.

+8

, (set-text-properties (point) (mark) nil) .

. , . (, .)

+1

With this in the setup:

(global-set-key (kbd "C-x C-r") (lambda()(interactive)(revert-buffer nil t)))

you need to do C-x C-s C-x C-r.

0
source

Source: https://habr.com/ru/post/1528823/


All Articles