Skip to content

Commit

Permalink
Use sleep-for over sit-for to ensure proper clipboard contents #25
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunggyuJang authored and tecosaur committed Apr 22, 2021
1 parent d65ba8d commit 64ba2e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions emacs-everywhere.el
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Never paste content when ABORT is non-nil."
(write-file buffer-file-name)
(pp (buffer-string))
(call-process "xclip" nil nil nil "-selection" "clipboard" buffer-file-name))))
(sit-for 0.01) ; prevents weird multi-second pause, lets clipboard info propagate
(sleep-for 0.01) ; prevents weird multi-second pause, lets clipboard info propagate
(let ((window-id (emacs-everywhere-app-id emacs-everywhere-current-app)))
(if (eq system-type 'darwin)
(call-process "osascript" nil nil nil
Expand Down Expand Up @@ -386,7 +386,7 @@ return windowTitle"))
(progn
(call-process "osascript" nil nil nil
"-e" "tell application \"System Events\" to keystroke \"c\" using command down")
(sit-for 0.01) ; lets clipboard info propagate
(sleep-for 0.01) ; lets clipboard info propagate
(yank))
(when-let ((selection (gui-get-selection 'PRIMARY 'UTF8_STRING)))
(gui-backend-set-selection 'PRIMARY "")
Expand Down

0 comments on commit 64ba2e3

Please sign in to comment.