What are you trying to achieve?
When doing a "yank", I don't want it to clobber the system clipboard. Likewise for pasting.
What have you tried?
Adding (remove-hook 'doom-post-init-hook #'osx-clipboard-mode) as directed in #938
This doesn't seem to do anything. It still uses the system clipboard.
Adding (setq select-enable-clipboard nil)
This does prevent it using the system clipboard, but also breaks accessing the clipboard with the "+ prefix.
System information
((emacs
(version . "26.3")
(features . "NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS")
(build . "Apr 07, 2020")
(buildopts "--enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-mac/emacs-26.3-z-mac-7.9/share/info/emacs --prefix=/usr/local/Cellar/emacs-mac/emacs-26.3-z-mac-7.9 --with-mac --enable-mac-app=/usr/local/Cellar/emacs-mac/emacs-26.3-z-mac-7.9 --with-gnutls")
(windowsys . batch)
(daemonp . server-running))
(doom
(version . "2.0.9")
(build . "HEAD -> develop, origin/develop, origin/HEAD a381f5926 2020-04-03 02:12:50 -0400")
(dir . "~/Documents/dotfiles/doom-emacs/"))
(system
(type . darwin)
(config . "x86_64-apple-darwin19.3.0")
(shell . "/usr/local/bin/fish")
(uname . "Darwin 19.3.0 Darwin Kernel Version 19.3.0: Fri Jan 10 21:15:49 PST 2020; root:xnu-6153.81.5~4/RELEASE_X86_64 x86_64")
(path "/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/usr/local/go/bin" "/usr/local/Cellar/emacs-mac/emacs-26.3-z-mac-7.9/libexec/emacs/26.3/x86_64-apple-darwin19.3.0"))
(config
(envfile . envvar-file)
(elc-files . 0)
(modules :completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +defaults) tabs vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold snippets :emacs dired electric vc :checkers syntax :tools (eval +overlay) lookup magit :lang data emacs-lisp markdown org sh :config (default +bindings +smartparens))
(packages (inertial-scroll :recipe (:host github :repo "kiwanami/emacs-inertial-scroll")) (centaur-tabs))
(unpin "n/a")
(elpa "n/a")))
In a roundabout fashion, this might be pertinent to what you're seeing https://github.com/hlissner/doom-emacs/issues/2617, particularly this bit:
(remove-hook 'tty-setup-hook 'doom-init-clipboard-in-tty-emacs-h)
@shanesveller's solution should work. As of 95258c55d Doom no longer uses osx-clipboard-mode, and later switched it out for xclip. As of 215d9646e we've added clipetty to communicate with your clipboard directly through your terminal (by using OSC 52 codes on supported terminals). And soon, I'll remove xclip-mode.
In any case, all that clipboard setup is done in doom-init-clipboard-in-tty-emacs-h, so removing it from tty-setup-hook should do what you are asking for.
Let me know if that isn't the case and I'll reopen this.
This didn't seem to work unfortunately. Yanking and pasting still uses the system clipboard.
To be clear, I'm not using terminal emacs.
Interestingly, I've just noticed that when I do a "+p, the error line displayed is Marker '[' is not set in this buffer. Not sure exactly what this means...
@hlissner would you mind reopening this, as the suggestion did not seem to work?
I've just noticed that using (setq select-enable-clipboard nil) does work in the terminal, and I'm still able to use "+p in the terminal. So it's only in the GUI emacs that I'm unable to use "+p.
I've been playing around a lot, and I've finally been able to get it to work using the mac ports emacs-app-devel build. It now works exactly as expected using (setq select-enable-clipboard nil). Previously I was using the homebrew emacs-plus package.