pinwheel: Update copy/paste in emacs to work in terminals

This commit is contained in:
Alexander Heldt
2023-11-06 17:01:29 +01:00
parent a501af2209
commit 9514c45210

View File

@@ -83,7 +83,7 @@
** Use wl-clipboard for interprocess copy/paste ** Use wl-clipboard for interprocess copy/paste
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq wl-copy-process nil) (setq wl-copy-process nil)
(when (string-prefix-p "wayland" (getenv "WAYLAND_DISPLAY"))
(defun wl-copy (text) (defun wl-copy (text)
(setq wl-copy-process (make-process :name "wl-copy" (setq wl-copy-process (make-process :name "wl-copy"
:buffer nil :buffer nil
@@ -97,10 +97,8 @@
nil ; should return nil if we're the current paste owner nil ; should return nil if we're the current paste owner
(shell-command-to-string "wl-paste -n | tr -d \r"))) (shell-command-to-string "wl-paste -n | tr -d \r")))
(when (display-graphic-p)
(setq interprogram-cut-function 'wl-copy) (setq interprogram-cut-function 'wl-copy)
(setq interprogram-paste-function 'wl-paste) (setq interprogram-paste-function 'wl-paste))
)
#+END_SRC #+END_SRC
** Don't create backup files, don't create #autosave# files ** Don't create backup files, don't create #autosave# files
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp