[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 - Added key bindings to use ~command-1..9~ for selecting window
(thanks to Liu Joey) (thanks to Liu Joey)
- Added ~M-s-h~ to hide other windows (thanks to Bas Veeling) - Added ~M-s-h~ to hide other windows (thanks to Bas Veeling)
- Replace pbcopy by osx-clipboard (thanks to Minh Nguyen-Hue)
**** Pandoc **** Pandoc
- Fixed =spacemacs/run-pandoc= not to reset =pandoc--local-settings= (thanks to - Fixed =spacemacs/run-pandoc= not to reset =pandoc--local-settings= (thanks to
martian-f) martian-f)

View file

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