Last active
December 14, 2015 19:09
-
-
Save river24/5134316 to your computer and use it in GitHub Desktop.
utf-8-hfs な Emacs から日本語を pbcopy した際の NFD / NFC 問題対策
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; clipboardの共有 | |
| ;; Original : http://hakurei-shain.blogspot.jp/2010/05/mac.html | |
| (when darwin-p | |
| (defun copy-from-osx () | |
| (shell-command-to-string "pbpaste")) | |
| (defun paste-to-osx (text &optional push) | |
| (let ((process-connection-type nil)) | |
| (start-process "pbcopy-from-emacs" "*Messages*" "pbcopy-from-emacs" text))) | |
| (setq interprogram-cut-function 'paste-to-osx) | |
| (setq interprogram-paste-function 'copy-from-osx)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ECHO="/bin/echo" | |
| ICONV="/usr/bin/iconv" | |
| PBCOPY="/usr/bin/pbcopy" | |
| if [ $# -lt 1 ] | |
| then | |
| exit | |
| else | |
| TEXT=$1 | |
| ${ECHO} -n "${TEXT}" | ${ICONV} -f UTF-8-MAC -t UTF-8 | ${PBCOPY} | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment