[Emacs] Add copyq-sync function

This commit is contained in:
Ivan Malison 2016-09-30 17:48:25 -07:00
parent 11513a19be
commit 073c3dbb8a
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -0,0 +1,11 @@
(defun imalison:copyq-get (i)
(imalison:shell-command-to-string (format "copyq eval read(%s)" i)))
(defun imalison:copyq-sync ()
(interactive)
(let ((missing-items (cl-loop for i from 0 to (string-to-int
(imalison:shell-command-to-string "copyq eval size()"))
for item = (imalison:copyq-get i)
when (not (member item kill-ring))
collect item)))
(setq kill-ring (nconc kill-ring missing-items))))