[osx] Replace pbcopy by osx-clipboard

Why:

* When using emacs >= 26, pbcopy has latency actions in terminal.

This change addresses the need by:

* Replace pbcopy by osx-clipboard
This commit is contained in:
Minh Nguyen-Hue 2018-08-26 12:26:26 +07:00 committed by duianto
parent 9941c60b5c
commit 8709b7e727
2 changed files with 17 additions and 12 deletions

View File

@ -1756,6 +1756,7 @@ Other:
- Added key bindings to use ~command-1..9~ for selecting window
(thanks to Liu Joey)
- Added ~M-s-h~ to hide other windows (thanks to Bas Veeling)
- Replace pbcopy by osx-clipboard (thanks to Minh Nguyen-Hue)
**** Pandoc
- Fixed =spacemacs/run-pandoc= not to reset =pandoc--local-settings= (thanks to
martian-f)

View File

@ -16,9 +16,7 @@
launchctl
(osx-dictionary :toggle osx-use-dictionary-app)
osx-trash
;; disabled because it introduces input latency with some
;; actions when using emacs -daemon and opening a GUI client
;; pbcopy
osx-clipboard
reveal-in-osx-finder
term
))
@ -105,15 +103,21 @@
(not (boundp 'mac-system-move-file-to-trash-use-finder)))
:init (osx-trash-setup)))
;; TODO: find a way to enable it in terminal with a dumped Spacemacs
;; if this package is activate while dumping it makes some action lag
;; like 'dd' to delete a line etc...
;; (defun osx/init-pbcopy ()
;; (use-package pbcopy
;; :if (and (spacemacs/system-is-mac)
;; (not (display-graphic-p))
;; (not (spacemacs-is-dumping-p)))
;; :init (turn-on-pbcopy)))
(defun osx/init-osx-clipboard ()
(use-package osx-clipboard
:if (spacemacs/system-is-mac)
:commands
(osx-clipboard-paste-function osx-clipboard-cut-function)
:init
(progn
(setq interprogram-cut-function '(lambda (text &rest ignore)
(if (display-graphic-p)
(gui-select-text text)
(osx-clipboard-cut-function text)))
interprogram-paste-function '(lambda ()
(if (display-graphic-p)
(gui-selection-value)
(osx-clipboard-paste-function)))))))
(defun osx/init-reveal-in-osx-finder ()
(use-package reveal-in-osx-finder