Skip to content

Instantly share code, notes, and snippets.

@meandavejustice
Created January 16, 2014 02:54
Show Gist options
  • Save meandavejustice/8449080 to your computer and use it in GitHub Desktop.
Save meandavejustice/8449080 to your computer and use it in GitHub Desktop.
This function seems to be doing something weird when emacs is running in tmux. It makes `C-y` evaluate as 'mark set'. :(
;; normalize copy and paste for osx
(defun copy-from-osx ()
(shell-command-to-string "pbpaste"))
(defun paste-to-osx (text &optional push)
(let ((process-connection-type nil))
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
(process-send-string proc text)
(process-send-eof proc))))
(if (eq system-type 'darwin)
(progn
(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment