unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56325: [REGRESSION] (clipboard-yank) always pastes from kill-ring after text copy
@ 2022-06-30 13:48 Konstantin Kharlamov
       [not found] ` <handler.56325.B.165659692129643.ack@debbugs.gnu.org>
  2022-07-01  2:23 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 5+ messages in thread
From: Konstantin Kharlamov @ 2022-06-30 13:48 UTC (permalink / raw)
  To: 56325

After upgrade to latest development version at:

      fb0d95984b: Put the obsoletion earlier in the *Help* buffer

I found out that using (clipboard-yank) and (x-clipboard-yank) when
`select-enable-clipboard` is set to t, after copying a text to
clipboard once, results in them pasting from kill-ring instead of
clipboard.

# Steps to reproduce

1. Create /tmp/.emacs file with the following content:

    (setq select-enable-clipboard nil
          inhibit-startup-screen t)

    (defun clipboard-yank-test ()
      (interactive)
      (let ((select-enable-clipboard t))
        (clipboard-yank)))
    (global-set-key "\C-y" 'clipboard-yank-test)

    (defun clipboard-copy-fixed ()
      (interactive)
      (let ((select-enable-clipboard t))
        (clipboard-kill-ring-save (region-beginning)(region-end))))
    (global-set-key "\M-w" 'clipboard-copy-fixed)

2. Launch `HOME=/tmp/ emacs`
3. [you're in a *scratch* buffer] Move caret till word "create" on the
2nd line, select it by pressing M-f, then copy to the system clipboard
by pressing M-w
4. Move caret to another word, e.g. "file"
5. Delete the word "file" by pressing M-d
5. Press C-y to paste the current clipboard content

## Expected

A word "create" will be inserted as it is in the system clipboard.

Note: (clipboard-yank-test) pastes from the system clipboard not the
kill-ring due to `select-enable-clipboard` being set locally to t.

## Actual

The word you deleted in *scratch* buffer will be inserted instead of
"create".





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-01  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 13:48 bug#56325: [REGRESSION] (clipboard-yank) always pastes from kill-ring after text copy Konstantin Kharlamov
     [not found] ` <handler.56325.B.165659692129643.ack@debbugs.gnu.org>
2022-06-30 21:01   ` Konstantin Kharlamov
2022-07-01  2:23 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-01  7:10   ` Konstantin Kharlamov
2022-07-01  8:27     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).