another solution is just use cli tool if possible,
The advantage of this solution is that the clipboard is always usable (for example, when you remote ssh).
My answer has two parts. part one introduce some handy tools to manipulate the clipboard. part two will answer your original question (store clipboard into kill ring).
PART ONE
Insert below code into your ~/.emacs:
(setq *is-a-mac* (eq system-type 'darwin))
(setq *cygwin* (eq system-type 'cygwin) )
(setq *linux* (or (eq system-type 'gnu/linux) (eq system-type 'linux)) )
(defun copy-to-x-clipboard ()
(interactive)
(if (region-active-p)
(progn
(cond
((and (display-graphic-p) x-select-enable-clipboard)
(x-set-selection 'CLIPBOARD (buffer-substring (region-beginning) (region-end))))
(t (shell-command-on-region (region-beginning) (region-end)
(cond
(*cygwin* "putclip")
(*is-a-mac* "pbcopy")
(*linux* "xsel -ib")))
))
(message "Yanked region to clipboard!")
(deactivate-mark))
(message "No region active; can't yank to clipboard!")))
(defun paste-from-x-clipboard()
(interactive)
(cond
((and (display-graphic-p) x-select-enable-clipboard)
(insert (x-selection 'CLIPBOARD)))
(t (shell-command
(cond
(*cygwin* "getclip")
(*is-a-mac* "pbpaste")
(t "xsel -ob"))
1))
))
(defun my/paste-in-minibuffer ()
(local-set-key (kbd "M-y") 'paste-from-x-clipboard)
)
(add-hook 'minibuffer-setup-hook 'my/paste-in-minibuffer)
PART TWO
insert below code into your ~/.emacs, and from now on, use "M-x paste-from-clipboard-and-cc-kill-ring" to paste:
(defun paste-from-clipboard-and-cc-kill-ring ()
"paste from clipboard and cc the content into kill ring"
(interactive)
(let (str)
(with-temp-buffer
(paste-from-x-clipboard)
(setq str (buffer-string)))
;; finish the paste
(insert str)
;; cc the content into kill ring at the same time
(kill-new str)
))