Open arthurcgusmao opened 8 months ago
We do actually directly copy the buffer content to the clipboard, but during development I found that just using gui-select-text
wasn't actually 100% successful, as hinted in the code comment here:
;; In `emacs-everywhere-finish'
(gui-select-text (buffer-string))
(gui-backend-set-selection 'PRIMARY (buffer-string))
(when emacs-everywhere-copy-command ; handle clipboard finicklyness
(let ((inhibit-message t)
(require-final-newline nil)
write-file-functions)
(write-file buffer-file-name)
(apply #'call-process (car emacs-everywhere-copy-command)
nil nil nil
(mapcar (lambda (arg)
(replace-regexp-in-string "%f" buffer-file-name arg))
(cdr emacs-everywhere-copy-command)))))
Hi @tecosaur,
First of all, thanks a lot for this super useful package.
I have been taking a look at the source code and I see the current flow
emacs-everywhere-finish
:Why don't we shortcircuit (1) and (2) and directly copy the buffer contents to the clipboard?
From my understanding, that would make the application more robust across OSs, since Emacs already has the capability of copying to the system's clipboard...