GNU Emacs 26.1 (build 1, x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit 1504.83) of 2019-01-27

I just recently installed the emacs-mac port of GNU Emacs 26, and the OS copy/paste functionality does not seem to work. I am on using the GUI so my understanding is the functionality should work OOB (It does for non-port)

I am not able to copy text from my OS into emacs or vice/versa.

Any help would be appreciated.

  • 1
    If copy/paste does not work with zero user-configuration, then you should file a bug report with the maintainer of that port. If copy/paste works as expected with zero user-configuration, then you may need to bisect your user-configuration by commenting stuff out (save, restart, repeat process) until you find the culprit.
    – lawlist
    Mar 27, 2019 at 15:43
  • I have the Cocoa version (GNU Emacs 26.2 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2019-04-12) and there it works out of the box. The key binding is defined in ns-win.el.gz Apr 17, 2019 at 6:49

1 Answer 1


This is a verbatim paste of my homegrown configuration for getting system clipboard integration on macOS. I installed Emacs with brew, if that makes a difference.

;; This works for copying, but not pasting for some reason
(setq select-enable-clipboard t)

;; Whatever... it's easy enough to implement that part ourselves
(setq interprogram-paste-function
      (lambda ()
        (shell-command-to-string "pbpaste")))

It does the trick for me. Let me know if it works for you, too.

  • This is functionally what I was looking for. I'll have to rebind some keys for my config but it works! Mar 28, 2019 at 15:36
  • Glad to hear it!
    – eeowaa
    Mar 28, 2019 at 15:38
  • This is a great, but the second command is un-balanced (extra right paren) Nov 21, 2021 at 16:02
  • @ZephaniahGrunschlag Fixed
    – eeowaa
    Dec 31, 2021 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.