Skip to content

fix mouse-copy inside formatted text#698

Merged
xenodium merged 2 commits into
xenodium:mainfrom
jcubic:fix-mouse-copy
Jul 4, 2026
Merged

fix mouse-copy inside formatted text#698
xenodium merged 2 commits into
xenodium:mainfrom
jcubic:fix-mouse-copy

Conversation

@jcubic

@jcubic jcubic commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

This fixes the copy (yank) of the text inside formatted Markdown with a mouse. Not sure if the test makes sense here. Because you can't actually test this. You need a real window and a mouse to reproduce.

I use this code to be able to use the mouse to yank text:

(setq x-select-enable-clipboard t)
(setq mouse-drag-copy-region 'non-empty)
(setq x-select-enable-clipboard-manager nil)
;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
(setq interprogram-paste-function 'x-selection-value)
(delete-selection-mode t)

(add-to-list 'yank-excluded-properties 'font)
(add-to-list 'yank-excluded-properties 'font-lock-face)

Before the fix, when you copy the text with the mouse and select it (exactly the formatted text or inside), the text is not copied because the selection is empty.

The keyboard copy works fine. Only the mouse selection (yank) is affected.

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I'm making visual changes, so I'm including screenshots so you can view and discuss.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

@xenodium xenodium left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix

@xenodium xenodium merged commit 720cecd into xenodium:main Jul 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants